120 likes | 302 Views
Automatic Test Case Generation Based on State Machines Using UPPAAL. BME Consortium Meeting, Reggio Emilia Oct. 21, 2009. Tool Chain. Input model UML State Machine with Time Extension Intermediate model Kripke Transition System Target model UPPAAL timed automaton. Input Model.
E N D
Automatic Test Case GenerationBased on State Machines Using UPPAAL BME Consortium Meeting, Reggio Emilia Oct. 21, 2009
Tool Chain • Input model • UML State Machine with Time Extension • Intermediate model • Kripke Transition System • Target model • UPPAAL timed automaton
Input Model • State Machines with Time Extensions • Basis: UML State Machines • States, transitions • State hierarchies, compound transitions • Various pseudo-states, history mechanism etc. • Events: based on time events • Standard extension by the UML Profile for Modeling and Analysis of Real-time and Embedded Systems (MARTE)
Input Model • Advanced time event modeling concepts • Clocks attached to states • Initialized at entering the state • Specified by MARTE concepts (rate, drift, etc.) • Timed events • Relative time events triggering transitions may refer to clocks attached to source state (s)
Input Model • Unambiguous specification of guards and activities • Guards expressed in OCL • Activities expressed in a dedicated executable language AGSL • Usual arithmetic operations, assignments etc. • Function calls and procedure invocations
Intermediate Model • Kripke Transition System (KTS) • States: statuses of the state machine • Configuration • Evaluation of extended variables • Execution phase (for run-to-completion behavior) • Transitions: steps of the state machine • Event triggering the step • Set of compound transitions fired • Activity structure to be performed
Kripke transition system Location of the KTS: a status of the state machine, i.e., … …configuration (set of active states), … …phase of execution, etc.
Edge of the KTS: a step of the state machine, i.e., …activity structure to be performed, etc… …the event triggering the step, … …transitions fired, …
Target Model • UPPAAL timed automaton • An implementation of the KTS in UPPAAL • States and transitions mapped one-to-one • Events • Signals mapped to synchronization constructs • Timed events implemented by timed guards • Clocks implemented by UPPAAL clocks • Activities • AGSL translated to UPPAAL
Test Generation • Test case: trajectory in timed automaton’s state space with coverage constraints • E.g., achieving state coverage • 1, Assign Boolean variables to UML states • 2, Initialize these variables to false • 3, Add entry activities that set the corresponding variable to true • 4, Define a statement like ”There is no such event sequence that results in all variables set to true” • 5, The counter-example returned by UPPAAL will be the test case
State of Elaboration • Steps carried out until now • Experiments with UPPAAL performed • Metamodel of intermediate KTS prepared • UML KTS model transformation prepared • Next step • KTS UPPAAL model transformation