- Understand why components are tested separately (2.12.1.1)
- Know and use the testing methods (2.12.2.1–2.12.2.2)
- Know automation methods (2.12.3.1)
- Know test data types, create test data and know the structure of a test plan (2.12.4.1–2.12.4.3)
Testing components first
Test each component on its own before joining them into the final solution: the software, hardware, data, interfaces and the resulting service (final product). Faults are easier to find and cheaper to fix in one small part than in the whole system, and you can trust each part when you combine them.
Testing methods
| Method | What it tests | When |
|---|---|---|
| Concept | Whether an idea or design meets users' needs, before it is built | Very early |
| Unit | One function, procedure or module on its own | During development |
| Boundary | Values at the edges of what is allowed | When validation is added |
| Integration | That separate parts work together | When parts are joined |
| Performance | Speed and responsiveness | Before release |
| System | The complete system against its requirements | When it is finished |
| Acceptance | That the client agrees it meets their needs | Before sign-off |
| Usability | How easy it is for real users | With users, before release |
| Regression | That changes have not broken parts that worked | After every change |
| Load/stress | Behaviour under heavy and extreme use | Before go-live |
| Closed box | Inputs and outputs only, without looking at the code | Any stage, often by testers or users |
| Open box | The internal logic and paths through the code | During development, by developers |
Each has a trade-off. For example, open box testing is thorough but needs coding knowledge; closed box testing reflects how users see the system but can miss untested paths in the code.
Automation
- Macros: recorded sequences of actions that can be replayed, for repetitive tasks in applications.
- Scripts: small programs that run tasks or tests automatically.
- Functional testing tools: software that runs a set of tests against an application and reports which pass or fail.
Automation makes testing faster, more consistent and repeatable (ideal for regression testing), but takes time to set up and cannot judge things like how easy something is to use.
Test data
For a field that accepts ages 16 to 19:
| Type | Meaning | Example |
|---|---|---|
| Valid | Data that should be accepted | 17 |
| Invalid | Data of the right type that should be rejected | 25 |
| Boundary | Values at the edge of the allowed range | 16, 19 (and 15, 20 just outside) |
| Erroneous | Data of the wrong type that should be rejected | "seventeen" |
Test plans
A test plan sets out testing before it happens so nothing is missed. It:
- identifies the tests to be carried out
- describes the purpose of each test
- identifies the test data to be used
- describes the expected results
- records the actual results.
| Test | Purpose | Test data | Expected result | Actual result |
|---|---|---|---|---|
| 1 | Accept a valid age | 17 | Accepted | |
| 2 | Reject age above range | 20 | "Age must be 16 to 19" | |
| 3 | Reject text | "abc" | "Enter a whole number" |