# Testing

> Computer Science · CIE A-Level
> Source: https://www.owlsprep.com/study/cie-9618-u12-testing/

This module covers all core testing concepts for CIE 9618 Paper 1, including different testing approaches and their use at each stage of software development. You will learn to classify test types and select the right approach for any scenario.

**Prerequisites:** [Understanding of the software development lifecycle](https://www.owlsprep.com/study/cie-9618-u12-software-development-lifecycle/)

## Learning objectives

- Distinguish between static and dynamic testing approaches
- Identify the correct testing type for each stage of software development
- Compare black box and white box testing methodologies
- Describe the purpose of alpha, beta and user acceptance testing

## Static vs Dynamic Testing

**Static Testing** — Testing that analyses code, design or documentation without executing the program, catching errors early in development.

*Example:* Code reviews, syntax checks, documentation reviews, walkthroughs

**Dynamic Testing** — Testing that executes the program with test inputs, to check for runtime errors, correct output and overall functionality.

*Example:* Running a function with sample inputs to verify its output

> **tip**
>
> Static testing is much cheaper and faster to perform early, as it avoids debugging complex runtime issues later in development.

**Worked example:** A developer wants to check for naming inconsistencies and syntax errors in a new function before running it. What testing approach should they use, and why?

1. First, identify the requirement: the developer needs to check the code without executing it.
2. Match the requirement to the definition: dynamic testing requires executing code, so it is not suitable here.
3. Static testing is defined as testing without execution, so it can detect syntax errors and naming inconsistencies via static analysis or code review. This is the correct approach.

## Testing by Development Stage: Unit, Integration, System

**Stage-Based Testing** — Testing is performed incrementally as development progresses, with different test types for each stage of integration.

*Example:* Unit tests for individual components, integration tests for groups of components, system tests for the full product.

- **Unit Testing**: Tests individual small components (e.g. one function) in isolation to confirm it works as designed.
- **Integration Testing**: Tests interactions between multiple integrated components to find errors in how data is passed between modules.
- **System Testing**: Tests the entire fully integrated end-to-end system to confirm it meets all specified requirements.

**Worked example:** A developer has finished coding all individual modules for a hotel booking system. They now want to check that when a room is marked as booked in the room database module, it correctly shows as unavailable in the customer booking module. What test type is this?

1. The test is checking the interaction between two separate completed modules.
2. Unit testing only tests individual modules in isolation, so this cannot be unit testing. System testing tests the entire full system, so this is not system testing.
3. Integration testing specifically checks for errors in interactions between integrated modules. So this is integration testing.

## Acceptance Testing: Alpha, Beta and UAT

**Acceptance Testing** — The final stage of testing before deployment, to confirm the system meets the client or end-user's requirements and is ready for release.

- **Alpha Testing**: Performed by the internal development team, before the software is released to external testers.
- **Beta Testing**: Performed by a small group of external end-users, who use the software in a real-world environment to find bugs missed by internal testing.
- **User Acceptance Testing (UAT)**: Performed by the client, to confirm the system meets their business requirements before final deployment.

**Worked example:** A social media company releases a pre-release version of its new app to 50,000 volunteer existing users to test and report bugs before full launch. What type of acceptance testing is this?

1. The testing is performed by external end-users before full release.
2. Alpha testing is performed by internal staff, so it is not alpha testing. UAT is performed by the client to confirm requirements, so it is not UAT.
3. Beta testing is pre-release testing by external end-users to find real-world bugs. So this is beta testing.

## Black Box vs White Box Testing

**Structural Testing Approaches** — Two approaches to test design based on whether the tester has access to the internal source code of the system.

- **Black Box Testing**: Tester has no access to internal source code, only designs tests based on external requirements to check inputs and outputs. Also called functional testing.
- **White Box Testing**: Tester has full access to internal source code, designs tests to cover all internal logic paths, branches and lines of code. Also called structural testing.

**Worked example:** A developer wants to ensure that every conditional branch in a password validation function is tested. What test approach should they use?

1. To test all conditional branches, the developer needs to know the internal structure of the source code.
2. Black box testing does not use any knowledge of internal code structure, so it cannot guarantee all branches are tested.
3. White box testing uses knowledge of internal code to design tests that cover all logic paths and branches. So this is the correct approach.

## Common pitfalls

- **Wrong:** Confusing integration testing with system testing
  - Why it fails: Candidates often assume any test of multiple components is system testing
  - Correct: System testing tests the entire end-to-end integrated system, while integration testing only checks interactions between a small group of modules
- **Wrong:** Thinking static testing only refers to code review
  - Why it fails: Candidates forget that all testing done without executing code counts as static testing
  - Correct: Static testing includes compiler syntax checks, design reviews and documentation reviews, not just manual code review
- **Wrong:** Mixing up alpha and beta testing
  - Why it fails: Candidates often reverse who performs each type of pre-release acceptance testing
  - Correct: Remember: Alpha = Internal (A for in-house), Beta = External (B for outside the company)
- **Wrong:** Claiming acceptance testing is only beta testing
  - Why it fails: Candidates forget all final pre-deployment testing to confirm requirements counts as acceptance testing
  - Correct: Acceptance testing includes alpha testing, beta testing and user acceptance testing (UAT) performed by the client

## Cheatsheet

| Test Type | Core Definition | Typical Use Case |
| --- | --- | --- |
| Static Testing | No code execution | Early code reviews, syntax checks |
| Dynamic Testing | Code is executed | Check runtime functionality |
| Unit Testing | Individual components | Test modules in isolation |
| Integration Testing | Inter-module interactions | Check data flow between components |
| System Testing | Whole integrated system | Verify all requirements |
| Alpha Testing | Internal acceptance | Pre-beta bug catching |
| Beta Testing | External user acceptance | Real-world pre-release testing |
| Black Box | No source code access | Test input/output against specs |
| White Box | Source code access | Test all internal logic paths |

## What's next

Testing is a core component of software development, and this knowledge is frequently tested in CIE 9618 Paper 1, with questions typically worth 3 to 6 marks. Being able to clearly distinguish between test types and match them to scenarios is critical for full marks on these common questions. This topic also connects closely to other units, including software development methodologies, quality assurance, and debugging. Building a clear understanding of testing now will help you tackle more advanced topics in software engineering and answer extended response questions that link multiple concepts.

- [Software Maintenance](https://www.owlsprep.com/study/cie-9618-u12-software-maintenance/)
- [Debugging](https://www.owlsprep.com/study/cie-9618-u12-debugging/)
- [Software Project Management](https://www.owlsprep.com/study/cie-9618-u12-software-project-management/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9618-u12-testing/
