JMU
The Basics of Testing and Debugging


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Desk Checking
Testing
Debugging
The Relationship between Testing and Debugging
Instrumentation Using "Debug Output Statements"
Developing Tests
White/Clear Box Testing
White/Clear Box Testing: An Example
    public static int calculate(int x, int y)
    {
       int        a, b;

       a = 1;
       if (x > y)
       {
          a = 2;
       }

       x++;
       b = y * a;
       if (y <= 0)
       {
         b++;
       }
       
       return b;
    }
  
Black Box Testing: A Method with one Positive Input
Testing - Black-Box Unit Testing (cont.)
Testing - Black-Box Unit Testing (cont.)
Testing - Black-Box Unit Testing (cont.)
Test Execution "Tools"