0
Don’t you trust me?
Seb Rose
@sebrose
www.claysnow.co.uk
Business Driven
Development
Beard Driven
Development
Behaviour Driven
Development
What’s
the difference
between TDD,
ATDD, BDD
and SbE?

They’re
called
different
things
http://lizkeogh.com/2011/06/27/atdd...
Easy transport of groceries
In order to get groceries home easily
Matt & Anna want
a way to transport them
Scenario: A month of groceries
Given I have opened the trunk
When I load a month of groceries
Then the suspension will cop...
Scenario: A month of groceries
Given I have opened the trunk
When I load a month of groceries
Then the suspension will cop...
Scenario: A year of groceries
Given I have opened the trunk
When I load a year of groceries
Then the suspension will cope
...
Given I have opened the trunk

@Given(“^I have opened the trunk$”)
public void i_have_opened_the_trunk() {
myCar.openTrunk...
So, what exactly IS the problem?
Feature: GPS usage
Scenario: Start navigation to new destination
Given I enter a new destination
When I start navigation
T...
@Given("I enter a new destination")
public void I_enter_a_new_destination() {
// Do whatever it takes to enter new destina...
•

What if there is no GPS signal?

•

What if the destination provided is unknown?

•

How will errors be communicated to...
Scenario: No GPS signal
Given I enter a new destination
And it there is no GPS signal
When I start navigation
Then I shoul...
Scenario Outline: Display correct error message
When the navigation component returns an <error>
Then the correct <message...
Scenario: No GPS signal
Given I enter a new destination
And it there is no GPS signal
When I start navigation
Then I shoul...
Scenario: No GPS signal
Given I enter a new destination
And it there is no GPS signal
When I start navigation
Then I shoul...
@without_ui
Scenario: No GPS signal
Given I enter a new destination
And it there is no GPS signal
When I start navigation
...
private boolean without_ui = false;
@Before("@without_ui")
public void beforeScenario() {
without_ui = true;
}
@Given("^I enter a new destination$")
public void I_enter_a_new_destination() {
if (without_ui){
// Call navigation compon...
Service manual

•Exercise full application stack to
build trust

•Reduce thickness as trust grows
•A few end-to-end scenar...
Please evaluate my presentation at:
www.touchmyconference.com/ATD2013

Seb	
  Rose
Twi$er:	
  	
   @sebrose
Blog:	
  	
   ...
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Don't you trust me?
Upcoming SlideShare
Loading in...5
×

Don't you trust me?

782

Published on

In many organisations there’s a tension between the desires of the three amigos:

- business stakeholders can’t validate assumptions unless they’re written in business domain terms
- testers would ideally test everything end to end (vertically)
- developers respond that the testing pyramid encourages us to have more unit tests than integration or end-to-end tests

It is often recommended that some tests that start off as scenarios get pushed ‘down’ into unit tests to keep the execution time under control and constrain the maintenance burden of the feature suite. The trouble with this is that even if the business folk and the testers trusted the developer’s unit tests implicitly (which they often don’t) there’s still the issue of visibility. We no longer have one complete, generally consumable, source living documentation.

An approach that I have been experimenting with uses Cucumber’s tagged hooks to control the amount of application stack that a scenario exercises. This lets us tailor our execution context depending on the runtime of the feature suite and the amount of trust the team has to spare. In the limit, this allows us (where it makes sense) to expose some unit tests as scenarios – keeping our living documentation complete.

The cost, of course, is added complexity.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
782
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Don't you trust me?"

  1. 1. Don’t you trust me? Seb Rose @sebrose www.claysnow.co.uk
  2. 2. Business Driven Development
  3. 3. Beard Driven Development
  4. 4. Behaviour Driven Development
  5. 5. What’s the difference between TDD, ATDD, BDD and SbE? They’re called different things http://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-potted-history-of-some-related-stuff/
  6. 6. Easy transport of groceries In order to get groceries home easily Matt & Anna want a way to transport them
  7. 7. Scenario: A month of groceries Given I have opened the trunk When I load a month of groceries Then the suspension will cope
  8. 8. Scenario: A month of groceries Given I have opened the trunk When I load a month of groceries Then the suspension will cope
  9. 9. Scenario: A year of groceries Given I have opened the trunk When I load a year of groceries Then the suspension will cope expected: "Within tolerance", got: "OVERLOADED"
  10. 10. Given I have opened the trunk @Given(“^I have opened the trunk$”) public void i_have_opened_the_trunk() { myCar.openTrunk(); }
  11. 11. So, what exactly IS the problem?
  12. 12. Feature: GPS usage Scenario: Start navigation to new destination Given I enter a new destination When I start navigation Then I should be given first direction
  13. 13. @Given("I enter a new destination") public void I_enter_a_new_destination() { // Do whatever it takes to enter new destination }
  14. 14. • What if there is no GPS signal? • What if the destination provided is unknown? • How will errors be communicated to the user?
  15. 15. Scenario: No GPS signal Given I enter a new destination And it there is no GPS signal When I start navigation Then I should see the correct error message Scenario: Unknown destination Given I enter a new destination And the destination is unknown When I start navigation Then I should see the correct error message
  16. 16. Scenario Outline: Display correct error message When the navigation component returns an <error> Then the correct <message> should be returned Examples: | error | message | no-gps-signal | "No GPS signal" | unknown-destination | "Unknown destination" | | |
  17. 17. Scenario: No GPS signal Given I enter a new destination And it there is no GPS signal When I start navigation Then I should see the no-gps-signal message Scenario: Unknown destination Given I enter a new destination And the destination is unknown When I start navigation Then I should see the unknown-destination message
  18. 18. Scenario: No GPS signal Given I enter a new destination And it there is no GPS signal When I start navigation Then I should see “No GPS signal” Scenario: Unknown destination Given I enter a new destination And the destination is unknown When I start navigation Then I should see “Unknown destination”
  19. 19. @without_ui Scenario: No GPS signal Given I enter a new destination And it there is no GPS signal When I start navigation Then I should see “No GPS signal”
  20. 20. private boolean without_ui = false; @Before("@without_ui") public void beforeScenario() { without_ui = true; }
  21. 21. @Given("^I enter a new destination$") public void I_enter_a_new_destination() { if (without_ui){ // Call navigation component directly } else { // Drive UI directly using Selenium or similar. } }
  22. 22. Service manual •Exercise full application stack to build trust •Reduce thickness as trust grows •A few end-to-end scenarios is often all you need •Keep living documentation comprehensive
  23. 23. Please evaluate my presentation at: www.touchmyconference.com/ATD2013 Seb  Rose Twi$er:     @sebrose Blog:       www.claysnow.co.uk E-­‐mail:     seb@claysnow.co.uk -JVM 14 20 le y) ab ll il fu va pe A ho ( Seb Rose,
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×