Test plan

Developers use test plans that check a range of types of data under different circumstances.

A test plan is a list of requirements designed to ensure that the coded solution works as expected. The test plan will include specific instructions about the data and conditions the program will be tested with.

Test plan example

We can use a test plan to check the following section of code to see if there are any errors.

first = input("Input the first number") second = input("Input the second number") print("The sum is",first+second)

A simplified test plan might look like the following table:

FeatureTest casesExpected resultActual result
Addition of whole numbers1st: 0, 4, 44, 4444 and 2nd: 0, 4, 44, 44440, 8, 88, 888800, 44, 4444, 44444444
Addition of decimals1st: 1.0, 1.2, .01 and 2nd: 1.0, 1.2, .012.0, 2.4, 0.021.01.0, 1.21.2, .01.01
Handling of strings1st: one, two and 2nd: one, twoSyntax error because it can't add strings togetheroneone, twotwo

The 'Actual result' column is giving some unexpected results. The computer program executes without any syntax errors so there must be a semantic error.

To fix this semantic error, you would need to convert both values into an integer. One solution would be to perform an in-line integer conversion on each of the first two lines. For example:

first = int(input("Input the first number"))