Narrative Acceptance Tests - A Behaviour Driven Approach

Level: Practicing

Acceptance Tests elaborate a user story & are essentially behaviour specifications, expressing examples of how the application will actually be used. These should represent customer-intent in terms the customer understands.

This session shows developers and testers how to transcribe their understanding of customer intent in a way that makes sense to customers. Using the popular BDD Given/When/Then approach to acceptance tests, participants will learn how to leverage the popular Fit framework to replicate that approach. Alternatives to using Fit, including using code, will also be explored.

Process/Mechanics
  1. Introduction to the topic, and presenters
  2. Presenters summarise a User Story to the group
  3. Presenters play the role of customer with participants playing the part of the team - guided to ask appropriate questions to capture examples that illustrate the story
  4. Presenters exchange roles with the participants and elaborate the first example for the user story into an acceptance test (captured in plain text)
  5. The group splits into pairs to practice writing the second acceptance test
  6. Several pairs’ acceptance tests are collected in order to discuss with the group
  7. Presenters show their version of the second acceptance test
  8. Presenters show how these are sometimes expressed using a table-heavy approach in FitNesse
  9. Presenters then show how to represent these tests so that they look almost identical to the plain-text tests in FitNesse (using a soon to be released Fixture)…
  10. Presenters then show how these tests can also be written in code with a fluent API
  11. Group discussion of alternatives and reflection on learning points

Notes: a) The yet to be publicly released Fit fixture has been in use on a large enterprise programme of development with one of our clients

b) For the benefit of the reviewers, you can see illustrations of using code to express acceptance tests here: http://bitbucket.org/testingreflections/jnarrate/src/tip/JNarrateExample... http://bitbucket.org/testingreflections/jnarrate/src/tip/JNarrateExample...

Learning outcomes
  • How to express the scope of a user-story with acceptance tests
  • How to express automated acceptance tests in a customer-focused way
  • How writing acceptance tests using fluent APIs can be an alternative to more conventional plain-text or HTML based frameworks
  • How to leverage tools such as Fit/FitNesse - moving beyond table-ridden tests - to create expressive BDD style behaviour-specifications
  • Reduce duplication between explanatory text and executable statements
  • Be aware of several frameworks that support, or can be made to, support this approach
Featured participants
Primary target persona