What are these issues:
- Insufficient time to produce sufficiently comprehensive ACs
- Unstructured ACs written in narrative leading to ambiguity.
- No traceability between ACs and the automated tests ... no acceptance test coverage
- Poor cross-team visibility of original ACs and subsequent changes
- Tests for ACs being implemented in different unrelated technologies
- Automated tests requiring significant refactoring when new stories are developed
- Loose relationship between ACs and tests
- Previous Stories become redundant and no single view of what the App does
- Little focus on AC context such as; scope and assumptions
- Little focus on wider ACs such as; app wide, business domain, technical domain.
How does BDD help:
- The enforced structuring involved in writing BDD Scenarios imposes an increased focus on writing ACs and hence a greater investment of time hence more deliberation. This benefit is a marginal byproduct of the process and so can be mute.
- BDD imposes a stricter (e.g. Gherkin) style which needs to be implementable in test logic, thus reducing the scope for ambiguities
- There is a programmatic link between Stories (Features), ACs (Scenarios) and Tests
- ACs become a tangible test artifact. Tests = ACs to Test better reflect the requirements, rather than going thru a level of interpretation.
- ACs are linked to the corresponding tests which can be implemented in different technologies e.g. GUI test or Unit style test
- 'Fixtures' directly model ACs and therefore are likely to be less throw-away. Organising automation into; state setting, follow-up actions, and test assertions, modularise the tests thus increasing re-use. Additionally the separation of data-driven inputs and their associated test improves the design.
- Assertions and flow are taken out of the test and implemented in the BDD code so the AC is the test.
- Stories need to be kept up-to-date and so can be used to document App functionality
BDD tests should focus on the functionality and not on the Integration and so can be heavily geared around the Unit tests.
Concerns:
- The relationship between ACs and test is not always 1:1. Sometimes it's better to amend existing tests rather than creating new ones.
- The most important requirement for AC writing is sufficient time and flexibility, and only a process change will provide this
- Structure can be achieved through process and practices
- POs are not focussed on ACs, they are focussed on results and building confidence in QAs
- BDD tests are still at quite a high level and there is still room for ambuguity thus misinterpretation when righting fixture code.
- Overhead incurred for maintaining previous Stories where new Stories have changed behaviour