Copyright © 1998 Sita Ramakrishnan, Monash University All rights reserved

Light Views

HomeCase StudiesOO TheoryHelp

OO Testing Process in simulating functionalities of a VCR

Scenario 2

Monitor Bean :

Demonstration: VCR Component Beans (applet)

Contains:

    a) Monitor.java - listens & processes events generated by the Navigator Bean.
    b) DrawMonitor.java - draw all images on the monitor bean surface. Includes monitor border & pictures
    c) MonitorEvent.java - provides monitor event sources.
    d) MonitorEventListener.java - provides monitor event listener interface.
    e) DrawMenu.java - draw timer menu on the monitor bean surface.
    f) DrawRecordEntry.java - Display record entry on the monitor bean surface.

 

Fig 23. Class diagram for MonitorEventListener class

 

Fig 24. Monitor Class

Fig 26. MonitorEvent.java

Fig 27. DrawMenu.java

 

Fig 29. NavigatorEvent state diagram - Focussing on navigatorClicked method defined in Monitor Bean for Navigator event handling

 

 

Fig 30. State diagram Focussing on processMonitorEvent method in Monitor Bean.

We want to highlight the communication between MonitorEvent object and MonitorEventListener object using state diagrams. MonitorEvent captures events and notifies MonitorEventListener for occurrence of such monitor events.

State Diagram Bean contains:

Demonstration: VCR Component Beans (applet)

Contains:

    a) Sdiagram.java - provides the state transition diagrams of VCR, Remote Control and TV Monitor and shows the monitor bean's internal state changes.
    b) DrawState.java - draw the image of the state transition diagram on to the state diagram bean surface.


Fig 31. Sdiagram.java class diagram

 

 

 

Fig 33. Monitor Event State Diagram

Shows state diagram communication in State Transition Bean - between MonitorEventListener object (implemented in Sdiagram), Sdiagram object and DrawState object. The diagram highlights the powerOn/Off states of the monitor & VCR. It draws a warning sign of blinking circle on the state transition diagram to show that transition to the next state such as startRecord is not possible, when the monOn/VCRoff state is true.

State diagram communication

Demonstration: Monitor Event State Diagram Communication (applet)
Demonstration: High Level State Diagram Communication (applet)

Fig 9. High Level State Diagram Communication

Unit Tests and integration tests use state diagrams. We show the state diagram communication between VCR, remote control & TV objects

 


Funded by Committee of University Teaching And Staff Development (CUTSD) through DEETYA, 1998

 


Disclaimer