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

Towards Test-Driven Development for Mobile Robots

Embed Size (px)

DESCRIPTION

Slides of the presentation given at the ICRA 2013 workshop on Software Development and Integration in Robotics (SDIRIII) http://robotics.unibg.it/tcsoft/sdir2013/index.html

Citation preview

Page 1: Towards Test-Driven Development for Mobile Robots

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 Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

2!

Outline!

1.  Test-driven Development (TDD)!

2.  TDD for Mobile Software Robotics!

3.  BoTest!

4.  Report on an Experiment!

5.  Summary & Future Work!

Page 3: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

3!

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 !

Page 4: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

4!

Software Development!

Specifications /!Requirements!

Software!

Page 5: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

5!

Software Development!

Specifications /!Requirements!

Software!

Page 6: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

6!

Software Development!

Specifications /!Requirements!

Software!

complies with?!

Page 7: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

7!

Test-driven Development!

Specifications /!Requirements!

Software!

Page 8: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

8!

Test-driven Development!

Specifications /!Requirements!

Software!

Tests!

Page 9: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

9!

Test-driven Development!

Specifications /!Requirements!

Software!

Tests!

Page 10: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

10!

Test-driven Development!

Specifications /!Requirements!

Software!

Tests!

complies !with?!

Page 11: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

11!

Benefits of TDD!

•  Requirements as executable units: Tests!

•  Ensure Software compliance with Tests !

•  Short development cycles!

•  Detecting regressions!

•  ...!

Page 12: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

12!

TDD for Mobile Robotics "Software Development !

Control!Software!Specifications /!

Requirements!

Tests!

Page 13: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

13!

Why TDD for "Mobile Robotics Software!

Control!Software!Specifications /!

Requirements!

Tests!

Page 14: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

14!

Why TDD for "Mobile Robotics Software!

Control!Software!Specifications /!

Requirements!

Tests!

for one product line !

Page 15: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

15!

Why TDD for "Mobile Robotics Software!

Specifications /!Requirements!

Tests!

for one product line !

written once! •  Quality Assurance!•  Maintenance !

Control!Software!

Page 16: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

16!

Challenges of TDD "for Mobile Software Robotics!

•  Hardware in the loop!

•  ``identical’’ hardware in production lines!

•  Physical constraints!

•  ...!

Page 17: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

17!

Requirements "for Robot Test!

•  Repeatability!

•  Reuse!

•  Safety!

•  Automation!

Page 18: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

18!

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!

Page 19: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

19!

Example!

the robot should move straight 4m with 3% of

error !at most!Specifications /!

Requirements!

Page 20: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

20!

A Motion Test!

Test!

Page 21: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

21!

Test!

A Motion Test!

Test name!

Page 22: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

22!

Test!

A Motion Test!

Tester action requested !to setup the robot name!

Page 23: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

23!

Test!

A Motion Test!

Tested code!

Page 24: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

24!

Test!

A Motion Test!

Assertion verified! by the tester!

Page 25: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

25!

A Motion Test!

But the robot !should not hit walls !!

Page 26: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

26!

A Motion Test!

Add collision detection using Laser!

But the robot !should not hit walls !!

Page 27: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

27!

A Motion Test!

Collision detection using Laser!

Page 28: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

28!

A Motion Test!

Add required Tests !

Page 29: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

29!

A Motion Test!

Page 30: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

30!

Laser Tests!

PBLaserTest!

Page 31: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

31!

Laser Tests!

Page 32: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

32!

Laser Tests!

Page 33: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

33!

Laser Tests!

Page 34: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

34!

Laser Tests!

Page 35: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

35!

Running a Test!the robot "

should move straight 4m with

3% of error !at most!

Specifications /!Requirements!

testStraightLineMotion!

Page 36: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

36!

Running a Test!the robot "

should move straight 4m with

3% of error !at most!

Specifications /!Requirements!

testStraightLineMotion!

Page 37: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

37!

Running a Test!the robot "

should move straight 4m with

3% of error !at most!

Specifications /!Requirements!

testStraightLineMotion!

1 run, 1 passes!

Page 38: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

38!

Running a Test!the robot "

should move straight 4m with

3% of error !at most!

Specifications /!Requirements!

testStraightLineMotion!

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

Page 39: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

39!

Running a Test!the robot "

should move straight 4m with

3% of error !at most!

Specifications /!Requirements!

testStraightLineMotion!

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

Page 40: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

40!

Running a Test!

Requirements !are executed!

first!

Page 41: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

41!

Running a Test!

Page 42: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

42!

Running a Test!

1 run, 0 passes,!1 requirementFailure!

Page 43: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

43!

Summary!

Page 44: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

44!

Summary!

Page 45: Towards Test-Driven Development for Mobile Robots

http://car.mines-douai.fr May 2013, @SDIR - ICRA

45!

Future Work!

•  Automatic test dependencies extraction!

•  Improve tests automation !

•  Continuous integration for non-interactive tests!

•  Specialized development tools!

Page 46: Towards Test-Driven Development for Mobile Robots

Towards Test-Driven Development for Mobile Robots

Luc Fabresse, Jannik Laval and Noury Bouraqadi!

[email protected]

@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!