Acceptance Test Driven Development Michael Eselgroth Daryn Holmes

  • Slides: 45
Download presentation
Acceptance Test Driven Development Michael Eselgroth Daryn Holmes

Acceptance Test Driven Development Michael Eselgroth Daryn Holmes

Story Mapping Demo

Story Mapping Demo

User Stories Who? As a … What? I want … Why? So that …

User Stories Who? As a … What? I want … Why? So that … Who, what, why but not how…

Requirements • Stories are reminders for a future discussion • Drive out the requirements,

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

Story High level requirement May contain high level acceptance criteria Specification by Example Low level requirements Specific examplesscenarios of acceptance criteria Example 1 Example 2 Code Example n Includes unit testing and fleshing out the scenariosexamples into complete automated acceptance tests

ATDD (BDD)

ATDD (BDD)

Anatomy of ATDD • System Under Test (SUT) • BDD Framework – Runs examplesscenarios

Anatomy of ATDD • System Under Test (SUT) • BDD Framework – Runs examplesscenarios – Cucumber, Fitnsesse • SUT Driver – Execute and drive the SUT – White, Selenium Web. Driver • Verification Framework – Built into Fitnesse – Unit Test verification – JUnit, Nunit, RSpec

FIT, Cucumber etc Demo

FIT, Cucumber etc Demo

Intelligent Testing • • • No strict rules for all situations Unit testing Feature

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 SUT Smart Home Controller

Smart Home Message Adapter Business logic, database etc Transmitter

Smart Home Message Adapter Business logic, database etc Transmitter

Smart Home Message Adaptor Business logic, database etc ‘Test’ Message 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 Business logic, database etc ‘Test’ Message Transmitter

Smart Home Message Adapter Business logic, database etc ‘Test’ Message Transmitter

Smart Home Message Adapter Test Harness Business logic, database etc ‘Test’ Message Transmitter

Smart Home Message Adapter Test Harness Business logic, database etc ‘Test’ Message Transmitter

Example: Automated Data Input Database Calculated Data Background Application Raw Data (scheduled task) Email

Example: Automated Data Input Database Calculated Data Background Application Raw Data (scheduled task) Email Content Team Not Requested Feed Provider

End To End Integration Test Domain Mocked Email. Notifier Mocked Web. Handler Database. Repository

End To End Integration Test Domain Mocked Email. Notifier Mocked Web. Handler Database. Repository

What part do expert testers play • They should do what they always done,

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… 25 February 2011 Daryn Holmes

Why bother… 25 February 2011 Daryn Holmes

Why bother… • On 10 June 1990, an improperly installed pain of the windshield

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 25 February 2011 Daryn Holmes

Why bother… • • • A replacement windscreen had been installed 27 hours before

Why bother… • • • A replacement windscreen had been installed 27 hours before the flight 90 bolts – 84 were 0. 66 mm too small in diameter – 6 were 2. 5 mm too short Previous windscreen has been fitted with the wrong bolts 25 February 2011 Daryn Holmes

Why bother… • Investigators found fault with British Airways' policies, which should have required

Why bother… • Investigators 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

Why bother…

Why bother…

Really? – To. Even • When a number is halfway between two others, it

Really? – To. Even • When a number is halfway between two others, it is rounded toward the nearest even number – Away. From. Zero • When a number is halfway between two others, it is rounded toward the nearest number that is away from zero

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Nr. Of Stories What part do developers play Develop Test Requirements (Spec)

Crystal: Efficiency is expendable in non-bottle-neck activities

Crystal: Efficiency is expendable in non-bottle-neck activities

Barry Boehm, “Equity Keynote Address” March 19, 2007.

Barry Boehm, “Equity Keynote Address” March 19, 2007.

As a rule of thumb, every hour you spend on defect prevention will reduce

As a rule of thumb, every hour you spend on defect prevention will reduce your repair time from three to ten hours Steve Mc. Connell, Software Quality At Top Speed, 1996 http: //www. stevemcconnell. com/articles/art 04. 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/

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

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 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

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

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

Thank you…

Thank you…