9.2 Testing Flashcards
Purpose of Testing
To ensure there are no errors or bugs in the code.
To ensure that the code performs as it was intended.
To ensure no one can gain unauthorised access to the system.
To check the program solves the initial problem and meets all requirements.
Iterative testing
Each part of a program is tested.
Every pathway through the program is tested.
This includes each branch/pathway inside of IF statements.
This is done during the development of the program.
Iterative testing means repeatedly testing the program whilst continuing to make changes and make improvements.
This method of testing ensures that the program is fully functional and working as intended.
Final testing
Testing that all parts (modules) of a program work together.
Checking the program against real data to ensure it meets all of the requirements.
Testing the program using normal, boundary and erroneous data.
Final testing is done towards the end of the development cycle, once the entire program is complete.
Final testing can include: Alpha testing, Beta testing.
Syntax and logic error
Syntax error: An error that breaks the grammatical rules of a programming language and stops it from running.
Logic error: Incorrect code is used that allows the program to run, but produces an incorrect or undesired output.
Identifying syntax errors
As a result of a syntax error breaking the rules of the programming language, the program will not execute.
These are easily identifi able as the IDE will provide information about what the error is.
This is done to help the programmer be able to fix the issue.
Identifying logic errors
Logic errors can be slightly more challenging to locate compared to syntax errors.
This is because the program will still run but will not produce the expected output that the programmer intended.
The most obvious areas to check for logic errors are:
Logical operators (<, >, ==, !=)
Boolean operators (AND, OR, NOT)
Division by 0
Data testing
There 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 - A normal test is when a user enters data that should be accepted in the program.
Boundary tests - A boundary test is when a user enters data that is on the edge of what is acceptable.
Erroneous tests - An erroneous test is when a user enters data that is the wrong data type.
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.
An invalid test is when a user enters data that is the right data type but it is outside of what is accepted.