CSSE 376 -- Software Quality Assurance -- Spring 2007

                               Quiz 8
                        Tuesday, March 20, 2007



Name:_________________________________________    Grade:______________


1. Draw the flow graph of the following program:

   1:   read a;
   2:   read b;
   3:   while (a != b) {
   4:      if (a < b) {
   5:         b = b - a;
   6:      } else {
   7:         a = a - b;
   8:      }
   9:   }
  10:   print a;








2. Calculate the cyclomatic complexity of the program above:





3. Given the postcondition for the following statement, calculate the
   weakest precondition:

           //

   X = X + Y

          //  X < Y

4. For the program in problem 1, what is the path condition for the
   first execution of line 5?