intelligent testing · robotic assistants need to be both powerful and smart. –ai and learning...

41
Kerstin Eder Design Automation and Verification, Microelectronics [and Trustworthy Systems Laboratory] Verification and Validation for Safety in Robots, Bristol Robotics Laboratory Intelligent Testing: Introducing Agency into the Test Environment

Upload: others

Post on 11-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Kerstin Eder

Design Automation and Verification, Microelectronics

[and Trustworthy Systems Laboratory]

Verification and Validation for Safety in Robots, Bristol Robotics Laboratory

Intelligent Testing: Introducing Agency

into the Test Environment

Page 2: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

HRI Verification Challenges

System complexity

– HW

– SW

– People

Concurrency

Experiments in labs

– Expensive

– Unsafe

2

Page 3: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Testing in simulation

Techniques well

established in

microelectronics

design verification

– Coverage-Driven

Verification

3

… to verify code that

controls robots in HRI.

We are investigating…

Page 4: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Robotic assistants need to be both powerful

and smart.

– AI and learning are increasingly used in robotics

We need intelligent testing.

– No matter how clever your robot, the testing

environment needs to reflect the agency your

robot will meet in its target environment.

4

Agency for Intelligent Testing

Page 5: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

CDV to automate

simulation-based testing

Dejanira Araiza-Illan, David Western, Anthony Pipe and Kerstin Eder.

Coverage-Driven Verification — An Approach to Verify Code for Robots that Directly Interact

with Humans. In Hardware and Software: Verification and Testing, pp. 69-84. Lecture Notes in

Computer Science 9434. Springer, November 2015. (DOI 10.1007/978-3-319-26287-1_5)

Dejanira Araiza-Illan, David Western, Anthony Pipe and Kerstin Eder.

Systematic and Realistic Testing in Simulation of Control Code for Robots in Collaborative

Human-Robot Interactions. 17th Annual Conference Towards Autonomous Robotic Systems (TAROS

2016), pp. 20-32. Lecture Notes in Artificial Intelligence 9716. Springer, June 2016.

(DOI 10.1007/978-3-319-40379-3_3)

Page 6: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage-Driven Verification

6

SUT Test

Response

Page 7: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage-Driven Verification

7

SUT Test Test

Generator

Response

Page 8: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Tests must be effective and efficient

Strategies: - Pseudorandom (repeatability)

- Constrained pseudorandom

- Model-based to target specific scenarios

Test Generator

8

Page 9: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Model-based Test Generation

9

Page 10: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Model-based Test Generation

10

Page 11: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Formal

model

Traces from

model

checking

Test template Test components:

- High-level actions

- Parameter instantiation

System +

environment Environment to

drive system

Model-based test generation

11

Page 12: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage-Driven Verification

12

SUT Test Test

Generator

Checker

Response

Page 13: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Checker

Requirements as assertion monitors: - if [precondition], check [postcondition]

“If the robot decides the human is not ready,

then the robot never releases an object”.

- Implemented as automata

Continuous monitoring at runtime, self-checking

– High-level requirements

– Lower-level requirements depending on the

simulation's detail (e.g., path planning, collision

avoidance).

assert {! (robot_3D_position == human_3D_position)}

13

Page 14: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage-Driven Verification

14

SUT Test Test

Generator

Checker

Coverage

Collector

Response

Page 15: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage Models

15

Code coverage

Structural coverage

Functional coverage Requirements coverage

Functional and safety (ISO 13482:2014, ISO 10218-1)

Page 16: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Requirements based on

ISO 13482 and ISO 10218

16

Page 17: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Requirements based on

ISO 13482 and ISO 10218

17

Page 18: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Coverage Models

Code coverage

Structural coverage

Functional coverage Requirements coverage

Functional and safety (ISO 13482:2014, ISO 10218-1)

Cross-product functional coverage

Page 19: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Functional Coverage Results

100 pseudorandomly

generated tests

160 model-based tests

180 model-based

constrained tests

440 tests in total

Page 20: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

CDV for Human-Robot Interaction

Dejanira Araiza-Illan, David Western, Anthony Pipe and Kerstin Eder.

Systematic and Realistic Testing in Simulation of Control Code for Robots in Collaborative Human-Robot

Interactions. 17th Annual Conference Towards Autonomous Robotic Systems (TAROS 2016), pp. 20-32. Lecture Notes in

Computer Science 9716. Springer, June 2016. DOI 10.1007/978-3-319-40379-3_3

Page 21: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

systematic, goal directed verification method

– high level of automation

– capable of exploring systems of realistic detail under

a broad range of environment conditions

focus on test generation and coverage

– constraining test generation requires significant

engineering skill and SUT knowledge

Coverage-Directed Verification

– model-based test generation

allows targeting requirements and

cross-product coverage more

effectively than pseudorandom

test generation

Page 22: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

http://github.com/robosafe/testbench

22

Dejanira Araiza-Illan, David Western, Anthony Pipe and Kerstin Eder.

Coverage-Driven Verification — An Approach to Verify Code for Robots that

Directly Interact with Humans. In Hardware and Software: Verification and Testing, pp.

69-84. Lecture Notes in Computer Science 9434. Springer, November 2015.

(DOI: 10.1007/978-3-319-26287-1_5)

Dejanira Araiza-Illan, David Western, Anthony Pipe and Kerstin Eder.

Systematic and Realistic Testing in Simulation of Control Code for Robots in

Collaborative Human-Robot Interactions. 17th Annual Conference Towards

Autonomous Robotic Systems (TAROS 2016), pp. 20-32. Lecture Notes in Computer

Science 9716. Springer, June 2016. (DOI: 10.1007/978-3-319-40379-3_3)

Page 23: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

CDV provides automation

23 What about agency?

Page 24: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

http://www.thedroneinfo.com/

Page 25: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Belief-Desire-Intention Agents

25

Desires:

goals to

fulfil

Beliefs:

knowledge

about the world Intentions: chosen

plans, according to

current beliefs and

goals

Guards for plans

New goals

New beliefs

From executing plans

Page 26: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

CDV testbench components

Intelligent testing is harnessing the power of BDI agent

models to introduce agency into test environments. 26

BDI Agents

Page 27: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Research Questions

Are Belief-Desire-Intention agents

suitable to model HRI?

How can we exploit BDI agent

models for test generation?

Can machine learning be used to

automate test generation in this

setting?

How do BDI agent models

compare to automata-based

27

techniques for model-based test generation?

Page 28: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Interacting Agents

BDI can model agency in HRI

– Interactions between agents create realistic

action sequences that serve as test patterns

28

Robot’s Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

Page 29: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Interacting Agents

29

Robot’s Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

BDI can model agency in HRI

– Interactions between agents create realistic

action sequences that serve as test patterns

Page 30: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Verification Agents

Meta agents can influence beliefs

This allows biasing/directing the interactions

30

Robot’s

Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

(Meta Agent)

Verification

Agent

beliefs

beliefs

beliefs

Page 31: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Which beliefs are effective?

31

Robot’s

Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

(Meta Agent)

Verification

Agent

beliefs

beliefs

beliefs

Manual belief selection belief subsets

Page 32: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Which beliefs are effective?

32

Robot’s

Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

(Meta Agent)

Verification

Agent

beliefs

beliefs

beliefs

Manual belief selection

Random belief selection belief subsets

Page 33: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Which beliefs are effective?

33

Robot’s

Code

Agent

Agent for

Simulated

Human

Agents for

Simulated

Sensors

beliefs

beliefs

beliefs

(Meta Agent)

Verification

Agent

beliefs

beliefs

beliefs

Optimal belief sets

determined through RL

plan

coverage

belief subsets

Page 34: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Results How effective are BDI agents for test generation?

How do they compare to model checking timed automata?

40

50

60

70

80

90

100

Co

de

co

ve

rag

e (

%)

20 40 60 80 100 120 140 160

Test number

40

50

60

70

80

90

100

Accu

mu

late

d c

od

e c

ove

rag

e (

%)

Pseudorandom

Model checking TA

BDI agents

D. Araiza-Illan, A.G. Pipe, K. Eder. Intelligent Agent-Based Stimulation for Testing

Robotic Software in Human-Robot Interactions. (Proceedings of MORSE 2016, ACM,

July 2016) DOI: 10.1145/3022099.3022101 (arXiv:1604.05508)

D. Araiza-Illan, A.G. Pipe, K. Eder

Model-based Test Generation for Robotic Software: Automata versus Belief-Desire-

Intention Agents. (under review, preprint available at arXiv:1609.08439)

Page 35: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

The cost of learning belief sets

35

The cost of learning a good belief set needs to be

considered when assessing the different BDI-based

test generation approaches.

Convergence in <300

iterations, < 3 hours

Page 36: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

BDI-agents vs timed automata

36

Effectiveness:

high-coverage tests are generated quickly

Page 37: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

37

BDI-agents vs timed automata

Page 38: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

BDI-agents vs timed automata

38

Page 39: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

Back to our Research Questions

Belief-Desire-Intention agents are suitable to model HRI

Traces of interactions between BDI agent models

provide test templates

Machine learning (RL) can be used to automate the

selection of belief sets so that test generation can be

biased towards maximizing coverage

Compared to traditional model-based test generation

(model checking timed automata), BDI models are:

more intuitive to write, they naturally express agency,

smaller in terms of model size,

more predictable to explore and

equal if not better wrt coverage.

39

Page 40: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

http://github.com/robosafe

D. Araiza Illan, D. Western, A. Pipe, K. Eder.

Coverage-Driven Verification - An approach to verify code for robots that

directly interact with humans. (Proceedings of HVC 2015, Springer, November 2015)

D. Araiza Illan, D. Western, A. Pipe, K. Eder.

Systematic and Realistic Testing in Simulation of Control Code for Robots in

Collaborative Human-Robot Interactions.

(Proceedings of TAROS 2016, Springer, June 2016)

D. Araiza-Illan, A.G. Pipe, K. Eder.

Intelligent Agent-Based Stimulation for Testing Robotic Software in Human-Robot

Interactions. (Proceedings of MORSE 2016, ACM, July 2016)

DOI: 10.1145/3022099.3022101 (arXiv:1604.05508)

D. Araiza-Illan, A.G. Pipe, K. Eder

Model-based Test Generation for Robotic Software: Automata versus Belief-Desire-

Intention Agents. (under review, preprint available at arXiv:1609.08439) 40

Page 41: Intelligent Testing · Robotic assistants need to be both powerful and smart. –AI and learning are increasingly used in robotics We need intelligent testing. –No matter how clever

[email protected]

Thank you

Special thanks to Dejanira Araiza Illan, Jeremy Morse, David Western, Arthur Richards, Jonathan Lawry,

Trevor Martin, Piotr Trojanek, Yoav Hollander, Yaron Kashai, Mike Bartley, Tony Pipe and Chris Melhuish for

their collaboration, contributions, inspiration and the many productive discussions we have had.