Once the initial state machine model is defined, an execution trace like VendingMachine.events can be checked for conformance against this model. First create in the main project directory a folder VendingMachineEventsFiles. Next extend VendingMachine.prj with a task to generate the monitoring (you may copy the text below):
Generate Monitors {
monitoringIService for interface IService {
trace directories "VendingMachineEventsFiles"
}
}
The lay-out can be improved by means of <CTRL>-<SHIFT>-F. Next perform the following steps:
-
Execute again the steps from Activity 1 by just switching on and off the machine a couple of times and performing LoadProducts. Do not perform any other actions! These actions are recorded in file VendingMachine.events.
-
Rename VendingMachine.events to VendingMachine1.events (use right-click on the files > Refactor) and move it to folder VendingMachineEventsFiles.
-
Construct a few more .event files, including a few that do not conform to the specification, and move them also to folder VendingMachineEventsFiles after renaming.
-
Right-click on file VendingMachine.prj and choose "Run As > CommaSuite Generation and Monitoring". The check is executed and results are produced.
-
In order to view the results of monitoring, see folder comma-gen/monitoringIService. If there are no errors, coverage info can be found in file CoverageInfo.txt. In each state the transitions are numbered in the order of occurrence and the file describes for each transition how often it was used during monitoring. If a transition contains multiple clauses (by mean of the "OR" construct) then also the clauses are numbered. The file also report the percentage of covered transitions and states.
-
In case of errors, an overview is giving in file ErrorSummary.txt with an indication where to find the errors.
-
Folder Statistics is related to time constraints and will be explained later.
-
-
In case of errors, a sequence diagram of the error trace is written in a file with extension .plantuml. Show the content using the PlantUML view as described in Activity 2.