1 / 18 Verification & Miaoqing Huang University of Arkansas Spring 2010
2 / 18 Outline 1 2 Testing Boundary Conditions 3 Module Testing Integration Testing
3 / 18 Outline 1 2 Testing Boundary Conditions 3 Module Testing Integration Testing
Decision table-based testing Example A word processor Three different formats plain text (p) boldface (b) italics (i) Five different commands make text plain (P) make text boldface (B) make text italics (I) emphasize (E) E can be either B or I superemphasize (SE) SE can be B, I or both (B+I) 4 / 18
The decision table Rows represent conditions Columns represent rules (i.e., results) Apply complete-coverage criterion to exercise each column The number of column may go exponentially n conditions may generate 2 n results Need to select a significant subset of all possible input classes 5 / 18
The decision table Rows represent conditions Columns represent rules (i.e., results) Apply complete-coverage criterion to exercise each column The number of column may go exponentially n conditions may generate 2 n results Need to select a significant subset of all possible input classes 6 / 18
Cause-effect graph technique Formally structure complex input-output specification using cause-effect graphs Steps 1 Transform inputs and outputs into Boolean values 2 Build the Boolean functions between inputs and outputs Example Transform inputs to a 10-tuple of Boolean {P, B, I, E, E=B, E=I, SE, SE=B, SE=I, SE=B+I} <false,true,false,false,false,false,false,false,false,false> represents command B Transform outputs of a 3-tuple of Boolean {p, b, i} <false,true,false> denotes a boldface text output 7 / 18
Cause-effect graph technique Formally structure complex input-output specification using cause-effect graphs Steps 1 Transform inputs and outputs into Boolean values 2 Build the Boolean functions between inputs and outputs Example Transform inputs to a 10-tuple of Boolean {P, B, I, E, E=B, E=I, SE, SE=B, SE=I, SE=B+I} <false,true,false,false,false,false,false,false,false,false> represents command B Transform outputs of a 3-tuple of Boolean {p, b, i} <false,true,false> denotes a boldface text output 8 / 18
The cause-effect graph for boldface text output 9 / 18
Put constraints among inputs and outputs Inputs are not independent in many cases, same as outputs The output text can not be both plain and boldface at the same time 10 / 18
The cause-effect graph with constraints m m m m 11 / 18
12 / 18 Outline Testing Boundary Conditions 1 2 Testing Boundary Conditions 3 Module Testing Integration Testing
Test the boundary conditions Testing Boundary Conditions Testing criteria partition input domain in classes, assuming that behavior is similar for all data within a class Some typical programming errors, however, just happen to be at the boundary between different classes After partitioning the input domain D into several classes, test the program using input values not only inside the classes, but also at their boundaries This technique applies to both white-box and black-box testing if x>y then s1; else s2; end if 13 / 18
14 / 18 Outline Module Testing Integration Testing 1 2 Testing Boundary Conditions 3 Module Testing Integration Testing
Testing in the large Module Testing Integration Testing Module testing testing a single module Integration testing integration of modules and subsystems System testing testing the entire system Acceptance testing performed by the customer 15 / 18
Build scaffolding Module Testing Integration Testing STUB Call Module Under Test Call DRIVER Access to nonlocal variables Scaffolding needed to create the environment in which the module should be tested stubs modules used by the module under test driver module activating the module under test How to build the scaffolding Develop simplified calling modules and called modules 16 / 18
Build scaffolding Module Testing Integration Testing STUB Call Module Under Test Call DRIVER Access to nonlocal variables Scaffolding needed to create the environment in which the module should be tested stubs modules used by the module under test driver module activating the module under test How to build the scaffolding Develop simplified calling modules and called modules 17 / 18
Integration testing Module Testing Integration Testing Big-bang approach first test individual modules in isolation then test integrated system Incremental approach modules are progressively integrated and tested can proceed both top-down and bottom-up according to the USES relation 18 / 18