4  Change Summary Guidance

 

The demo “Change Summary Guidance” shows how to model “remocon” (Remote Controller). The controller has an up-button, a down-button and a liquid crystal display indicating the room temperature. By up- and down-buttons, the temperature could be controlled by one degree. The highest and lowest limits of temperatures memorized by the controller are respectively 26 and 16 degrees centigrade. The memorized temperature does not change beyond the limits. The testsuite table is as Figure 4-1. Here, it is omitted about temperature descent.

 

Figure 4-1

Figure 4-2 is a picture of the modeler, in which a state machine of remocon has been built by fixing all the structural errors of the testsuite given above.

 

Figure 4-2

 

Then we run the testsuite. Some testcases fail. This is because the effects (actions) attached to transitions have not been written yet. For example, temp_up testcase tells us the temperature (20) does not rise. So we add the command remocon_temp := remocon_temp + 1 in the effect of the transition triggered by remocon.up. The error is fixed and we do the same thing for temp_down. temp_down and temp_up run with the green bar. Now the entire model must be ok. We run the entire testsuite. Alas! We have a red bar of failure again. It seems that we had failures with some testcases. What’s wrong, then?

This is a good point to use change summary guidance. A sequence diagram displays a particular execution of a testcase. On the other hand, change summary guidance displays change of attributes and state of models caused by an event or activity under test. In this case, change summary guidance for the testsuite looks like Figure 4-3.

 

Figure 4 - 3

The second unit for testsuiteroot/remocon/temp_up shows that temp_up is ok. The temperature temp changed from 20 to 21, as expected by the testcase. But the first unit testsuiteroot/remocon/temp_up/max shows that temp_up_max for remocon failed. The temparature changes from 26 to 27, but the expected value by the testcase is 26. Oops! We have forgotten to limit the temperature rise. We have to prevent the rise over 26 by putting a guard to the transition trigger. We have to do the same for “down”. Now, we regained the green bar!