Testing and documenting solutions

  • Normal, extreme and exceptional test data
  • Syntax, execution and logic errors
  • Readability of code (internal commentary, meaningful identifiers, indentation)

Normal, extreme and exceptional test data

For an exam out of 100

  • Normal – 78, 45,67, 85, 44
  • Extreme – 0, 100
  • Exceptional – -89, bob

 

Syntax, execution and logic errors

Syntax Errors – The rules of the programming language have been broken. E.g. a typing mistake Displya rather than Display

Execution Errors – using Average = total / 0 would give an execution error.

Logic Errors –will only show up when you run the program. Please see below

Counter = 0
Repeat
   Counter = counter + 1
Until counter = 0

 

Readability of code (internal commentary, meaningful identifiers, indentation)

Internal commentary – information about what the program does written by the programmer alongside the actual code. Green in Visual Basic.

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 and to see selection and iteration.

Leave a Reply

Your email address will not be published. Required fields are marked *