Testing and maintainability Flashcards
Why are programs tested?
to ensure that they are robust, produce the expected results, and can handle malicious users
destructive tests
tests should be destructive and try to find errors rather than just proving the program works
iterative tests
carried out when the software is being developed
tests are carried out on each module and the results inform further developments
code is fixed and tested again (iterates) until the module works as intended
final/terminal testing
carried out once the software has been developed and all modules are complete
program tested as a whole to ensure that it functions as intended
alpha testing is done by the developers, and beta testing by potential users of the software
types of test data (3)
normal data
boundary data
erroneous data
normal data
tests the software under normal working conditions
boundary/extreme data
tests the software under extreme conditions
uses valid data that falls at the boundary of any possible ranges
e.g. will test that length and range checks are functioning correctly
if a program has variable < 1 the test data could be 1
erroneous data
tests how the software deals with incorrect inputs that may be entered deliberately or by mistake
the program should have routines to deal with them, and inform the user that the data is invalid
test plan
a list of what is to be tested and how it is to be tested
testing tables
tests are laid out in a testing table
- test number
- description of what it intends to check
- test data
- type of test
- expected outcome
- actual outcome
syntax errors
error in a program resulting from code not following syntax rules governing how to write statements in a programming language
grammatical mistakes in code
can be prevented by using an IDE (integrated development environment)
e.g.
misspellings
using a variable before it has been declared
logic errors
error in a program which does not cause a program to crash but causes unexpected results
trace tables help to identify logic errors
e.g.
wrong type of Boolean operator (AND/OR/NOT)
loops that run forever
maintainability for testing
- program code should be easy to follow and understand in case errors have to be corrected, or changes have to be made
- explanations should be added to explain the code (comments are shown using //)
- code that depends on a previous statement should be indented
- it is easier to follow/understand a program when meaningful identifiers have been used