The document discusses using behavior driven development (BDD) and test driven development (TDD) to develop robot behaviors. BDD is defined as defining desired behaviors as executable examples. Examples are given of BDD scenarios for a follow me robot and comparing BDD to the rigid behavior of a wasp. The use of both BDD and TDD together is discussed where scenarios are used to define behaviors and then tests are written to implement those behaviors.
20. Write
Scenario
Watch it fail
Make It
Executable
Scenario passes
Write a
simple test
Watch it fail
Write
code
Test passes
Refactor
21. Write
Scenario
Watch it fail
Make It
Executable
Scenario passes
Write a
simple test
Watch it fail
Write
code
Test passes
Refactor
TDD
BDD
22. Write
Scenario
Watch it fail
Make It
Executable
Scenario passes
Write a
simple test
Watch it fail
Write
code
Test passes
Refactor
Unit/IntegrationTests
Executable Speci鍖cation
27. Given the wasp is stocking its nest
When a cricket is located
Then the cricket is paralyzed
And the cricket is moved toward the nest
28. Given the wasp is headed toward the nest
And the wasp is carrying a cricket
When the wasp reaches the nest entrance
Then the wasp will drop the cricket
And the wasp will inspect the nest
29. Given the wasp has inspected the nest
When the wasp exits the nest
And 鍖nds its cricket at the entrance
Then the wasp will retrieve the cricket
And store the cricket for its larvae
35. Given a family driving on a highway
And the car is approaching a rest area
When the car passes the rest area
Then the kids will need to use the restroom
39. Given the legs of a human are identi鍖ed
When the legs are to the right of center
Then rotate to the right
40. Given the legs of a human are identi鍖ed
When the legs are to the right of center
Then rotate to the right
41. Given the legs of a human are identi鍖ed
When the legs are to the right of center
Then rotate to the right
42. Given the legs of a human are identi鍖ed
When the legs are to the left of center
Then rotate to the left
43. Given the legs of a human are identi鍖ed
When the legs are to the left of center
Then rotate to the left
44. Given the legs of a human are identi鍖ed
When the legs are to the left of center
Then rotate to the left
45. Given the legs of a human are identi鍖ed
When the legs are more than 2 feet away
Then move 2 inches forward
46. Given the legs of a human are identi鍖ed
When the legs are less than 2 feet away
Then move 2 inches backwards
48. Given the legs of a human are identi鍖ed
When the legs are to the right of center
Then rotate to the right
Given the legs of a human are identi鍖ed
When the legs are to the left of center
Then rotate to the left
Given the legs of a human are identi鍖ed
When the legs are more than 2 feet away
Then move 2 inches forward
Given the legs of a human are identi鍖ed
When the legs are less than 2 feet away
Then move 2 inches backwards
50. Given the legs of a human are identi鍖ed
When follow me is activated
Then follow the human
51. Given the legs of a human are identi鍖ed
When search and destroy mode is activate
Then follow the human