towards test-driven development for mobile...
TRANSCRIPT
Towards Test-Driven Development for Mobile Robots
Luc Fabresse, Jannik Laval and Noury Bouraqadi
http://car.mines-douai.fr
@SDIR - ICRA - May 2013
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Software Development
4
Specifications /Requirements
Software
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Software Development
5
Specifications /Requirements
Software
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Software Development
6
Specifications /Requirements
Software
complies with?
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test-driven Development
7
Specifications /Requirements
Software
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test-driven Development
8
Specifications /Requirements
Software
Tests
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test-driven Development
9
Specifications /Requirements
Software
Tests
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test-driven Development
10
Specifications /Requirements
Software
Tests
complies with?
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
TDD for Mobile Robotics Software Development
12
ControlSoftwareSpecifications /
Requirements
Tests
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Why TDD for Mobile Robotics Software
13
ControlSoftwareSpecifications /
Requirements
Tests
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Why TDD for Mobile Robotics Software
14
ControlSoftwareSpecifications /
Requirements
Tests
for one product line
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Requirements for Robot Test
• Repeatability
• Reuse
• Safety
• Automation
17
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Example
19
the robot should move
straight 4m with 3% of error
at mostSpecifications /Requirements
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
A Motion Test
20
Test
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test
A Motion Test
21
Test name
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test
A Motion Test
22
Tester action requested to setup the robot name
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test
A Motion Test
23
Tested code
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Test
A Motion Test
24
Assertion verified by the tester
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
A Motion Test
25
But the robot should not hit walls !
!""#$%%&'()*+,-./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 !
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
A Motion Test
27
Collision detection using Laser
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
A Motion Test
28
Add required Tests
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
A Motion Test
29
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Laser Tests
30
PBLaserTest
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Laser Tests
31
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Laser Tests
32
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Laser Tests
33
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Laser Tests
34
!""#$%%&'()*+,-./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 ...
!""#$%%&'()*+,-./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 ...
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Running a Test
40
Requirements are executed
first
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Running a Test
41
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Running a Test
42
1 run, 0 passes,1 requirementFailure
!""#$%%&'()*+,-./012'+)3( 4'56789:;6<=>?@6/6?A@B
Summary
43
Robotics Software development would benefit from TDD
Tool support is needed
!""#$%%&'()*+,-./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
!""#$%%&'()*+,-./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
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