Model Based Testing Flashcards
Model-based testing
automatic generationof software test procedures
using models of system requirements and behavior
in combination with automated test execution
Manual testing
+ easy & cheap to start
+ flexible testing
- expensive every execution
- no auto regression testing
- ad-hoc coverage
- no coverage measurement
Capture & Replay
+ auto regression testing
+ flexible testing
- expensive first execution
- fragile tests break easily
- ad-hoc coverage
- no coverage measurement
testing with scripts
(e.g. JUnit)
+ auto regression testing
+ automatic execution
+/- test impl. = programming
- fragile tests break easily? (depends on abstraction)
- ad-hoc coverage
- no coverage measurement
Test Scenarios
+ abstract tests
+ automatic execution
+ auto regression testing
+ robust tests
- ad-hoc coverage
- no coverage measurement
Examples: UML Testing Profile (UTP) und Testing and Test Control
Notation (TTCN-3)
Model based testing
explore a model that mirrors the SUT to generate test cases
Model-Based Testing Pros/Cons
+ abstract tests
+ automatic execution
+ auto regression testing
+ auto design of tests
+ systematic coverage
+ measure coverage of model and requirements
- modelling efforts
MBT Workflow
- *Manual tasks:**
- (requirements analysis)
- model creation
- model validation
- concretion implementation
- *Automated tasks:**
- model verification
- test-case generation
- test-case concretion
- test-case execution
- assignement of verdicts
Automata Learning Workflow
Automated tasks:
- model creation
- model verification
- test-case generation
- test-case concretion
- test-case execution
- assignement of verdicts
Manual tasks:
- model validation
- implementation of test driver (mapper)
reactive system
a software component which reacts to
the stimuli of its environment
Do not terminate
Test cases: sequences of events
event-based
controllable events
observable events
mutation score
mutation score = #killed mutants / #mutants
mutation testing goals
find test cases that maximize mutation score
mutation testing problems
equivalent mutants
equivalence checking is hard
solutions
review of surviving mutants
generate mutants from model: model based mutation testing
conformance
if an SUT alway passes a testcase, we have conformance
the test case conforms to the SUT
if we generate such a test case from a model → test case conforms to the model
if the SUT conforms to the model: test → model → SUT
Trace equivalence is the weakest notion of conformance
mutation testing - non conformance
If the model does not conform to the SUT
and the Mutant conforms to the SUT
→ the model does not conform to the mutant
mutation testing - Fault-Detecting
Mutation generated from the model
Kills the mutant if the test case conforms to the model and not to the mutant
it is a counterexample to conformance, hence the model does not conform to the mutant