SlideShare une entreprise Scribd logo
1  sur  55
Télécharger pour lire hors ligne
Università degli Studi dell’Aquila




L20: White Box/Structural Testing

                                      Henry Muccini
          DISIM, University of L’Aquila
 www.henrymuccini.com, henry.muccini@univaq.it
The material in these slides may be freely reproduced and
distributed, partially or totally, as far as an explicit
reference or acknowledge to the material author is
preserved.




Partially based on material from Alex Orso, Mauro Pezze’,
Michal Young, and Andreas Zeller
AGENDA
Recap
                              Fault, Error, Failure chain

White Box Testing
                                   Statement Coverage

                Branch Coverage
                              Basic Condition Coverage

                MC/CD Coverage
Recap
“Systematic” testing vs. “ad hoc”testing
 →Repeatable,   Measurable

Software Testing Process
 →Test   Selection, Test Execution, Oracle, Adequacy


Type of testing
 →Unit,Integration, System
 →Performance, Stress

 →Regression

 →WB, BB
Fundamental Testing Questions
Test Case:
  How is test described / recorded?
Test Criteria:
  What should we test?
Test Oracle:
  Is the test correct?
Test Adequacy:
  How much is enough?
Test Process:
  Is testing complete and effective?
Test Driver: used to execute the system on the SUT
Stubs: to reproduce missing objects, for integration testing
Fault, Error, Failure
Fault: anomaly in source code
  →   may or may not produce a failure
  →   a “bug”

Error: inappropriate development action
  →   action introduced by a fault
  →   Cause of a fault

Failure: incorrect/unexpected behavior or output
  →   incident is the symptoms revealed by execution
  →   failures are usually classified
THE FAULT-FAILURE MODEL


                                         Error                              Failure
       Fault
                                                                          affects the
                                                                         delivered service

                                    sw internal state
       must be                      is corrupted
       activated                    (latent or manifest)


A fault will manifest itself as a failure if all of the 3 following conditions hold:

1) EXECUTION: the faulty piece of code is executed
2) INFECTION: the internal state of the program is corrupted (error state)
3) PROPAGATION: the error propagates to program output


     PIE MODEL                (Voas, IEEE TSE Aug. 1992)
WHITE BOX/STRUCTURAL TESTING
How to test this
Java program?
Selection of test suite is based on some
elements in the code                              (Test) Inputs

Assumption: Executing the faulty
“element” is a necessary condition for
revealing a fault                                                 Source
                                                                  Code
There exist several examples
 → Control flow (statement, branch, basis path,
   path)                                               Output
 → Condition (simple, multiple)                   Internal behavior
 → Loop

 → Dataflow (all-uses, all-du-paths)

 → Fault based (mutation)
Idea:
  →   A program is a graph
  →   A graph can be traversed, by using some inputs
  →   A test suite is adequate if I guarantee certain
      coverage
        ─ Metric: percentage of coverage achieved




          Objective: Cover the software structure
Control Flow
  →   The partial order of statement execution, as defined by the
      semantics of the language
Data Flow
  →   The flow of values from definitions of a variable to its uses




             Graph representation of control flow and
                     data flow relationships
1   function P return INTEGER is
 2   begin
 3      X, Y: INTEGER;
 4      READ(X); READ(Y);
 5      while (X > 10) loop
 6           X := X – 10;
 7           exit when X = 10;
 8      end loop;
 9      if (Y < 20 and then X mod 2 = 0) then
10           Y := Y + 20;
11      else
12           Y := Y – 20;
13      end if;
14      return 2*X + Y;
15   end P;
6                  7            10
                     F
            T                  T            T
                    F 9        T
2,3,4   5                 9a           9´
                                       9b            14
                               F            F

                                                12
printSum(int a, int b) {       Test this case
   int result = a + b;
   if (result > 0)
     printcol(“red”, result); and this one
   else if (result < 0)
     printcol(“blue”, result);
  [else do nothing]            and this one!

}
Defined in terms of
 → test   requirements
Result in
 → test specifications
 → test cases

Selection VS adequacy/evaluation criteria
test specifications

printSum(int a, int b) {       a+b>0
   int result = a + b;
   if (result > 0)
     printcol(“red”, result); a + b < 0
   else if (result < 0)
     printcol(“blue”, result);
  [else do nothing]            a + b == 0

}
test cases

printSum(int a, int b) {       a == 3
                               b == 9
   int result = a + b;
   if (result > 0)
                               a == -5
     printcol(“red”, result); b == -8
   else if (result < 0)
     printcol(“blue”, result);
                               a == 0
  [else do nothing]            b == 0
}
Test requirements: Statements in program


Cstmts = (number of executed statements)
           (number of statements)
printSum(int a, int b) {
    int result = a + b;
    if (result > 0)
      printcol(“red”, result);
    else if (result < 0)
      printcol(“blue”, result);
  }


Coverage: 0%
a == 3
  b == 9
  printSum(int a, int b) {
    int result = a + b;
    if (result > 0)
      printcol(“red”, result);
    else if (result < 0)
      printcol(“blue”, result);
  }


Coverage: 71%
a == 3   a == -5
  b == 9   b == -8
  printSum(int a, int b) {
    int result = a + b;
    if (result > 0)
      printcol(“red”, result);
    else if (result < 0)
      printcol(“blue”, result);
  }


Coverage: 100%
Test hypothesis:
 →By  executing a path once, potential faults related to it will
  be revealed (independently from the input)


Ideally:
 →To exhaustively cover all possible paths along the program
  graph representation
Approximations to path coverage
 →Coverage   criteria
Only about 1/3 of NASA statements were executed
under test before software was released (Stucki 1973)
Microsoft reports 80-90% statement coverage
Boeing must get 100% statement coverage (feasible)
for all software
Usually can about 85% coverage; 100% is harder
 → Unreachable code; dead code
 → Complex sequences

 → Not enough resources
a == 3   a == -5
  b == 9   b == -8
  printSum(int a, int b) {
    int result = a + b;
    if (result > 0)
      printcol(“red”, result);
    else if (result < 0)
      printcol(“blue”, result);
  }


Coverage: 100%
a == 3   a == -5
  b == 9   b == -8
  printSum(int a, int b) {
     int result = a + b;
     if (result > 0)
       printcol(“red”, result);
     else if (result < 0)
       printcol(“blue”, result);
    [missing branch]
  }

Coverage: 100%
Test requirements: Branches in the program


Cbranches = (number of traversed branches)
               (number of branches)
a == 3     a == -5
   b == 9     b == -8
  printSum(int a, int b) {
     int result = a + b;
     if (result > 0)
       printcol(“red”, result);
     else if (result < 0)
       printcol(“blue”, result);
    [missing branch]
  }

Coverage: ?
a == 3   a == -5
  b == 9   b == -8
  printSum(int a, int b) {
     int result = a + b;
     if (result > 0)
       printcol(“red”, result);
     else if (result < 0)
       printcol(“blue”, result);
    [missing branch]
  }

Coverage: 88%
a == 3   a == -5   a == 0
  b == 9   b == -8   b == 0
  printSum(int a, int b) {
     int result = a + b;
     if (result > 0)
       printcol(“red”, result);
     else if (result < 0)
       printcol(“blue”, result);
    [missing branch]
  }

Coverage: 100%
entry       • Consider test cases
                                        {(x=5,y=5), (x=5, y=-5)}
1. void main() {
                           3
2. float x, y;
3. read(x);                4
4. read(y);          !(X=0  X=0 ||
5. if(x==0)||(y>0)   ||y>0) y>0

6.    y = y/x;
                      7           6
7. else x = y+2;
                           8
8. write(x);
9. write(y);
                           9
10.}
                          exit
entry       • Consider test cases
                                        {(x=5,y=5), (x=5, y=-5)}
1. void main() {
                           3          • The test suite is adequate
2. float x, y;
                                        for branch coverage, but
3. read(x);                4            does not reveal the fault
4. read(y);          !(X=0  X=0 ||
                     ||y>0) y>0
                                        at statement 6
5. if(x==0)||(y>0)
                                      • Predicate 5 can be true
6.    y = y/x;
                      7           6     or false operating on only
7. else x = y+2;
                           8            one condition
8. write(x);
9. write(y);
10.}
                           9
                                                   ⇓
                          exit
                                      Basic condition coverage
Test requirements: Truth values assumed by
basic conditions


      Cbc = (number of boolean values assumed by all basic conditions)
                (number of boolean values of all basic conditions)




                                  x              y
                                  T              T
                                  F              F
entry       • Consider test cases
                                        {(x=0,y=-5), (x=5, y=5)}
1. void main() {
                           3          • The test suite is
2. float x, y;
                                        adequate for basic
3. read(x);                4            condition coverage
4. read(y);          !(X=0  X=0 ||
                                             x          y
5. if(x==0)||(y>0)   ||y>0) y>0

6.    y = y/x;                               T          T
                      7           6
7. else x = y+2;                             F          F
                           8
8. write(x);
                                      • but is not adequate
9. write(y);
                           9            for branch coverage.
10.}
                          exit
                                                  ⇓
                                      Branch and condition
                                       coverage
Test requirements: Branches and truth values
assumed by basic conditions


                  if ( ( a || b ) && c ) { … }




            a         b           c        Outcome
            T         T           T              T
            F         F           F              F
Key idea: Test important combinations of
conditions, avoiding exponential blowup


A combination is “important” if each basic
condition is shown to independently affect the
outcome of each decision
MC/DC criterion: For each basic condition C, there are
two test cases in which the truth values of all
conditions except C are the same, and the compound
condition as a whole evaluates to True for one of those
test cases and False for the other
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False
MC/DC criterion: For
              ( a && b && c )                 each basic condition
Test case    a       b       c      outcome   C, there are two test
   1        True    True    True     True     cases in which the
   2        True    True    False    False    truth values of all
   3        True    False   True     False    conditions except C
   4        True    False   False    False    are the same, and the
   5        False   True    True     False    compound condition
   6        False   True    False    False    as a whole evaluates
   7        False   False   True     False
                                              to True for one of
   8        False   False   False    False
                                              those test cases and
                                              False for the other
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
   3        True    False   True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
   3        True    False   True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
   3        True    False   True     False
( a && b && c )
Test case    a       b       c      outcome
   1        True    True    True     True
   2        True    True    False    False
   3        True    False   True     False
   4        True    False   False    False
   5        False   True    True     False
   6        False   True    False    False
   7        False   False   True     False
   8        False   False   False    False

   1        True    True    True     True
   5        False   True    True     False
   3        True    False   True     False
   2        True    True    False    False
Tradeoff between number of required test
cases and thoroughness of the test


Required by both US and European quality
standards in aviation
Path coverage: cover each path in the program
Loop coverage (given n): cover all paths that contain at
  most n iterations of any loop in the program
Data-flow coverage: cover data-flow relations in the
 program (du pairs)
Mutation coverage: cover (kill) mutated versions of the
 program
Most widely used as adequacy criteria because fully
automatable!
 Not all graph paths correspond to actual program paths
 →some  paths could be not executable
 →Conditions may not be satisfiable due to interdependent
 conditions
 →Paths may not be executable due to interdependent decisions

 The testing output is strongly related to the testing
inputs
White Box Testing (Introduction to)

Contenu connexe

Tendances (20)

Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
 
Input Space Partitioning
Input Space PartitioningInput Space Partitioning
Input Space Partitioning
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model Checking
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model Checking
 
Control Structures
Control StructuresControl Structures
Control Structures
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
 
Control structures i
Control structures i Control structures i
Control structures i
 
Control structures in C
Control structures in CControl structures in C
Control structures in C
 
Control statement-Selective
Control statement-SelectiveControl statement-Selective
Control statement-Selective
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
Control structure in c
Control structure in cControl structure in c
Control structure in c
 
Control structure
Control structureControl structure
Control structure
 
Control Structures: Part 1
Control Structures: Part 1Control Structures: Part 1
Control Structures: Part 1
 
White Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop TestingWhite Box Testing And Control Flow & Loop Testing
White Box Testing And Control Flow & Loop Testing
 
Unit II chapter 4 Loops in C
Unit II chapter 4 Loops in CUnit II chapter 4 Loops in C
Unit II chapter 4 Loops in C
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
 
Control statement in c
Control statement in cControl statement in c
Control statement in c
 

Similaire à White Box Testing (Introduction to)

How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITEgor Bogatov
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good TestsTomek Kaczanowski
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2Abdul Haseeb
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test frameworkAbner Chih Yi Huang
 
Debug - MITX60012016-V005100
Debug - MITX60012016-V005100Debug - MITX60012016-V005100
Debug - MITX60012016-V005100Ha Nguyen
 
4366 chapter7
4366 chapter74366 chapter7
4366 chapter7Sai Kumar
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.pptHongV34104
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNoSuchCon
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSubash John
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Udayan Khattry
 
Software testing lab manual
Software testing lab manualSoftware testing lab manual
Software testing lab manualTanzeem Syed
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paperfntsofttech
 
COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops Hemantha Kulathilake
 

Similaire à White Box Testing (Introduction to) (20)

White box-sol
White box-solWhite box-sol
White box-sol
 
Issta13 workshop on debugging
Issta13 workshop on debuggingIssta13 workshop on debugging
Issta13 workshop on debugging
 
Mutation @ Spotify
Mutation @ Spotify Mutation @ Spotify
Mutation @ Spotify
 
Python for Beginners(v2)
Python for Beginners(v2)Python for Beginners(v2)
Python for Beginners(v2)
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
Debug - MITX60012016-V005100
Debug - MITX60012016-V005100Debug - MITX60012016-V005100
Debug - MITX60012016-V005100
 
4366 chapter7
4366 chapter74366 chapter7
4366 chapter7
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.ppt
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
C Tutorials
C TutorialsC Tutorials
C Tutorials
 
Software testing lab manual
Software testing lab manualSoftware testing lab manual
Software testing lab manual
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
 
COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
 

Plus de Henry Muccini

Human Behaviour Centred Design
Human Behaviour Centred Design Human Behaviour Centred Design
Human Behaviour Centred Design Henry Muccini
 
How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...Henry Muccini
 
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieLa gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieHenry Muccini
 
Turismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileTurismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileHenry Muccini
 
Sustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementSustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementHenry Muccini
 
Software Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsSoftware Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsHenry Muccini
 
The influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsThe influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsHenry Muccini
 
An IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureAn IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureHenry Muccini
 
Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Henry Muccini
 
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Henry Muccini
 
Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Henry Muccini
 
Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Henry Muccini
 
Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Henry Muccini
 
Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Henry Muccini
 
Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Henry Muccini
 
Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Henry Muccini
 
Collaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityCollaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityHenry Muccini
 
Engineering Cyber Physical Spaces
Engineering Cyber Physical SpacesEngineering Cyber Physical Spaces
Engineering Cyber Physical SpacesHenry Muccini
 
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISI progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISHenry Muccini
 
Exploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureExploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureHenry Muccini
 

Plus de Henry Muccini (20)

Human Behaviour Centred Design
Human Behaviour Centred Design Human Behaviour Centred Design
Human Behaviour Centred Design
 
How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...
 
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieLa gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
 
Turismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileTurismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibile
 
Sustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementSustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd management
 
Software Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsSoftware Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of Things
 
The influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsThe influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design Decisions
 
An IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureAn IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building Architecture
 
Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)
 
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
 
Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)
 
Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)
 
Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)
 
Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)
 
Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)
 
Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)
 
Collaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityCollaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on Sustainability
 
Engineering Cyber Physical Spaces
Engineering Cyber Physical SpacesEngineering Cyber Physical Spaces
Engineering Cyber Physical Spaces
 
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISI progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
 
Exploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureExploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software Architecture
 

Dernier

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Dernier (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

White Box Testing (Introduction to)

  • 1. Università degli Studi dell’Aquila L20: White Box/Structural Testing Henry Muccini DISIM, University of L’Aquila www.henrymuccini.com, henry.muccini@univaq.it
  • 2. The material in these slides may be freely reproduced and distributed, partially or totally, as far as an explicit reference or acknowledge to the material author is preserved. Partially based on material from Alex Orso, Mauro Pezze’, Michal Young, and Andreas Zeller
  • 3. AGENDA Recap Fault, Error, Failure chain White Box Testing Statement Coverage Branch Coverage Basic Condition Coverage MC/CD Coverage
  • 4. Recap “Systematic” testing vs. “ad hoc”testing →Repeatable, Measurable Software Testing Process →Test Selection, Test Execution, Oracle, Adequacy Type of testing →Unit,Integration, System →Performance, Stress →Regression →WB, BB
  • 5. Fundamental Testing Questions Test Case: How is test described / recorded? Test Criteria: What should we test? Test Oracle: Is the test correct? Test Adequacy: How much is enough? Test Process: Is testing complete and effective? Test Driver: used to execute the system on the SUT Stubs: to reproduce missing objects, for integration testing
  • 6. Fault, Error, Failure Fault: anomaly in source code → may or may not produce a failure → a “bug” Error: inappropriate development action → action introduced by a fault → Cause of a fault Failure: incorrect/unexpected behavior or output → incident is the symptoms revealed by execution → failures are usually classified
  • 7. THE FAULT-FAILURE MODEL Error Failure Fault affects the delivered service sw internal state must be is corrupted activated (latent or manifest) A fault will manifest itself as a failure if all of the 3 following conditions hold: 1) EXECUTION: the faulty piece of code is executed 2) INFECTION: the internal state of the program is corrupted (error state) 3) PROPAGATION: the error propagates to program output PIE MODEL (Voas, IEEE TSE Aug. 1992)
  • 9. How to test this Java program?
  • 10. Selection of test suite is based on some elements in the code (Test) Inputs Assumption: Executing the faulty “element” is a necessary condition for revealing a fault Source Code There exist several examples → Control flow (statement, branch, basis path, path) Output → Condition (simple, multiple) Internal behavior → Loop → Dataflow (all-uses, all-du-paths) → Fault based (mutation)
  • 11. Idea: → A program is a graph → A graph can be traversed, by using some inputs → A test suite is adequate if I guarantee certain coverage ─ Metric: percentage of coverage achieved Objective: Cover the software structure
  • 12. Control Flow → The partial order of statement execution, as defined by the semantics of the language Data Flow → The flow of values from definitions of a variable to its uses Graph representation of control flow and data flow relationships
  • 13. 1 function P return INTEGER is 2 begin 3 X, Y: INTEGER; 4 READ(X); READ(Y); 5 while (X > 10) loop 6 X := X – 10; 7 exit when X = 10; 8 end loop; 9 if (Y < 20 and then X mod 2 = 0) then 10 Y := Y + 20; 11 else 12 Y := Y – 20; 13 end if; 14 return 2*X + Y; 15 end P;
  • 14. 6 7 10 F T T T F 9 T 2,3,4 5 9a 9´ 9b 14 F F 12
  • 15. printSum(int a, int b) { Test this case int result = a + b; if (result > 0) printcol(“red”, result); and this one else if (result < 0) printcol(“blue”, result); [else do nothing] and this one! }
  • 16. Defined in terms of → test requirements Result in → test specifications → test cases Selection VS adequacy/evaluation criteria
  • 17. test specifications printSum(int a, int b) { a+b>0 int result = a + b; if (result > 0) printcol(“red”, result); a + b < 0 else if (result < 0) printcol(“blue”, result); [else do nothing] a + b == 0 }
  • 18. test cases printSum(int a, int b) { a == 3 b == 9 int result = a + b; if (result > 0) a == -5 printcol(“red”, result); b == -8 else if (result < 0) printcol(“blue”, result); a == 0 [else do nothing] b == 0 }
  • 19. Test requirements: Statements in program Cstmts = (number of executed statements) (number of statements)
  • 20. printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); } Coverage: 0%
  • 21. a == 3 b == 9 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); } Coverage: 71%
  • 22. a == 3 a == -5 b == 9 b == -8 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); } Coverage: 100%
  • 23. Test hypothesis: →By executing a path once, potential faults related to it will be revealed (independently from the input) Ideally: →To exhaustively cover all possible paths along the program graph representation Approximations to path coverage →Coverage criteria
  • 24. Only about 1/3 of NASA statements were executed under test before software was released (Stucki 1973) Microsoft reports 80-90% statement coverage Boeing must get 100% statement coverage (feasible) for all software Usually can about 85% coverage; 100% is harder → Unreachable code; dead code → Complex sequences → Not enough resources
  • 25.
  • 26. a == 3 a == -5 b == 9 b == -8 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); } Coverage: 100%
  • 27. a == 3 a == -5 b == 9 b == -8 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); [missing branch] } Coverage: 100%
  • 28. Test requirements: Branches in the program Cbranches = (number of traversed branches) (number of branches)
  • 29. a == 3 a == -5 b == 9 b == -8 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); [missing branch] } Coverage: ?
  • 30. a == 3 a == -5 b == 9 b == -8 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); [missing branch] } Coverage: 88%
  • 31. a == 3 a == -5 a == 0 b == 9 b == -8 b == 0 printSum(int a, int b) { int result = a + b; if (result > 0) printcol(“red”, result); else if (result < 0) printcol(“blue”, result); [missing branch] } Coverage: 100%
  • 32.
  • 33. entry • Consider test cases {(x=5,y=5), (x=5, y=-5)} 1. void main() { 3 2. float x, y; 3. read(x); 4 4. read(y); !(X=0 X=0 || 5. if(x==0)||(y>0) ||y>0) y>0 6. y = y/x; 7 6 7. else x = y+2; 8 8. write(x); 9. write(y); 9 10.} exit
  • 34. entry • Consider test cases {(x=5,y=5), (x=5, y=-5)} 1. void main() { 3 • The test suite is adequate 2. float x, y; for branch coverage, but 3. read(x); 4 does not reveal the fault 4. read(y); !(X=0 X=0 || ||y>0) y>0 at statement 6 5. if(x==0)||(y>0) • Predicate 5 can be true 6. y = y/x; 7 6 or false operating on only 7. else x = y+2; 8 one condition 8. write(x); 9. write(y); 10.} 9 ⇓ exit Basic condition coverage
  • 35.
  • 36. Test requirements: Truth values assumed by basic conditions Cbc = (number of boolean values assumed by all basic conditions) (number of boolean values of all basic conditions) x y T T F F
  • 37. entry • Consider test cases {(x=0,y=-5), (x=5, y=5)} 1. void main() { 3 • The test suite is 2. float x, y; adequate for basic 3. read(x); 4 condition coverage 4. read(y); !(X=0 X=0 || x y 5. if(x==0)||(y>0) ||y>0) y>0 6. y = y/x; T T 7 6 7. else x = y+2; F F 8 8. write(x); • but is not adequate 9. write(y); 9 for branch coverage. 10.} exit ⇓ Branch and condition coverage
  • 38. Test requirements: Branches and truth values assumed by basic conditions if ( ( a || b ) && c ) { … } a b c Outcome T T T T F F F F
  • 39. Key idea: Test important combinations of conditions, avoiding exponential blowup A combination is “important” if each basic condition is shown to independently affect the outcome of each decision
  • 40. MC/DC criterion: For each basic condition C, there are two test cases in which the truth values of all conditions except C are the same, and the compound condition as a whole evaluates to True for one of those test cases and False for the other
  • 41. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False
  • 42. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False
  • 43. MC/DC criterion: For ( a && b && c ) each basic condition Test case a b c outcome C, there are two test 1 True True True True cases in which the 2 True True False False truth values of all 3 True False True False conditions except C 4 True False False False are the same, and the 5 False True True False compound condition 6 False True False False as a whole evaluates 7 False False True False to True for one of 8 False False False False those test cases and False for the other
  • 44. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False
  • 45. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False
  • 46. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False
  • 47. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False 3 True False True False
  • 48. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False 3 True False True False
  • 49. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False 3 True False True False
  • 50. ( a && b && c ) Test case a b c outcome 1 True True True True 2 True True False False 3 True False True False 4 True False False False 5 False True True False 6 False True False False 7 False False True False 8 False False False False 1 True True True True 5 False True True False 3 True False True False 2 True True False False
  • 51. Tradeoff between number of required test cases and thoroughness of the test Required by both US and European quality standards in aviation
  • 52.
  • 53. Path coverage: cover each path in the program Loop coverage (given n): cover all paths that contain at most n iterations of any loop in the program Data-flow coverage: cover data-flow relations in the program (du pairs) Mutation coverage: cover (kill) mutated versions of the program
  • 54. Most widely used as adequacy criteria because fully automatable! Not all graph paths correspond to actual program paths →some paths could be not executable →Conditions may not be satisfiable due to interdependent conditions →Paths may not be executable due to interdependent decisions The testing output is strongly related to the testing inputs