450 likes | 684 Views
Acceptance Test Driven Development. Michael Eselgroth Daryn Holmes. Story Mapping. Story Mapping Demo. User Stories. As a … I want … So that …. Who?. What?. Why?. Who, what, why but not how…. Requirements. Stories are reminders for a future discussion
E N D
Acceptance Test Driven Development Michael Eselgroth Daryn Holmes
Story Mapping Story Mapping Demo
User Stories As a … I want … So that … Who? What? Why? Who, what, why but not how…
Requirements • Stories are reminders for a future discussion • Drive out the requirements, in the form of examples • Specification by example • Preferably in a format that can be automatically executed and verified • Tools often use the following advertising: • “Business users can now write their own requirements in their own language”
Story High level requirement May contain high level acceptance criteria Specification by Example Low level requirements Specific examples\scenarios of acceptance criteria Example 1 Example 2 Example n Code Includes unit testing and fleshing out the scenarios\examples into complete automated acceptance tests
Anatomy of ATDD • System Under Test (SUT) • BDD Framework • Runs examples\scenarios • Cucumber, Fitnsesse • SUT Driver • Execute and drive the SUT • White, Selenium WebDriver • Verification Framework • Built into Fitnesse • Unit Test verification • JUnit, Nunit, RSpec
FIT, Cucumber etc Demo
Intelligent Testing • No strict rules for all situations • Unit testing • Feature testing • Sensible slices • Somewhere in between
Smart Home SUT Smart Home Controller
Smart Home Message Adapter Business logic, database etc Transmitter
Smart Home Message Adaptor Business logic, database etc ‘Test’ Message Transmitter
Smart Home Message Adapter Business logic, database etc ‘Test’ Message Transmitter
Smart Home Message Adapter Business logic, database etc ‘Test’ Message Transmitter
Smart Home Message Adapter Message Adapter Test Harness Business logic, database etc ‘Test’ Message Transmitter
Example: Automated Data Input Raw Data Calculated Data Email Not Requested
End To End Integration Test Mocked Mocked Mocked
What part do expert testers play • They should do what they always done, just sooner and more often • They should be embedded in the team • More opportunities for better tests if they are on-board from the start
Why bother… Daryn Holmes
Why bother… • On 10 June 1990, an improperly installed pain of the windshield failed • Plane was at 17300 feet • No loss of life • 2 people were seriously injured Daryn Holmes
Why bother… • A replacement windscreen had been installed 27 hours before the flight • 90 bolts • 84 were 0.66mm too small in diameter • 6 were 2.5mm too short • Previous windscreen has been fitted with the wrong bolts Daryn Holmes
Why bother… • Investigators found found fault with British Airways' policies, which should have required testing or verification by another individual for this critical task • They found engineers were working by themselves, under extreme pressure • Safety recommendations • British Airways should review their quality assurance system and encourage engineers to provide feedback
Really? • ToEven • When a number is halfway between two others, it is rounded toward the nearest even number • AwayFromZero • When a number is halfway between two others, it is rounded toward the nearest number that is away from zero
What part do developers play Nr. Of Stories Develop Test Requirements (Spec)
What part do developers play Nr. Of Stories Develop Test Requirements (Spec)
What part do developers play Nr. Of Stories Develop Test Requirements (Spec)
What part do developers play Nr. Of Stories Develop Test Requirements (Spec)
What part do developers play Nr. Of Stories Develop Test Requirements (Spec)
Crystal: Efficiency is expendable in non-bottle-neck activities
As a rule of thumb, every hour you spend on defect prevention will reduce your repair time from three to ten hours Steve McConnell, Software Quality At Top Speed, 1996http://www.stevemcconnell.com/articles/art04.htm
Should Start-ups Use TDD? http://www.redhills.ie/2012/08/08/should-a-startup-use-tdd/
Should Start-ups Use TDD? http://www.redhills.ie/2012/08/08/should-a-startup-use-tdd/
Introducing ATDD • At the start of a project • Introducing it on an existing project • Outside in
TDD Culture It’s not about the technology, it’s about the culture
TDD Culture “The development team is responsible for first line support, 24/7” - Steve Freeman
TDD Culture “The development team is responsible for first line support, 24/7” “Team members ended up volunteering to be on support over Christmas” - Steve Freeman