- Year not given · 10 marks
Testing principles and testability
Short answer
Basic testing principles: trace tests to customer requirements, plan tests early, follow Pareto principle (80% defects in 20% components), test incrementally from small to large, exhaustive testing impossible, use independent testers. Testability characteristics: operability, observability, controllability, decomposability, simplicity, stability, understandability. Black-box errors: incorrect or missing functions, interface errors, data structure/database errors, behaviour/performance errors, initialization and termination errors.
What are basic principles of testing? List characteristics of testability. List errors of black box testing.
Basic principles of testing
Testing is the process of executing a program with the intent of finding errors. A good test has a high chance of finding an error not yet discovered. The basic principles (Pressman, based on Davis) are:
- All tests should be traceable to customer requirements. The most severe defects are those that make the program fail to meet its requirements.
- Tests should be planned long before testing begins. Test planning can start when the requirements model is complete, and detailed test cases when the design is ready.
- The Pareto principle applies. About 80% of the errors are likely to be found in about 20% of the components; the task is to isolate and test those components thoroughly.
- Testing should begin "in the small" and progress toward "in the large". First test individual components, then clusters of integrated components, then the whole system.
- Exhaustive testing is not possible. Even a small program has too many path combinations, so tests must be selected to cover logic and conditions adequately.
- Testing is most effective when done by an independent third party. The developer tends to test to show the program works, not to break it.
Other widely used principles:
- Testing shows the presence of defects, not their absence.
- Early testing saves cost, because defects found early are cheaper to fix.
- Pesticide paradox: running the same tests again and again stops finding new defects, so tests must be reviewed and updated.
- Testing is context dependent: a safety-critical system needs different testing from a web game.
Characteristics of testability
Testability is how easily a program can be tested. Pressman (after Bach) lists these characteristics:
| Characteristic | Meaning |
|---|---|
| Operability | "The better it works, the more efficiently it can be tested." Few bugs block the tests. |
| Observability | "What you see is what you test." Inputs, outputs, states and errors are visible. |
| Controllability | "The better we can control it, the more testing can be automated." All outputs can be produced by some input combination. |
| Decomposability | Software is built from independent modules that can be tested separately. |
| Simplicity | "The less there is to test, the more quickly we can test it." Simple functions, structure and code. |
| Stability | "The fewer the changes, the fewer the disruptions to testing." Changes are rare and controlled. |
| Understandability | "The more information we have, the smarter we will test." Design and documentation are clear and up to date. |
Errors found by black-box testing
Black-box (behavioural) testing tries to find errors in the following categories:
- Incorrect or missing functions
- Interface errors
- Errors in data structures or external database access
- Behaviour or performance errors
- Initialisation and termination errors
For example, black-box testing of a library system may show that the "renew book" function is missing (category 1), that the system takes 20 seconds to search (category 4), or that the fine is not reset when a new day starts (category 5).
Black-box testing is less able to find errors in parts of the code that are never reached by specification-based inputs, such as dead code or wrong internal paths; those are found by white-box testing.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Black-box testing · Software Engineering, chapter 8
- Black-box versus white-box testing · Software Engineering, chapter 8
- White box and black box testing · Instrumentation II, chapter 9
- EDM operation principles and errors · Surveying I, chapter 2 · asked 2×