JMU
Software Verification
An Introduction to Code Reviews and Testing


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Review
Terminology
Terminology (cont.)
Terminology (cont.)
     // An example in pseudocode

     a = getNextInt();
     b = getNextInt();
     c = a/b;
     print(c);
  
Terminology (cont.)

Nerd Humor

http://imgs.xkcd.com/comics/new_bug.png
(Courtesy of xkcd)
Types of Faults
Code Analysis
Code Reviews
Facilitating Code Reviews
Examples of Static Analysis
Examples of Dynamic Analysis
Development/Construction Testing - The Stages
Development/Construction Testing - The Participants
Testing - Terminology
Testing - Approaches
Testing - Clear-Box Unit Testing
Testing - Coverage (cont.)
   // An example in pseudocode

   int calculate(int x, int y)
   {
       int        a, b;

       a = 1;                 // S1
       if (x > y)             // S2
          a = 2;              // S3
       x++;                   // S4
       b = y * a;             // S5
       if (y <= 0)            // S6
         b++;                 // S7
       return b;              // S8
    }
  
images/coverage-example.gif
Testing - Coverage (cont.)
   // An example in pseudocode

   int calculate(int x, int y)
   {
       int        a, b;

       a = 1;                 // S1
       if (x > y)             // S2
          a = 2;              // S3
       x++;                   // S4
       b = y * a;             // S5
       if (y <= 0)            // S6
         b++;                 // S7
       return b;              // S8
    }
  
Testing - Why Multiple Condition Coverage is Difficult in Practice
Testing - Black-Box Unit Testing
Testing - Black-Box Unit Testing (cont.)
Testing - Black-Box Unit Testing (cont.)
Testing - Black-Box Unit Testing (cont.)
Black Box Testing: Enumerated Types
Testing - Equivalence Classes
Testing - Integration Testing Strategies
Testing - System Testing
From Testing to Debugging
Outcomes of Debugging
Outcomes of Debugging (cont.)