Search

Trace, test and correct algorithms

  • State the inputs, required output and allowed cases
  • Trace positions, conditions and variable updates in order
  • Test and correct strict and inclusive boundaries
  • Preserve earlier work in a count or sum
  • Choose valid initial values and handle empty inputs
  • Compare independent expected results, use counterexamples and retest a repair
  • Apply tracing and testing to search, sorting and divisibility algorithms