model-based testing - a (very) brief introduction · institute for software technology mbtworkflow...
TRANSCRIPT
tugrazInstitute for Software Technology
Model-Based TestingA (Very) Brief Introduction
Bernhard K. Aichernig
Graz University of Technology, Austria
Summer Term 2019
B.K. Aichernig Model-Based Testing1 / 17
tugrazInstitute for Software Technology
Objective
"Don’t write test cases,
generate them!"
(John Hughes)
B.K. Aichernig Model-Based Testing2 / 17
tugrazInstitute for Software Technology
Definition
Model-based testing (MBT) isI the automatic generation of software test procedures,I using models of system requirements and behaviorI in combination with automated test execution.
B.K. Aichernig Model-Based Testing3 / 17
tugrazInstitute for Software Technology
Levels of Testing: Manual
!"#$
%&''$$(&)*$
B.K. Aichernig Model-Based Testing4 / 17
tugrazInstitute for Software Technology
Levels of Testing: Manual
+ easy & cheap to start
+ flexible testing
− expensive every execution
− no auto regression testing
− ad-hoc coverage
− no coverage measurement
B.K. Aichernig Model-Based Testing5 / 17
tugrazInstitute for Software Technology
Levels of Testing: Capture & Replay
B.K. Aichernig Model-Based Testing6 / 17
tugrazInstitute for Software Technology
Levels of Testing: Capture & Replay
+ auto regression testing
+ flexible testing
− expensive first execution
− fragile tests break easily
− ad-hoc coverage
− no coverage measurement
B.K. Aichernig Model-Based Testing7 / 17
tugrazInstitute for Software Technology
Levels of Testing: Scripts
!"#$+,'+$
,-,./012$
+,'+$.&','$
%&''$$(&)*$
B.K. Aichernig Model-Based Testing8 / 17
tugrazInstitute for Software Technology
Levels of Testing: Scripts
+ auto regression testing
+ automatic execution
+/− test impl. = programming
− fragile tests break easily?(depends on abstraction)
− ad-hoc coverage
− no coverage measurement
Example: JUnit
B.K. Aichernig Model-Based Testing9 / 17
tugrazInstitute for Software Technology
Levels of Testing: Test Scenarios
!"#$+,'+$
,-,./012$
%&''$$(&)*$
3)435*,6,*$+,'+$
21+&012$
B.K. Aichernig Model-Based Testing10 / 17
tugrazInstitute for Software Technology
Levels of Testing: 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 ControlNotation (TTCN-3)
B.K. Aichernig Model-Based Testing11 / 17
tugrazInstitute for Software Technology
Levels of Testing: Model-Based Testing
!"#$+,'+$
,-,./012$
%&''$$(&)*$
+,'+$.&',$4,2,7&012$
'8'+,9$91:,*$
B.K. Aichernig Model-Based Testing12 / 17
tugrazInstitute for Software Technology
Levels of Testing: Model-Based Testing
!"#$/'%/$
'3'(4,-.$
+22$/'%/%$&+%%$$$
/'%/$(+%'$6'.'0+,-.$
%9%/':$:-;'2$
(-.1-0:+.('$
B.K. Aichernig Model-Based Testing13 / 17
tugrazInstitute for Software Technology
Levels of Testing: Model-Based Testing
+ abstract tests
+ automatic execution
+ auto regression testing
+ auto design of tests
+ systematic coverage
+ measure coverage of model and requirements
− modelling efforts
B.K. Aichernig Model-Based Testing14 / 17
tugrazInstitute for Software Technology
MBT Workflow
model
SUT(blackbox)
requirements
1) model creation & validation
abstracttest case
test casespecification
2) test case generation
concretetest case
3) concretion
test result
4) test case execution & assignment of verdicts
5) analysis
Manual tasks:
I (requirements analysis)
I model creation
I model validation
I concretion implementation
Automated tasks:
I model verification
I test-case generation
I test-case concretion
I test-case execution
I assignement of verdicts
B.K. Aichernig Model-Based Testing15 / 17
tugrazInstitute for Software Technology
Taxonomy [Utting et al. 2012]
random generation
model-checking
constraint solving
offline
fault-based
random and stochastic
pre-post or input domains
transition-based
discrete/hybrid/continuous
untimed/timed
input-only/input-output
modelspecification
testgeneration
testexecution
scope
characteristics
paradigm
test selectioncriteria
technology
online/offline
deterministic/non-deterministic
history-based
functional
operational
stochastic
data flow
structural model coverage
data coverage
requirements coverage
test case specifications
search-based algorithms
symbolic execution
theorem proving
online
MBT
B.K. Aichernig Model-Based Testing16 / 17
tugrazInstitute for Software Technology
Literature
I Mark Utting, Alexander Pretschner and Bruno Legeard, Ataxonomy of model-based testing approaches: Software Testing,Verification and Reliability, 22(5):297–312, Wiley, 2012.
Read it!
B.K. Aichernig Model-Based Testing17 / 17