Institute of Software Technology tugraz Time to Learn – Learning Timed Automata from Tests Bernhard K. Aichernig Kim Guldstrand Larsen Martin Tappler Florian Lorber Institute of Software Technology, Graz University of Technology, Austria Department of Computer Science, Aalborg University August 28 th , 2019 Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 1 / 15
Institute of Software Technology tugraz Learning a Car Alarm System open armed close Car Alarm sound lock System flash unlock Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 2 / 15
Institute of Software Technology tugraz Learning a Car Alarm System open armed close Car Alarm sound lock System flash unlock lock?,4 . 1 close?,15 . 4 armed!,17 . 4 lock?,3 . 2 close?,13 . 7 unlock?,14 . 1 open?,23 . 1 close?,2 . 9 lock?,16 . 2 armed!,18 . 2 open?,29 . 5 flash!,29 . 5 close?,0 . 7 lock?,5 . 4 armed!,7 . 4 unlock?,21 . 5 off!,21 . 5 Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 2 / 15
Institute of Software Technology tugraz Learning a Car Alarm System open armed close Car Alarm sound lock System flash unlock lock?,4 . 1 close?,15 . 4 armed!,17 . 4 lock?,3 . 2 close?,13 . 7 unlock?,14 . 1 open?,23 . 1 close?,2 . 9 lock?,16 . 2 armed!,18 . 2 open?,29 . 5 flash!,29 . 5 close?,0 . 7 lock?,5 . 4 armed!,7 . 4 unlock?,21 . 5 off!,21 . 5 Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 2 / 15
Institute of Software Technology tugraz Learning a Car Alarm System open armed close Car Alarm sound lock System flash unlock lock?,4 . 1 close?,15 . 4 armed!,17 . 4 lock?,3 . 2 close?,13 . 7 unlock?,14 . 1 open?,23 . 1 close?,2 . 9 lock?,16 . 2 armed!,18 . 2 open?,29 . 5 flash!,29 . 5 close?,0 . 7 lock?,5 . 4 armed!,7 . 4 unlock?,21 . 5 off!,21 . 5 Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 2 / 15
Institute of Software Technology tugraz Learning a Car Alarm System open armed close sound lock flash unlock Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 2 / 15
Institute of Software Technology tugraz Motivation – Learning-Based Verification out SUT ( Ping ) = Test Cases out SUT ( Con ) = System out SUT ( Con · Ping ) = Under Test Driver Learning Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 3 / 15
Institute of Software Technology tugraz Motivation – Learning-Based Verification out SUT ( Ping ) = ConC Test Cases out SUT ( Con ) = ConAck execute System tests out SUT ( Con · Ping ) = ConAck · Pong Under Test Driver Learning Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 3 / 15
Institute of Software Technology tugraz Motivation – Learning-Based Verification Learner out SUT ( Ping ) = ConC Test Cases out SUT ( Con ) = ConAck execute System tests out SUT ( Con · Ping ) = ConAck · Pong Under Test Driver Learning Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 3 / 15
Institute of Software Technology tugraz Motivation – Learning-Based Verification Ping / ConnectionClosed Ping / Pong Connect / ConnAck q 0 q 1 Model start learn consistent Connect / ConnectionClosed out M ( Ping ) = ConC Learner out SUT ( Ping ) = ConC out M ( Con ) = ConAck Test Cases out SUT ( Con ) = ConAck out M ( Con · Ping ) = ConAck · Pong execute System tests out SUT ( Con · Ping ) = ConAck · Pong Under Test Driver Learning Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 3 / 15
Institute of Software Technology tugraz Motivation – Learning-Based Verification Ping / ConnectionClosed Ping / Pong Connect / ConnAck q 0 q 1 Model start Verify learn consistent Connect / ConnectionClosed out M ( Ping ) = ConC Learner out SUT ( Ping ) = ConC out M ( Con ) = ConAck Test Cases out SUT ( Con ) = ConAck out M ( Con · Ping ) = ConAck · Pong execute System tests out SUT ( Con · Ping ) = ConAck · Pong Under Test Driver Learning Verification ◮ Model checking [Fiterau-Brostean et al., 2016], comparison of models [Aarts et al., 2012, Tappler et al., 2017] ◮ Issue: “we had to eliminate timing based behavior as well as re-transmissions” [Fiterau-Brostean et al., 2016] Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 3 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 ◮ extended with real-valued clocks ◮ used in guards ◮ reset upon transitions ◮ constraints limiting sojourn time q 4 q 1 q 2 ◮ Assumptions for testing [Hessel et al., 2003]: ◮ output urgent: outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 touch! ◮ extended with real-valued clocks endhold! ◮ used in guards press? release? ◮ reset upon transitions ◮ constraints limiting sojourn time q 4 q 1 q 2 release? ◮ Assumptions for testing [Hessel et al., 2003]: release? starthold! ◮ output urgent: outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 touch! ◮ extended with real-valued clocks endhold! ◮ used in guards press? release? { c } ◮ reset upon transitions c < 5 ◮ constraints limiting sojourn time q 4 q 1 q 2 release? ◮ Assumptions for c ≥ 5 testing [Hessel et al., 2003]: release? starthold! ◮ output urgent: c ≥ 10 outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 touch! ◮ extended with real-valued clocks endhold! ◮ used in guards press? release? { c } ◮ reset upon transitions c < 5 ◮ constraints limiting sojourn time q 4 q 1 q 2 release? ◮ Assumptions for c ≥ 5 testing [Hessel et al., 2003]: release? starthold! ◮ output urgent: c ≥ 10 outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 touch! ◮ extended with real-valued clocks endhold! ◮ used in guards press? release? { c } ◮ reset upon transitions c < 5 ◮ constraints limiting sojourn time q 4 q 1 q 2 release? ◮ Assumptions for c ≥ 5 testing [Hessel et al., 2003]: release? starthold! ◮ output urgent: c ≥ 10 outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Timed Automata ◮ Finite automata . . . start ◮ with inputs and outputs q 0 touch! ◮ extended with real-valued clocks endhold! ◮ used in guards press? release? { c } ◮ reset upon transitions c < 5 ◮ constraints limiting sojourn time q 4 q 1 q 2 release? ◮ Assumptions for c ≥ 5 testing [Hessel et al., 2003]: release? starthold! ◮ output urgent: c ≥ 10 outputs fire as soon as possible q 3 ◮ input enabled: A Lamp Touch Sensor inputs must be accepted ◮ deterministic release?,1 . 1 press?,2 . 3 release?,8 . 9 touch!,8 . 9 Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 4 / 15
Institute of Software Technology tugraz Automata Learning for Timed Systems ◮ Motivation: Model-based analysis for black-box timed systems ◮ Existing approaches: ◮ Passive learning of real-time automata [Verwer et al., 2010, Verwer et al., 2012]: → does not distinguish inputs and outputs ◮ Active learning of event-recording automata [Grinchtein et al., 2010, Grinchtein et al., 2006] → high runtime complexity ◮ Both: restrictions on clock resets ◮ Promising results of genetic programming in program synthesis (e.g. mutual exclusion algorithms) [Katz and Peled, 2017] ◮ Apply genetic programing for timed automata ◮ Focus: generate models for testing ◮ input-enabled, arbitrary clock resets Martin Tappler FORMATS 2019 Time to Learn – Learning Timed Automata from Tests 5 / 15
Recommend
More recommend