Categories of tests
- The are three main categories of tests a programmer or test-user would carry out whilst performing both iterative or final testing on a program
- Normal tests
- Boundary tests
- Erroneous tests
- There is an additional test that users would always carry out to test the robustness of their program, this is known as an invalid test
- To explain the types of tests, some example code will be used
Example code
name = input("What is your name? ")
age = int(input("How old are you? "))
if age >= 12 and age <= 18:
print("Welcome, " + name + "! Your age is accepted.")
else:
print("Sorry, " + name + ". Your age is not accepted.")
Normal tests
- A normal test is when a user enters data that should be accepted in the program
- An example would be a user entering their age as 16 into the age field of the program
Boundary tests
- A boundary test is when a user enters data that is on the edge of what is acceptable
- An example would be a user entering their age as 12 or 18 into the age field of the program
- Another example of a boundary test would be the numbers 11 or 19, even though they are outside of the accepted range
Erroneous tests
- An erroneous test is when a user enters data that is the wrong data type
- An example would be a user entering their age as "F" into the age field of the program
Invalid tests
- An invalid test is when a user enters data that is the right data type but it is outside of what is accepted
- An example would be a user entering their age as 67 into the age field of the program