
|
Scenario 1
|
OO Testing Process in simulating functionalities of a VCR Scenario 1 System directed animation for scenario 1 illustrates
Example: Selecting Test cases for a VCR systemDemonstrations:
Our VCR system model acts as a kind of simulation of the modelled operations of the VCR. This model includes the states that the system can be in, the events that cause the state changes, and the event sequences that can occur. Such a model state chart at this abstraction level shows just event sequencing. However, the specification model state charts would show how these events are generated by software. The specification model also allows objects of a subtype substitute for objects of a supertype, enabling software to be assembled from components. We consider system testing of the VCR system with the event semantics of the specification model and leave the state charts with message semantics of the design/implementation models for other forms of testing. System testing is about using meaningful functional test cases to check the working of the system. We derive meaningful test cases by using testing techniques that focus on related events that occur in the system level model of the VCR system. Here, in eventflow testing, we focus on the effect of system level events on subsequent events. On the other hand, in dataflow testing at the unit testing level, we select test cases that cover the definitions and uses of variables in a program. Using the eventflow approach, test cases can be generated automatically with the program model represented in the nested state diagrams. However, we may need manual intervention in some cases where paths that are not feasible are generated automatically. This happens when a transition depends on the occurrence of other transitions. We have chosen to discuss test selection techniques for system level testing for scenario 1, and unit level and integration level testing for scenario 2.
The VCR system has a number of interacting objects such as the VCR, TV Monitor and a Remote Control (Navigator). In scenario 1 for setting timer details, the VCR system is required to simulate the remote control operations by setting the timer operations of the VCR. It uses the TV Monitor as the user interface medium while setting the timer details. In scenario 2, we require the remote control object to control the VCR operations such as play, fast forward (ff), vol+ and others, and display the video pictures on the monitor. We also require the monitor surface for visualizing the state diagram that shows the interaction between VCR & Monitor objects.
We describe how we select system level test cases from the specification model's state chart diagrams for the timer recording scenario 1. We work out first which events are related. Using the eventflow testing technique, we focus on the effect of system level events on subsequent events. This technique is used to select test cases to cover all sequences of events that occur from a particular system level event to a related event. We begin to represent the high level behaviour of the system by specifying how the Monitor and VCR timer objects react to system level events under the control of the remote control object. How does the VCR timer recording system (operation) react to events such as Monitor.On and Monitor.Off , and interacts with the timer operation of the VCR with events such as VCRTimer.On and VCRTimer.Off.
Fig 35. System level model of the VCR system We specify that the remote control (navigator) is working and sending stimuli to the other objects for their interactions to system events. That is, navigator event is on. Monitor.On and Monitor.Off events are related under the control of the navigator. We also want to consider the VCR timer here and include its events, VCRTimer.On and VCRTimer.Off, as the timer recording function visualized on the monitor is the essence of this scenario 1. We select tests by identifying the sequence of transitions between these events that we need to cover.
We have thus created a number of test cases that cover the system requirements as specified by the system modeller. The test team would select test cases from these models by walking through events in the diagram, which illustrate how the VCR system should work. With the eventflow technique of test case sequences as shown above, we can automate the test selection process from the model (diagram).
Fig 36. Nested state diagram We now proceed to expand the nested state, SetVCRTimer. We have a nested state with a superstate, SetVCRTimer, and substates, setDate, and setTime, which can be decomposed further. Setting the VCR timer recording function involves setting the date and time, and any errors during this process is displayed on the monitor. The transition, VCRTimerOff is at the setVCRTimer superstate level indicating that the timer recording can be stopped at any time, and is controlled by the remote control. This means that the test sequences must always include VCRTimerOff like so:
We have included Monitor.Off in all sequences as the monitor is turned off after the VCRTimerOff event is executed.
Fig 37. Nested state diagram - detailed model of the SetVCRTimer and Error state We complete the test sequence generation by decomposing abstract states, SetVCRTimer and Error. We must expand the transitions into and out of the state. The transition out of the abstract state is VCRTimerOff and MonitorOff. The transition from the decomposed setVCRTimer to Error must be covered. We have 3 transitions - Date Set, (set Start Time, set End Time) from setting time, and 3 events - setting date, startTime and endTime. We must also include the transition to error by including the transition pairs (invalid Date, VCRTimer.Off), (invalid EndTime, VCRTimer.Off), (overlapped time, VCRTimer.Off) and (Too many Programmes, VCRTimer.Off) in our test sequence. {invalid Date, VCRTimer.Off}
|
Funded by Committee of University Teaching And Staff Development (CUTSD) through DEETYA, 1998