towards test-driven development for mobile...

46
Towards Test-Driven Development for Mobile Robots Luc Fabresse , Jannik Laval and Noury Bouraqadi http://car.mines-douai.fr @SDIR - ICRA - May 2013

Upload: others

Post on 27-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

Towards Test-Driven Development for Mobile Robots

Luc Fabresse, Jannik Laval and Noury Bouraqadi

http://car.mines-douai.fr

@SDIR - ICRA - May 2013

Page 2: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Outline

1. Test-driven Development (TDD)

2. TDD for Mobile Software Robotics

3. BoTest

4. Report on an Experiment

5. Summary & Future Work

2

Page 3: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

CAIRE Project

• Coodinator: Luc Fabresse

• Partners: INRIA Lille RMoD, IEMN Telice

• 2012-2014

• Nord-Pas de Calais Council funding (France)

• Indoor Exploration and Mapping

• Agile methodology for Robotic Software

3

Page 4: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Software Development

4

Specifications /Requirements

Software

Page 5: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Software Development

5

Specifications /Requirements

Software

Page 6: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Software Development

6

Specifications /Requirements

Software

complies with?

Page 7: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test-driven Development

7

Specifications /Requirements

Software

Page 8: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test-driven Development

8

Specifications /Requirements

Software

Tests

Page 9: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test-driven Development

9

Specifications /Requirements

Software

Tests

Page 10: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test-driven Development

10

Specifications /Requirements

Software

Tests

complies with?

Page 11: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Benefits of TDD

• Requirements as executable units: Tests

• Ensure Software compliance with Tests

• Short development cycles

• Detecting regressions

• ...

11

Page 12: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

TDD for Mobile Robotics Software Development

12

ControlSoftwareSpecifications /

Requirements

Tests

Page 13: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Why TDD for Mobile Robotics Software

13

ControlSoftwareSpecifications /

Requirements

Tests

Page 14: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Why TDD for Mobile Robotics Software

14

ControlSoftwareSpecifications /

Requirements

Tests

for one product line

Page 15: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Why TDD for Mobile Robotics Software

15

Specifications /Requirements

Tests

for one product line

written once • Quality Assurance• Maintenance

ControlSoftware

Page 16: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Challenges of TDD for Mobile Software Robotics

• Hardware in the loop

• ``identical’’ hardware in production lines

• Physical constraints

• ...

16

Page 17: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Requirements for Robot Test

• Repeatability

• Reuse

• Safety

• Automation

17

Page 18: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Tool for Robotics TDD

•BoTest (http://car.mines-douai.fr/software/)

• Implemented in as an extension of SUnit(http://www.pharo-project.org)

• Helps to write tests for robots

• Support expressing dependencies between tests

• Run tests in a specific order

18

Page 19: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Example

19

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

Page 20: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

20

Test

Page 21: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test

A Motion Test

21

Test name

Page 22: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test

A Motion Test

22

Tester action requested to setup the robot name

Page 23: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test

A Motion Test

23

Tested code

Page 24: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Test

A Motion Test

24

Assertion verified by the tester

Page 25: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

25

But the robot should not hit walls !

Page 26: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

26

Add collision detection using Laser

But the robot should not hit walls !

Page 27: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

27

Collision detection using Laser

Page 28: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

28

Add required Tests

Page 29: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

A Motion Test

29

Page 30: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Laser Tests

30

PBLaserTest

Page 31: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Laser Tests

31

Page 32: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Laser Tests

32

Page 33: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Laser Tests

33

Page 34: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Laser Tests

34

Page 35: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

35

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

testStraightLineMotion ...

Page 36: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

36

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

testStraightLineMotion ...

Page 37: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

37

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

testStraightLineMotion ...

1 run, 1 passes

Page 38: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

38

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

testStraightLineMotion ...

1 run, 1 passes 1 run, 0 passes,1 requirementFailure

Page 39: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

39

the robot should move

straight 4m with 3% of error

at mostSpecifications /Requirements

testStraightLineMotion ...

1 run, 1 passes 1 run, 0 passes,1 requirementFailure

Page 40: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

40

Requirements are executed

first

Page 41: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

41

Page 42: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Running a Test

42

1 run, 0 passes,1 requirementFailure

Page 43: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Summary

43

Robotics Software development would benefit from TDD

Tool support is needed

Page 44: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Summary

43

BoTest

Write repeatable and reusable tests

Testers in the loop

Support expressing dependencies between tests

Run tests based on dependencies

Page 45: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B

Future Work

• Automatic test dependencies extraction

• Improve tests automation

• Continuous integration for non-interactive tests

• Specialized development tools

44

Page 46: Towards Test-Driven Development for Mobile Robotsrobotics.unibg.it/tcsoft/sdir2013/slides/fabresse.pdf · !""#$%%&'()*+,-./012'+)3( 4'56789:;6?@6/6?A@B Outline 1. Test-driven

Towards Test-Driven Development for Mobile Robots

Luc Fabresse, Jannik Laval and Noury Bouraqadi

!"#$%&'()*&#$%&'(+',-(#./01&,)2"

@SDIR - ICRA - May 2013

Looking for a 18 months PostDoc

http://car.mines-douai.fr/2013/03/postdoc-position/More infos:

Keywords: Robotics Software, Agile development, Dynamic Languages, ...

Starting: ~Sept 2013