Part 2 MBT and RV Flashcards
What is the relationship between specification and implementation?
The implementation must be a subset of the behaviors allowed by the specification.
What is the purpose of runtime verification?
To ensure the system’s behavior during execution complies with the specification.
How does runtime verification differ from unit testing?
Unit testing checks specific code functions or modules, while runtime verification monitors system behavior during execution.
What is a finite state automaton (FSA)?
A model of system behavior with defined states and transitions.
What are the three key steps in designing an FSA?
- List possible inputs.
- Identify conditions for valid/invalid inputs.
- Define system states and transitions.
Provide an example of a system state and transition in an FSA.
State: “On hook” (telephone).
Transition: “Lifting receiver” moves the phone to “Off hook” state.
What are the key components of runtime verification?
System, Monitor, and Verifier.
What is the role of the monitor in runtime verification?
To observe system events and ensure compliance with specifications.
What is a challenge associated with runtime verification?
Monitoring can cause delays, breaking real-time properties if the overhead is too high.
How does aspect-oriented programming (AOP) simplify cross-cutting concerns?
By modularizing functionality like logging without modifying individual methods.
Why is model-based testing (MBT) beneficial?
It automates the generation and execution of test cases, reducing manual effort and errors.
What are the main steps in model-based testing?
- Create a model of the system.
- Generate test cases.
- Execute tests (offline or online).
- Use an oracle to verify outputs.
What are the three algorithms used for generating test cases in MBT?
Random, Greedy, and Lookahead.
What is the purpose of guards in MBT?
To specify conditions under which certain actions are valid.
What are the states in an FSA for a lighting system?
Off, Dim, Normal, Bright.
What actions can a coffee vending machine perform?
Insert money, choose a drink, add extras (milk, sugar), dispense drink.
What is ModelJUnit?
A Java-based MBT tool that uses finite state machines to generate and execute tests.
How does ModelJUnit measure test coverage?
By tracking states visited, transitions exercised, and transition pair combinations.
What is the function of guards in ModelJUnit?
To restrict actions to only valid conditions.
Name three features of ModelJUnit.
- Define models using FSMs.
- Add guards and actions.
- Measure test coverage.
What are examples of coverage measures in MBT?
States visited, transitions exercised, transition pair combinations.
How does runtime verification ensure system reliability?
By detecting and preventing system failures in real time.
What is the primary benefit of lookahead test generation in MBT?
It considers future transitions to improve test coverage.