BDD With Thucydides and JIRA

We are currently working on multiple pharmaceutical software development projects and already gave up managing our highly regulated environment with waterfall methodology, thanks to Dean Leffingwell for his work on Agile Software Development with Verification and Validation in High Assurance and Regulated Environments back in 2011. It is still a constant struggle, however, to keep track of the changing requirements and acceptance tests while maintaining compliance with the regulations and guidelines from cycle to cycle.

My internal presentation is based on Dean Leffingwell's work.

In this post I describe the approach we are using to get the most out of JIRA and especially the acceptance test automation capabilities of Thucydides.

Thucydides is a tool which brings together the frameworks you are probably using anyway in development, eg.:
I collected my goals with Thucydides as agile user stories (to be stylish):

As a system architect my dream is to get rid of the made up user stories and scenarios for acceptance testing and devolve this task on the user/domain expert to promote communication with the team.

As a software quality engineer I'd like to set up an automated testing environment to be able to track the changing requirements - by acceptance tests in failed/pending statuses - and generate and execute parts of the validation plan automatically. The following diagram - borrowed from Wikipedia - shows the activities which could be automated in an ideal world:
  • OQ (Operation Qualification) with automated unit- and integration tests
  • and PQ (Performance Qualification) by automated acceptance tests
OPQ Adaptation of V-Model

As a developer my goal is to be able to write more code than documentation, but I fear, it will never happen:).

User stories in BDD

Like XP and SCRUM, BDD defines business requirements by collecting and organizing structured user stories. BDD also prescribes defining acceptance criteria along with the stories which adds up to the following story template:

BDD story in JIRA
BDD story in JIRA

Gist starts here Gist ends here

JBehave reads these stories from text files by default, but Thucydides makes it easy to read the stories (and epics) directly from JIRA. The following articles describe how to implement two-way integration with the popular issue tracking system:

Part 1: BDD Requirements Management with JBehave, Thucydides and JIRA – Part 1
Part 2: BDD Requirements Management with JBehave, Thucydides and JIRA – Part 2

Reading acceptance criteria from JIRA needs a bit more configuration though:
  1. Extend Thucydides to process an extra custom field while reading JIRA issues
  2. Override default story paths 
  3. and Override default story loader as we are not reading the scenarios from the file system
Credit goes to Nicolas for pointing me to the right direction.

This way the stories and scenarios are accessible by the testing framework and we - and JBehave framework - only need to map the scenario lines to test steps to ignite Selenium and its browser automation features.

Gist starts hereGist ends here

Rich documentation

The result is a rich documentation with references to- and from the specific JIRA issues. These artifacts can provide automatically reproducible evidences of the continuous (acceptance) testing, user story verification and traceability from requirements to code.


Source code

I have used Thucydides and Spring Boot Maven archetypes to build this demo project:
https://github.com/richteri/hello-bdd

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Richter,
    Thanks for the nice article !

    During maven install am getting java.lang.NoClassDefFoundError: org/apache/http/config/Lookup error and the same error I am getting when I run GreetingControllerTest after running Application.java
    Can you help pls .

    Thanks,
    Nilanjan

    ReplyDelete

Post a Comment