Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ado2010

402 views

Published on

fixture-free automated acceptance test

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Ado2010

  1. 1. Fixture-Free Automated Acceptance Tests Mike Stockdale ©2010 Syterra Software Inc. Much Ado About Agile V
  2. 2. http://commons.wikimedia.org/wiki/File:Start_of_a_dugout_canoe_03.jpg
  3. 3. http://layered.typepad.com/antidote_to_burnout/2006/08/they_still_buil.html
  4. 4. Requirement Detailed Design Unit Test Code System Design System Test Acceptance Test SDLC V Model
  5. 5. http://www.natpryce.com/articles/000780.html
  6. 6. Feedback • Check behavior • Positive design pressure
  7. 7. http://twitter.com/#!/s_bergmann/status/29008066042
  8. 8. Requirement Detailed Design Unit Test Code System Design System Test Acceptance Test SDLC V Model
  9. 9. Agenda • Agile testing beyond TDD • Reality check: what are you doing? • Automating user stories • Demo • Questions and Comments
  10. 10. A Small Slice •Micro-test: 20 – 30 minutes • User story: 2 -3 days
  11. 11. A picture example is worth a 1000 words
  12. 12. Some examples are better than others http://www.flickr.com/photos/rampix/3258014594/
  13. 13. Example Requirement Test elaborates confirms executes AA-FTT 2008 Open Space
  14. 14. Micro (unit) test Story test Exploratory test End-to-end test Smoke test Performance test Security test Regression test
  15. 15. Tests beyond TDD • What tests does your team perform? • Are they automated? • Who writes, runs, maintains them? • When are they written, run, maintained? • What are your good and bad experiences?
  16. 16. One Approach • Micro tests + exploratory tests • Add regression tests as required • All automation in one framework
  17. 17. Story test automation • Change the cost/benefit
  18. 18. High risk but hard to automate? http://www.flickr.com/photos/koalie/1699195578/
  19. 19. to reliably test manage a system, we must be able to… • determine what the system is doing. • detect when it has stopped doing it. • detect when the system has failed. • explain why has it failed. • restore to a known good state. http://www.natpryce.com/articles/000780.html
  20. 20. Improved Visibility http://www.flickr.com/photos/kevinsteele/28503911
  21. 21. Example Requirement Test elaborates confirms executes AA-FTT 2008 Open Space
  22. 22. Caveat: User story ≠ story test • may change existing story tests • may not be automated • don’t force-fit into story test language
  23. 23. No single work group at any work step should remove user stories to a medium that, while more expedient to their work, causes user stories to become less accessible by others with different skills and responsibilities. http://blog.scottbellware.com/2010/10/user-stories-belong-to-everyone.html
  24. 24. http://twitter.com/#!/dhemery/status/22638188913
  25. 25. FixtureFramework SUT Host language
  26. 26. FixtureFramework SUT Host language Story test
  27. 27. Fixture Framework SUT Host language Story test
  28. 28. Plus Check 2 plus 3 is 5 PlusFixture: return plus(x, x + y) plus: return y
  29. 29. Transparency • Ubiquitous language • Domain layer
  30. 30. • Ownership • Cadence, flow http://www.flickr.com/photos/kevinsteele/28503911
  31. 31. Caveat: Story test ≠ General-purpose language
  32. 32. Scenario: User creates some sites and circuits, check connected sites list Given a "site" exists with {"name"=>"Somewhere1", "identifier" => "TER1", "provider"=>"TER1 Provider"} And a "site" exists with {"name"=>"Somewhere2", "identifier" => "TER2", "provider"=>"Some Provider"} And a "site" exists with {"name"=>"Somewhere3", "identifier" => "TER3", "provider"=>"TER3 Provider"} And a "circuit" exists with {"provider_name"=>"Another provider", "redacted_circuit_id"=>"ABC1", "provider_circuit_id"=>"C1", "circuit_type"=>CircuitType.find_by_name("Peering"), "service_type"=>CircuitServiceType.find_by_name("Dark Fiber"), :capacity => CircuitCapacity.find_by_name("1 Gbps"), "physical_wire_type"=>PhysicalWireType.find_by_name("Multi Mode Fiber"), "status"=> CircuitStatus.find_by_name("Cancelled"), "a_end"=>Site.find_by_identifier("TER1"), "b_end"=>Site.find_by_identifier("TER2")} And a "circuit" exists with {"provider_name"=>"Switch and Data", "redacted_circuit_id"=>"ABC2", "provider_circuit_id"=>"C2", "circuit_type"=>CircuitType.find_by_name("Backbone"), "service_type"=>CircuitServiceType.find_by_name("Dark Fiber"), :capacity => CircuitCapacity.find_by_name("1 Gbps"), "physical_wire_type"=>PhysicalWireType.find_by_name("Multi Mode Fiber"), "status"=> CircuitStatus.find_by_name("Cancelled"), "a_end"=>Site.find_by_identifier("TER1"), "b_end"=>Site.find_by_identifier("TER3")} When I am on the "connected_sites" page for site "TER1" Then the "connected-sites-list" should look like | Site ID | Site Name | Site Provider | Provider Circuit ID | Provider Name | Circuit Status | | TER2 | Somewhere2 | Some Provider | C1 | Another provider | Cancelled | | TER3 | Somewhere3 | TER3 Provider | C2 | Switch and Data | Cancelled | When I am on the "connected_sites" page for site "TER2" Then the "connected-sites-list" should look like | Site ID | Site Name | Site Provider | Provider Circuit ID | Provider Name | Circuit Status | | TER1 | Somewhere1 | TER1 Provider | C1 | Another provider | Cancelled | When I am on the "connected_sites" page for site "TER3" Then the "connected-sites-list" should look like | Site ID | Site Name | Site Provider | Provider Circuit ID | Provider Name | Circuit Status | | TER1 | Somewhere1 | TER1 Provider | C2 | Switch and Data | Cancelled |
  33. 33. Enabling fixture-free tests • create object • execute method • check result • system under test • save and load objects • encapsulation, reuse
  34. 34. Demo • State test • Function test • Integration test • Other features • Domain adapter • Parse methods • Factories
  35. 35. Questions Comments
  36. 36. Mike Stockdale • jediwhale@syterra.com • www.asoftwarecraft.com • twitter.com/jediwhale • fitsharp.github.com Groups • tech.groups.yahoo.com/group/fitnesse • tech.groups.yahoo.com/group/aa-ftt

×