際際滷

際際滷Share a Scribd company logo
Behavior Driven Development
with Robots
Mark Shead
mark.shead@xeric.net
http://book.markshead.com
 Turn Up Brightness to 100%
 http://ozoblockly.com
 Test
Test Driven Development
TDD Process
What is the smallest piece of
functionality that would be closer to
a working system?
How could we test that this
functionality exists?
Write a 
simple test
Watch it fail
Write codeTest passes
Refactor
AgileMidwest2018-Shead-BddWithRobots
AgileMidwest2018-Shead-BddWithRobots
Behavior Driven Development
(Cucumber)
 De鍖ne desired behavior as an example
 Make example executable
 See that examples fail
 Use TDD to make those examples pass
Developer language
Business owner language
Developer language
Business owner language
Gerkin
Language
Given I am not an admin user
When I login to the system
Then I cannot see the admin menu
Given I am an admin user
When I login to the system
Then I can see the admin menu
Write 
Scenario
Watch it fail
Make It 
Executable
Scenario passes
Write the code
BDD with TDD
Write a 
simple test
Watch it fail
Write codeTest passes
Refactor
TDD
Write 
Scenario
Watch it fail
Make It 
Executable
Scenario passes
Write the code
BDD
Write 
Scenario
Watch it fail
Make It 
Executable
Scenario passes
Write a 
simple test
Watch it fail
Write 
code
Test passes
Refactor
Write 
Scenario
Watch it fail
Make It 
Executable
Scenario passes
Write a 
simple test
Watch it fail
Write 
code
Test passes
Refactor
TDD
BDD
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
AgileMidwest2018-Shead-BddWithRobots
Pencil vs. Chisel
Sphex Wasp Behavior
AgileMidwest2018-Shead-BddWithRobots
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
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
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
AgileMidwest2018-Shead-BddWithRobots
Wasp Video
https://www.youtube.com/watch?v=YNvi_j2z96w
Retrospective
Problem: Someone keeps moving the cricket
Problem: Someone keeps moving the cricket
Solution: Sting the human
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
Follow Me Robot
Follow Me Robot
aka: Baby Duck Mode
Follow Me Robot
aka: Baby Duck Mode
aka: Terrify Your Kids Robot
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 right of center
Then rotate to the right
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 to the left of center
Then rotate to the left
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
AgileMidwest2018-Shead-BddWithRobots
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
AgileMidwest2018-Shead-BddWithRobots
Given the legs of a human are identi鍖ed
When follow me is activated
Then follow the human
Given the legs of a human are identi鍖ed
When search and destroy mode is activate
Then follow the human
Your Brain
Given it is near lunch time
When the speaker keeps talking
Then discard 85% of what he says
AgileMidwest2018-Shead-BddWithRobots

More Related Content

AgileMidwest2018-Shead-BddWithRobots