You are on page 1of 16

SOFT 3406

Software Verification and


Validation
Week XI
Ahmet Feyzi Ateş

Işık University Faculty of Engineering and Natural Sciences


Department of Computer Science Engineering 
2022-2023 Spring Semester
Integration Testing

Agenda:
- Decomposition Based Integration
- Call Graph Based Integration
- Path Based Integration
Decomposition Based Integration

✧ Functional decomposition is the main representation, usually


derived from final source code, which shows the structural
relationship of the system with respect to its constituent units.
✧ Best applied to programs written in a procedural paradigm.
✧ Major functional decomposition and integration strategies
are:
▪ top-down,
▪ bottom-up,
▪ sandwich,
▪ big bang.
✧ First three integration orders presume that the units have
been separately tested, thus, the goal of
decomposition-based integration is to test the interfaces
among separately tested units.

3
Example: A Calendar Program

✧ Given: Date in the form mm, dd, yyyy


✧ Requested:
▪ the date of the next day
▪ the day of the week corresponding to the date (i.e., Monday,
Tuesday…)
▪ the zodiac sign of the given date
▪ the most recent year in which Memorial Day was celebrated
on May 27
▪ the most recent Friday the Thirteenth
✧ The functional decomposition tree is the basis for this
approach to integration testing because it is the main
representation which shows the structural relationship
of the system with respect to its units.
▪ Derived from the source code.

4
Functional Decomposition Tree of Calendar

reflects the lexicological inclusion of units, in terms of the order in which they need to be
compiled,

5
Lexicological Inclusion of Calendar Program

Main Calendar
Function isLeap
Procedure weekDay
Procedure getDate
Function isValidDate
Function lastDayOfMonth
Procedure getDigits
Procedure memorialDay
Function isMonday
Procedure friday13th
Function isFriday
Procedure nextDate
Procedure dayNumToDate
Procedure zodiac

6
Top-Down Integration

✧ Top-down integration begins with the main program (the


root of the tree).
✧ Any lower level unit that is called by the main program
appears as a “stub”;
▪ stubs are pieces of throw-away code that emulate a called unit.
✧ So, first step is to develop stubs for all the units called
by the main.
✧ In a stub for any unit, the tester hard codes in a correct
response to the request from the calling/invoking unit.
✧ In the stub for zodiac, for example, if the main program
calls zodiac with 05, 27, 2012, zodiacStub would return
“Gemini.”

7
Top-Down Integration

• Grey units are stubs


○ they return the correct values when referenced
• The goal of this first step is to check that the main
program’s functionality is correct.
8
Zodiac Stub

Procedure zodiacStub(mm, dd, yyyy)


if ((mm = 5) and (dd = 27) and (yyyy = 2012)) then
return “Gemini”
endif
.
.
.

if ……………………. then
return “Taurus”
endif
9
Next Steps
✧ Once the main program has been tested, we replace
one stub at a time, leaving the others as stubs.
✧ Figure below shows the first three steps in the gradual
replacement of stubs by actual code.
✧ The stub replacement process proceeds in a
breadth-first traversal of the decomposition tree until all
the stubs have been replaced.
✧ In all figures, the units below the first level are not
shown, because they are not needed.
✧ The process:
▪ After each level is completed; move down one level
• one stub is replaced at a time with actual code
• any fault must be in the newly integrated unit
✧ Fault isolation is similar to that of Test-Driven
Development.
10
Next three steps in Top-Down integration.

11
Bottom-Up Integration

✧ Bottom-up integration is a “mirror image” to the


top-down order,
▪ with the difference that stubs are replaced by driver modules
that emulate units at the next level up in the tree.
✧ Begins with the leaves of the decomposition tree and
uses a driver version of the unit that would normally call
it to provide it with test cases.
✧ As units are tested, the drivers are gradually replaced,
until the full decomposition tree has been traversed.
✧ There is less throw-away code in bottom-up integration,

12
Bottom-Up Integration

The figure shows the first step in bottom-up integration. The gray
units are drivers.

13
Next steps in Bottom-Up integration

✧ The zodiac unit is tested with a driver.


✧ The Calendar driver would probably call zodiac with 36 (12*3) test
dates that are the day before a cusp date, the cusp date, and the
day after the cusp date.
✧ The cusp date for Gemini is May 21, so the driver would call zodiac
three times, with May 20, May 21, and May 22.
✧ The expected responses, respectively, would be “Taurus,” “Gemini,”
and “Gemini.”

14
Sandwich Integration
✧ Sandwich integration is a combination of top-down and bottom-up
integration.
✧ A “sandwich” is one path from the root to a leaf of the functional
decomposition tree.
✧ No stubs nor drivers are needed.
✧ But, the fault isolation capability of the top-down and bottom-up
approaches is sacrificed.

15
Pros and Cons of Decomposition Based
Integration

✧ Advantages:
▪ They are all intuitively clear; build up with tested components.
▪ Whenever a failure is observed, the most recently added unit is
suspected.
▪ Integration testing progress can easily be tracked against the
decomposition tree.

✧ Disadvantage:
▪ The development effort for stubs or drivers is another drawback to
these approaches, and this is compounded by the retesting effort.

16

You might also like