You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers testing strategies as required by OCR J277 Section 2.4. Testing is the process of checking that a program works correctly and meets its requirements. OCR requires you to understand both iterative testing (testing during development) and final/terminal testing (testing the completed program).
Testing is essential because:
A program that has not been thoroughly tested may contain hidden bugs that cause crashes, security vulnerabilities, or incorrect results.
Iterative testing is testing that takes place during development, after each new section of code is written. The programmer tests individual modules or features as they build them, fixing errors before moving on.
| Benefit | Explanation |
|---|---|
| Early bug detection | Errors are found close to when they were introduced, making them easier to fix |
| Easier debugging | Only a small amount of new code needs to be checked |
| Continuous improvement | Code quality improves throughout development |
| Reduced risk | Problems are caught incrementally rather than all at the end |
A programmer building a quiz application might test:
Each feature is tested individually before the next one is built.
flowchart LR
A[Write small section of code] --> B[Test with normal/boundary/erroneous data]
B --> C{Bugs found?}
C -- Yes --> D[Fix code]
D --> E[Re-test the same data]
E --> C
C -- No --> F[Move to next feature]
F --> A
F -.->|All features done| G[Final / Terminal testing]
G --> H{Integration OK?}
H -- No --> D
H -- Yes --> I[Release-ready robust program]
OCR Exam Tip: When describing iterative testing, always emphasise that testing happens DURING development, not just at the end. The key word is "iterative" — meaning repeated cycles of code, test, fix, re-test.
Final testing (also called terminal testing) takes place when the program is complete. The entire program is tested as a whole to ensure all components work together correctly and the program meets all its requirements.
| Benefit | Explanation |
|---|---|
| Complete coverage | Tests the entire program as a whole |
| Integration testing | Checks that all modules work together |
| Requirements verification | Confirms the program meets its specification |
| User acceptance | Ensures the program is suitable for end users |
| Feature | Iterative Testing | Final Testing |
|---|---|---|
| When | During development | After development is complete |
| What is tested | Individual modules/features | The complete program |
| Purpose | Find and fix bugs early | Verify the program meets all requirements |
| Scope | Small sections of code | Entire system |
| Frequency | Continuous — after each change | Once (or repeated if bugs are found) |
Neither is "better" — they complement each other:
OCR Exam Tip: If asked "explain the difference between iterative and final testing" (a common 4-mark question), structure your answer as: iterative testing happens during development on individual modules, while final testing happens after completion on the whole program. Give an example of each.
A test plan is a document that describes what will be tested, what test data will be used, and what the expected outcomes are.
| Test Number | Description | Input | Expected Output | Actual Output | Pass/Fail |
|---|---|---|---|---|---|
| 1 | Valid age | 25 | "Welcome" | ||
| 2 | Boundary age | 18 | "Welcome" | ||
| 3 | Below range | -1 | "Invalid age" | ||
| 4 | Non-numeric | "abc" | "Please enter a number" |
The "Actual Output" and "Pass/Fail" columns are filled in during testing.
| Type | Description |
|---|---|
| Unit testing | Testing individual subroutines or modules |
| Integration testing | Testing that modules work together |
| System testing | Testing the complete system |
| User acceptance testing | End users test to confirm it meets their needs |
| Alpha testing | Testing by the developer's team |
| Beta testing | Testing by a group of external users |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.