Category: Testing (SD)

Higher – Testing and Documenting Solutions (Revision)

  •  Constructing a Test Plan: A set of test data which has been created to systematically and comprehensively to test the software; makes use of the following test data
    • normal – ensures the program works when used normally
    • extreme – ensures the program works when data is used that is on the boundaries of what is considered normal
    • exceptional – ensures a program can handle situations that it has not been designed to cope with; out with the boundaries
  • Comprehensive Testing: when every aspect of the software is tested
  • Syntax Error: a misspelling of a keyword or mistake in the structure of a program such as missing an ‘end if’
  • Logic Error: program will run but not as the programmer intended it to; for example when calculating the average it should be (a+b)/2 instead of a+b/2
  • Execution Error: an error occurs when the program is run, causing it to crash
  • Dry Runs: manual run through of pseudocode or source code of program, taking notes of the values of variables at various points in the process
  • Trace Tables: similar to the table used during a dry run but is often used to test an algorithm for a specific sub program
  • Breakpoints: a set point in a program where it will stop execution so that the values of variables can be examined

Thank you to C O’Toole & A Madill from Braidhurst High School for allowing me to edit and publish this here.

National 5 – Testing and documenting solutions (Revision)

Test Data

For an exam out of 100

  • Normal (data within expected range) – 78, 45,67, 85, 44
  • Extreme (data at limits of expected range)– 0, 100
  • Exceptional (data out with expected range) – -89, bob

Errors

  • Syntax – The rules of the programming language have been broken. E.g. a typing mistake Displya rather than Display
  • Execution – using Average = total / 0 would give an execution error.
  • Logic –will only show up when you run the program. Please see below

counter = 0
while counter < 0:
counter = counter + 1

Readability of code

  • Internal commentary – information about what the program does written by the programmer alongside the actual code. #Green in python.
  • Meaningful identifiers – Calling variable names that mean something length or height rather than L or H
  • Indentation starting parts of the code slightly into the middle of the page making it easier to read.

Thursday’s brain tickler

Create a program that simulates an electronic till.

The operator must enter the pin 1066 to get access before entering all of the items in the basket (3 baskets below). To finish a basket the operator enters a price of zero, the program will then display the total and ask for the cash tendered before displaying the change and going on to the next basket.

Basket 1 Basket 2 Basket 3
£0.67

£0.99

£0.34

£0.99

£0.78

£0.65

£0.12

£0.15

£1.99

£12.99

£1.50

£5.43

£8.99

£0.54

£1.99

£0.01

£18.99

£192

£67.50

£24.99

Loops and IF Statement Revision

After last weeks struggle over the IF statement and REPEAT loops, I thought a little refresher might be in order.

Today’s lesson was taken from the Scratch Your Nose website. We opened the Pong tutorial and followed it to create the game. Time was spent in the lesson looking at the roles Variables, the IF statement and REPEAT loops had in the program.

We then went on to expand the game but increasing the difficulty and adding sound.

Extension tasks after the break.

Read more