1. Gyanastra
  2. Software Engineering
  3. Software Testing
  4. Unit Integration and System Testing
Free lesson, no account needed 14 min read 26 practice questions after it
Asked in past papers9 times
  • ISRO20152009
  • UGC NET2022202120172015201320072005

Software Engineering · Software Testing

Unit Integration and System Testing

Overview

Testing is not a single activity but a strategy of levels, each widening the scope of what is examined: a single module, then a group of modules, then the complete software, then the customer's acceptance decision.
This lesson defines those levels, the order in which they are performed, the temporary test aids (stubs and drivers) that each level needs, and the integration strategies (top-down, bottom-up, sandwich, big-bang).
It sits in the Software Testing chapter of Software Engineering and supplies the "skeleton" on which every testing technique hangs.
You must already know the SDLC phases (requirements, design, coding, testing, maintenance), what an SRS (Software Requirements Specification) is, and the basic definition of testing as executing a program with the intent of finding errors. The waterfall model executes these levels sequentially; it is a linear, not a top-down or bottom-up, process model.

Key concepts

  • Software testing (Myers' definition): "the process of executing a program with the intent of finding errors." It is destructive in purpose — you design cases to break the software, not to prove it works.
    Exhaustive testing (all input combinations) is theoretically complete but practically impossible.
  • Classical order of testing levels (Pressman's strategy, the convention UGC follows): Unit → Integration → Validation → System. Many other textbooks write Unit → Integration → System → Acceptance; both agree that unit comes first, integration second, and the customer-facing level last.
    Learn the UGC order above and read each option carefully.
  • Unit testing: testing the smallest testable unit — a module, subroutine, function, procedure, or class.
    Done by the developer, white-box oriented; targets internal logic, data structures, loops, boundary conditions and error-handling paths.
  • Driver: a dummy calling program that supplies input, invokes the module under test and prints results. Needed when the real higher-level (calling) module is not yet ready. Used mainly in bottom-up integration.
  • Stub: a dummy called module — a skeletal replacement for a lower-level module that the module under test calls. Needed when the real lower-level (called) module is not yet ready.
    Used mainly in top-down integration.
  • Integration testing: combining tested modules and testing them as a group; the target is interfaces — data passing, control transfer, calling conventions, shared resources, global data, timing.
    Corresponds to the design phase.
  • Integration strategies: Big-bang (all at once), Top-down (depth-first or breadth-first), Bottom-up, Sandwich / hybrid / mixed (top-down for upper layers, bottom-up for lower layers, meeting at a middle layer).
  • Validation testing: checks that the developed software satisfies the requirements established during requirements analysis (the SRS), and meets the customer's expectations.
    Its standard sub-forms are alpha and beta testing, and the broader acceptance decision.
  • Alpha testing: performed at the developer's site, in a controlled environment, by internal testers or a selected group of potential users, with the development team present.
    Beta testing: performed at the customer's/user's own location, by real users, with actual data in the actual environment, without the developer present; feedback returns as defect reports.
  • System testing: testing the completely integrated system (software plus other system elements such as hardware, database, network) against the system requirements; black-box in nature; covers functional plus non-functional concerns — performance, stress, security, recovery, configuration, usability.
  • Verification vs validation: verification asks "are we building the product right?" (conformance to specification, reviews, static checks); validation asks "are we building the right product?" (customer needs satisfied).
  • Regression testing: re-execution of a selected subset of tests after a change (defect fix, enhancement, maintenance) to confirm that nothing previously working has broken.
  • Waterfall model: a sequential process model — requirements, design, coding, testing, maintenance in strict linear order.

How it works

1. Unit testing procedure

  1. Review the module's code and interface.
  2. Design white-box cases from the module's logic (statement, branch, path, condition coverage).
  3. Add test aids: a driver if the module is not a main program; stubs for every module it calls that does not yet exist.
  4. Execute, compare actual with expected output, record defects and coverage.

2. Integration testing — the four strategies

Top-down: start with the main (top) module as a skeleton, with stubs for all its immediate subordinates. Integrate one module at a time, replacing its stub; that module's own subordinates then appear as new stubs.

  1. Place the top module; stub every child.
  2. Choose depth-first (follow one path down to a leaf, then back up) or breadth-first (integrate all modules at one horizontal level, then the next).
  3. Replace one stub by the real module; add stubs for its children.
  4. Repeat until all modules are real.

Properties: high-level control logic is verified early; no drivers needed; stubs may proliferate; low-level computation and I/O are tested late, and may be tested inadequately.

Bottom-up: begin at the lowest level. Test each module with a driver, combine related modules into clusters (builds), then move upward, using drivers until a caller becomes available.
Properties: low-level, computation-intensive modules are verified early and thoroughly; no stubs needed; drivers proliferate; a major design fault in the top-level structure is discovered only at the end.

Sandwich (hybrid): apply top-down to the upper layers and bottom-up to the lower layers; the two meet at an intermediate layer. It needs both stubs and drivers but reaches the middle quickly.

Big-bang: integrate everything and test in one shot. Almost no planning effort, but fault isolation becomes very difficult.

3. Validation and acceptance — the software is checked against the SRS and the customer's expectations; alpha testing runs at the developer's site, then beta testing runs at the users' sites with real data; reported defects are collected and fixed.

4. System testing — the accepted software is integrated with the other system elements and tested end-to-end against system requirements: functionality, performance, stress, security, recovery, configuration and usability.

5. Regression — after every change, re-run the selected regression suite.

Figure. Notice unit testing uses drivers and stubs, integration focuses on interfaces, validation includes alpha and beta, and system testing covers integrated system requirements. Regression testing after every change feeds back to integration.

Formulas

  • Module reliability bound (unit-testing result). R≤c×pR \le c \times p

  • where RR = reliability of the module (probability of a correct execution), cc = fraction of the module's code actually exercised by the test data (0≤c≤10 \le c \le 1), pp = probability that the exercised portion executes successfully (0≤p≤10 \le p \le 1). The untested remainder is treated as possibly faulty, so the product is an upper bound.

  • Test-aid counting for a strict tree hierarchy of nn modules (no sharing, each aid written once):

  • Top-down, total distinct stubs created =n−1= n-1 (every module except the main module is stubbed before it is integrated).

  • Bottom-up, total distinct drivers created =n−1= n-1 (every module except the top module must be invoked by a caller that does not yet exist).

  • Simultaneous stubs at any moment = number of not-yet-integrated children of already-integrated modules.

Worked examples

Example 1 (order of levels). Arrange unit, integration, validation and system testing in the classical order.
Step 1: smallest scope first — unit (single module, code level).
Step 2: combine modules and test interfaces — integration (design level).
Step 3: confirm the software satisfies the requirements in the SRS and the customer's expectations — validation (requirements level, containing alpha/beta).
Step 4: finally the software is tested together with the other system elements — system.
Answer: Unit → Integration → Validation → System.

Example 2 (match-the-list, level ↔ artifact).
List-I: (a) Unit test, (b) System test, (c) Validation test, (d) Integration test.
List-II: (i) Requirements, (ii) Design, (iii) Code, (iv) System engineering.
Reasoning: unit tests exercise code; integration tests exercise the design (interfaces between modules); validation tests exercise the requirements; system tests exercise the whole engineered system (software + hardware + environment).
Answer: a–iii, b–iv, c–i, d–ii.

Example 3 (hard, two-step counting). A hierarchy has modules P (root) with children Q and T; Q has children R and S; T has children U and V (7 modules).
(i) How many stubs are created altogether in top-down integration, and what is the maximum number existing at one time? (ii) How many drivers are needed in bottom-up integration if no driver is reused?
Step 1 (top-down): start with P, stub Q and T → 2 stubs. Integrate Q: T remains stubbed, add stubs for R and S → 3 stubs at once (the maximum). Integrate R → 2, integrate S → 1, integrate T and add stubs for U and V → 2, integrate U → 1, integrate V → 0.
Step 2: modules ever stubbed are Q, T, R, S, U, V = 6 = n−1n-1.
Step 3 (bottom-up): test R and S with drivers (Q not ready), then Q+R+S with a driver for P; test U and V with drivers, then T+U+V with a driver for P; P needs none. Drivers written for R, S, Q, U, V, T = 6 = n−1n-1.
Answer: 6 stubs in total with at most 3 simultaneously; 6 drivers.

Example 4 (numeric, reliability). While unit-testing a module, the test data exercise only 90% of the code, and the exercised portion runs successfully with probability 0.9. What can be said about the module's reliability?
Step 1: c=0.9c = 0.9, p=0.9p = 0.9.
Step 2: R≤c×p=0.9×0.9=0.81R \le c \times p = 0.9 \times 0.9 = 0.81.
Step 3: the 10% of code not exercised may contain faults, so reliability cannot exceed 0.81 — it may well be lower.
Answer: at most 0.81.

Example 5 (statement type).
Statement I: Top-down integration detects control-flow problems in the upper levels early.
Statement II: Bottom-up integration suits modules that are reused across several systems and perform low-level computation.
Statement III: In top-down integration, drivers replace the lower-level modules that are not yet integrated.
Analysis: I is true — the top module is the skeleton and is executed from the start. II is true — bottom-up tests the lowest, most reusable modules first and thoroughly. III is false — lower modules are replaced by stubs, not drivers; drivers are the calling programs used in bottom-up.
Answer: I and II true, III false.

Comparison

LevelWhat is testedBaseline artifactChief test aidsMainly done byTechnique style
UnitOne module / function / classCodeDriver + stubsDeveloperWhite-box
IntegrationInterfaces between combined modulesDesignStubs (top-down) or drivers (bottom-up)Developer / test teamBoth
Validation / AcceptanceRequirements and customer needs; alpha, betaRequirements (SRS)Real users, real data (beta)Customer / userBlack-box
SystemWhole system with other system elementsSystem engineeringProduction-like environmentIndependent test teamBlack-box
FeatureTop-downBottom-upSandwichBig-bang
Start fromMain moduleLowest modulesBoth endsAll modules
StubsManyNoneSomeNone
DriversNoneManySomeNone
High-level logic verifiedEarlyLateEarlyLate
Low-level logic verifiedLateEarlyEarlyLate
Fault isolationModerateModerateGoodVery poor
StubDriver
RoleDummy called moduleDummy calling program
ReplacesLower-level moduleHigher-level module
Used inTop-down integrationBottom-up integration
MnemonicStub sits subordinate (below)Driver drives from above
Alpha testingBeta testing
LocationDeveloper's siteUser's/customer's site
Performed byInternal testers / selected potential usersReal users ("potential customers")
Environment and dataControlled, simulatedActual environment, actual data
Developer presentYesNo
Both are forms ofAcceptance testingAcceptance testing
VerificationValidation
Question asked"Are we building the product right?""Are we building the right product?"
ChecksConformance to specification, designCustomer needs, SRS requirements
Typical meansReviews, inspections, static analysisAcceptance testing, alpha/beta

Revision summary

  • Order to answer: Unit → Integration → Validation → System (Pressman/UGC); unit is code level, integration is design level, validation is requirements level, system is system-engineering level.
  • Stub = below, driver = above. Top-down needs stubs only;
    bottom-up needs drivers only;
    sandwich needs both.
  • Alpha = developer's site;
    Beta = user's site with actual data in the actual environment.
    Both are acceptance testing.
  • Validation = right product; Verification = product right.
  • Regression testing is the answer whenever a question mentions "after changes/maintenance".
  • The waterfall model is sequential, not top-down or bottom-up.
  • Unit testing is white-box and developer-driven; system testing is black-box and team-driven.
  • In a tree of nn modules, total stubs (top-down) = total drivers (bottom-up) = n−1n-1 when no aid is reused.
  • Reliability bound: multiply coverage by success probability — 0.9×0.9=0.810.9 \times 0.9 = 0.81 is a maximum, never a minimum.
  • Testing is destructive in intent: design cases to expose errors, not to prove correctness.
  • Sandwich is the only strategy also called hybrid/mixed.

Previous-year exam insights

  • Direct one-liner: "normal order of activities in traditional software testing" or "which level tests the SRS" — recall the four-level table and the level ↔ artifact mapping instantly.
  • Match List-I (test level or aid) with List-II (artifact, role, location) — prepare the stub/driver and alpha/beta pairs; the distractors swap "developer's site" with "customer's site" and "calls" with "is called".
  • Statement I/II/III items: the standard false statement is "top-down integration needs drivers" or "bottom-up integration needs stubs". Check the direction of the aid first.
  • Numeric items on stubs/drivers: count only the modules that actually need an aid; remember the root needs no driver and the main module needs no stub.
  • Assertion–Reason on top-down integration: true assertion (no drivers, early upper-level verification) with a reason that must mention stubs, not drivers.
  • Alpha/beta questions are asked twice in slightly different wording (form of testing, and location/data) — read whether the stem asks "which form of testing" (acceptance) or "performed by whom/where" (beta = users at their own location).
  • Trap options: calling alpha/beta "system testing" or "white-box testing"; calling regression testing "integration testing"; confusing validation testing with verification.
  • The reliability-style unit-testing numerical gives a coverage and a success probability; the answer is always the product as an upper bound, so reject "at least" options.

Practice at PARIKSHA

You are ready for the PARIKSHA tests of this sub-topic when you can:

  1. Write the classical order of the four testing levels and justify each position in one sentence.
  2. State the definition of a stub and a driver and say which integration strategy needs which.
  3. Given a module hierarchy, count the total stubs and the maximum simultaneous stubs for top-down integration.
  4. Given the same hierarchy, count the drivers required for bottom-up integration and state your assumption about reuse.
  5. Compare top-down, bottom-up, sandwich and big-bang on stubs, drivers, early detection and fault isolation.
  6. Distinguish verification from validation and place alpha/beta under acceptance testing.
  7. Explain alpha and beta testing on location, tester, data and environment in a table.
  8. Identify regression testing from a stem that mentions maintenance or change.
  9. Compute the module reliability bound from a coverage figure and a success probability.
  10. Match each testing level to its baseline artifact — code, design, requirements, system engineering.

Attempt the sub-topic test first, then the full subject test.

Pages 1–2 of 2