Study Guide

Testing

Computer ScienceΒ· 25 min read

1. Static vs Dynamic Testingβ˜…β˜…β˜†β˜†β˜†β± 10 min

πŸ“˜ Definition

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

πŸ“˜ Definition

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

πŸ“ 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. 1

    First, identify the requirement: the developer needs to check the code without executing it.

  2. 2

    Match the requirement to the definition: dynamic testing requires executing code, so it is not suitable here.

  3. 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.

2. Testing by Development Stage: Unit, Integration, Systemβ˜…β˜…β˜…β˜†β˜†β± 15 min

πŸ“˜ Definition

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. 1

    The test is checking the interaction between two separate completed modules.

  2. 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. 3

    Integration testing specifically checks for errors in interactions between integrated modules. So this is integration testing.

3. Acceptance Testing: Alpha, Beta and UATβ˜…β˜…β˜†β˜†β˜†β± 10 min

πŸ“˜ Definition

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. 1

    The testing is performed by external end-users before full release.

  2. 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. 3

    Beta testing is pre-release testing by external end-users to find real-world bugs. So this is beta testing.

4. Black Box vs White Box Testingβ˜…β˜…β˜…β˜†β˜†β± 12 min

πŸ“˜ Definition

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. 1

    To test all conditional branches, the developer needs to know the internal structure of the source code.

  2. 2

    Black box testing does not use any knowledge of internal code structure, so it cannot guarantee all branches are tested.

  3. 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.

5. Common Pitfalls

Wrong move:

Confusing integration testing with system testing

Why:

Candidates often assume any test of multiple components is system testing

Correct move:

System testing tests the entire end-to-end integrated system, while integration testing only checks interactions between a small group of modules

Wrong move:

Thinking static testing only refers to code review

Why:

Candidates forget that all testing done without executing code counts as static testing

Correct move:

Static testing includes compiler syntax checks, design reviews and documentation reviews, not just manual code review

Wrong move:

Mixing up alpha and beta testing

Why:

Candidates often reverse who performs each type of pre-release acceptance testing

Correct move:

Remember: Alpha = Internal (A for in-house), Beta = External (B for outside the company)

Wrong move:

Claiming acceptance testing is only beta testing

Why:

Candidates forget all final pre-deployment testing to confirm requirements counts as acceptance testing

Correct move:

Acceptance testing includes alpha testing, beta testing and user acceptance testing (UAT) performed by the client

6. Quick Reference 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

When this came up on past exams

AI-estimated based on syllabus patterns β€” cross-check with official past papers for accuracy. Use only as revision-focus signals.

  • 2022 Β· 12

    4m: Classify given testing examples

  • 2023 Β· 11

    6m: Compare static vs dynamic testing

  • 2024 Β· 12

    3m: Describe purpose of beta testing

Going deeper

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.