Professional Documents
Culture Documents
3
Call Graph of Calendar Program
4
Call graph-based top-down integration
✧ Since edges in the Call Graph refer to actual
execution-time connections, one can repeat the discussion
made before based on stubs and drivers in the units of the
call graph.
✧ This will work, and also preserve the fault isolation feature
of the decomposition-based approaches.
▪ while avoiding its deficiencies.
5
Pairwise Integration
6
Three pairs for pairwise integration.
- getDate and getDigits,
- nextDate and dayNumToDate, and
- weekDay and isFriday.
✧ Advantages:
▪ Higher degree of fault isolation.
▪ If a test fails, the fault must be in one of the two units.
✧ Disadvantage:
▪ For units involved on several pairs, a fix that works in
one pair may not work in another pair.
7
Neighborhood Integration
8
Three neighborhoods (of radius 1) for
Calendar
The neighborhoods for nodes:
- isValidDate,
- nextDate, and
- memorialDay
are shown
9
Calculating Neighborhoods
10
Pros and Cons of Call Based Integration
✧ Advantages:
▪ Call Graph based integration techniques move from a purely structural
basis toward a behavioral basis.
▪ Call graph integration is slightly better than the decomposition tree-based
approach.
▪ Neighborhood-based techniques reduce the stub/driver development
effort.
▪ call graph-based integration matches well with developments
characterized by builds and composition.
▪ this supports the use of neighborhood-based integration for systems
developed by life cycles in which composition dominates.
✧ Disadvantages:
▪ The biggest drawback to call graph-based integration testing is the fault
isolation problem, especially for big neighborhoods.
▪ What happens if (when) a fault is found in a node (unit) that appears in
several neighborhoods?
▪ For nodes which involve in several neighborhoods, resolving the fault in
one neighborhood; by changing the unit’s code in some way, means that
all the previously tested neighborhoods that contain the changed node
need to be retested.
11
Path Based Integration
✧ We already know that the combination of structural and
functional testing is highly desirable at the unit level;
✧ It would be nice to have a similar capability for integration
testing, as well.
✧ Instead of just testing interfaces among separately
developed and tested units,
▪ which is attempted by both decomposition and call based
approaches
✧ We shall focus on interactions among these units.
▪ Interfaces are structural; interaction is behavioral.
✧ When a unit executes, some path of source statements is
traversed.
✧ It is always possible that a call can go to another unit
along such a path. At that point, control is passed from the
calling unit to the called unit.
12
Some Definitions about program graphs
13
Definitions (cont’d)
14
Example
In unit A;
- nodes a1, a5, and a6
are source nodes.
- nodes a4 and a8 are
sink nodes.
in unit B;
- nodes b1 and b3 are
source nodes,
- nodes b2 and b5 are
sink nodes.
Unit C has a single source
node;
- c1, and
- a single sink node, c9.
15
Example
16
Definitions (cont’d)
18
Pros and Cons of Path Based Integration
19
Drivers and Stubs
20
Drivers and Stubs
21
Example: NextDate from Calendar
22
23
24
Decomposition Based Integration of
NextDate
25
Call Graph Based Integration
msg7
ValidDate
msg6
26
Integration Based on MM-Paths
✧ The four MM-Paths for May 27, 2020 :
Main (1, 2, 3)
msg1
GetDate (34, 56, 57-65, 66)
msg 7
validDate(35, 36, 37, 39, 40, 41, 42)
msg 6
LastDayOfMonth(22, 23, 24, 25, 33)
msg 6 return
validDate(42, 43, 45, 46, 47, 48, 50, 51, 52, 54, 55)
msg7 return
GetDate (66, 67)
msg1 return
Main(3, 4)
msg2
PrintDate(58, 59, 60)
msg2 return
Main(4, 5)
msg3
IncrementDate(68, 69)
msg 8
LastDayOfMonth(22, 23, 24, 25, 33)
msg 8 return
IncrementDate(70, 72, 75, 76, 77, 78)
msg 3 return
Main(5, 6)
msg4
PrintDate(58, 59, 60)
msg4 return
Main (6, 7)
27
MM-Path Graph of NextDate
msg3
msg3 return
IncrementDate
msg8 return
msg8
29
Comparison of Integration Testing Strategies
Functional acceptable but can be limited to pairs of units good, down to faulty unit
Decomposition based deceptive
Call Graph based acceptable limited to pairs of units good, down to faulty unit
30