Homework 8

  1. Using the steps discussed in lecture 19, develop a small test plan for the following program specification: (7 points)
    • The program shall provide an alarm clock feature. A user can specify multiple alarms. Each alarm rings the computer's bell when it is activated. Once an alarm is activated, it will ring for five seconds. A user can cancel the alarm or activate the "snooze" feature which delays the alarm by a user-specified amount of time. A user can also cancel a pending alarm.

    Note: You do not have to specify explicit test cases for this test plan. We are more interested in the functional categories, specification items, and categories that you come up with.

  2. Draw the control flow graph of the following method. (3 points)

     1 int foo(int a, int b, int c) {
     2     if ( a > 20 ) {
     3         b++;
     4     } else {
     5         c++;
     6     }
     7     while ( a > b && a < c ) {
     8         if ( a == 10 ) {
     9             break;
    10         }
    11         a++;
    12     }
    13     return (a + b + c);
    14 }

Submission

Please submit homework 8 to the moodle as an archive containing the answer to question one in a text file and the answer to question 2 as an image or PDF file.