Back to the 2025 paper

Module 4: Software Testing

20257m

Describe unit testing, integration testing and system testing—how they differ and what each addresses.

Worked SolutionAI Assisted

Unit, Integration & System Testing

These are the three classic levels of software testing, performed in sequence as components are progressively assembled.

1. Unit Testing

  • What: tests the smallest testable unit — an individual function, method, class, or module — in isolation.
  • What it addresses: verifies that the unit's internal logic is correct — branches, boundary values, error handling, expected outputs for given inputs.
  • Who/how: done by developers during coding, using test drivers/stubs and frameworks (JUnit, pytest, NUnit). Typically white-box (statement/branch coverage).
  • Goal: catch local logic errors as early as possible.

2. Integration Testing

  • What: tests the interaction between integrated units/modules — the interfaces, data flow, and control flow across module boundaries.
  • What it addresses: interface mismatches — wrong parameter passing, incompatible data formats, missing/duplicate functions, ordering/timing problems.
  • Strategies:
    • Top-down — test high-level modules first, using stubs for lower ones.
    • Bottom-up — test low-level modules first, using drivers for higher ones.
    • Sandwich / mixed; and Big-bang — all modules integrated at once then tested.
  • Goal: find interface/assembly errors that unit tests cannot.

3. System Testing

  • What: tests the complete, fully integrated system as a whole against the requirements/SRS.
  • What it addresses: end-to-end behaviour, functional requirements, and non-functional attributes — performance, security, usability, reliability, recovery, stress/load, compatibility.
  • Who/how: by an independent test team in an environment close to production; primarily black-box.
  • Goal: validate that the whole system satisfies its specification.

Comparison table

Aspect Unit Testing Integration Testing System Testing
Scope Single unit/module Groups of interacting modules Whole system
Focus Internal logic Interfaces & interaction Requirements compliance
Test basis Code design Module interfaces SRS/requirements
Nature White-box White/black-box Black-box
Performed by Developers Developers/testers Independent test team
Typical tools JUnit, pytest Test harnesses, drivers/stubs Automation/performance tools
Example calculateTax() returns right value Module A correctly calls B's API End-to-end login → order → invoice flow

Order: Unit → Integration → System (each building on the previous). After system testing come acceptance testing (user validates the system against business needs).

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.