Test tables
Test tables are used to provide a structure to testing.
Programmers will often create a table with a selection of normal, extreme and exceptional data that they intend to use during testing. The table will include:
- a column for the expected result
- a column for what actually happens when the program runs
The programmer will refer to the functional requirements created at the analysis phase to act as a reminder of the inputs that the program is expected to handle.
It can be helpful to include a final column where a tick or a cross are placed to provide an at-a-glance overview of testing.
What data to test
A test table should include:
- at least two items of normal data
- at least two items of exceptional data
- both extreme values if testing a range of numbers
It is also good practice to test the values immediately outwith the accepted range as it is common to find errors that occur because of a selection statement that makes use of incorrect logical operators.
Test table example
In this example, the program should only accept a score if the value entered is between 1 and 99 inclusive.
Six of the seven items of test data have passed testing. However, the sixth item in the table has produced an unexpected result. The value 100 should have been rejected but was accepted by the program (as shown in pink in the table).
The iterative nature of the development process is evident here, as the programmer would now need to go back to the implementation phase to find the error that caused this problem.
After altering the code, it would then be necessary to test the data again and to provide evidence of this testing with an updated test table.