ITPEC FE Morning October 2023 Question 46

The integration test for software composed of modules arranged in a hierarchical structure is performed from a high-level module. In such a case, which of the following is a test module that is used as a substitute for a low-level module?

Explanation

Stub — in top-down integration testing, a stub stands in for a lower-level module that is not yet available.

Top-down integration starts from the highest-level module. The modules it calls may not be written or tested yet, so each one is replaced by a stub: a simple dummy module that accepts the call and returns a fixed or minimal result. As real lower modules are finished, they replace the stubs one by one.

The opposite approach, bottom-up integration, starts from low-level modules and needs a driver, a dummy higher-level module that calls the module under test and passes it test data.

Answer (d)

Why not others:

  • •(a) Driver — substitutes an upper, calling module; it is used in bottom-up testing
  • •(b) Emulator — imitates a whole hardware or software environment so programs can run on another platform; it is not a module substitute
  • •(c) Simulator — models the behaviour of a system or device for experiments or training, not a placeholder for one module

Key rule: Stubs are called (they replace the level below); drivers call (they replace the level above).

System Development Technology · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.