NieuwsMagazine

Case Study Behaviour Driven Development Part 1

Auteur: Dennis de Booij ● email: dennisdebooij@gmail.com

en anderen uit werkgroep BDD TestNet

Redactie: Eric Spaargaren en Paul Beving

Image 1: Dilbert cartoon by Scott Adam

In the dynamic realm of agile software development, people value responding to change over following a plan and working software over comprehensive documentation (1). However, it would be a serious misunderstanding to conclude that this approach dismisses the need for planning or documentation altogether, especially for those serious about their work and committed to nurturing responsible and sustainable software development practises. The question that naturally arises is: how do you effectively plan and document within an agile context?

Deliberate discovery

Enter Behaviour Driven Development (BDD). BDD, an agile software development method centred around collaboration between business and IT professionals that have a stake in finding a solution for a complex problem. The core objective is to achieve a shared understanding of the problem. Any misalignment between what is desired and what is delivered leads to frustration, rework, low throughput and poor predictability. BDD aims to close that alignment gap before any code is written. It achieves this through incremental collaborative sessions. These sessions are structured to produce valuable output while remaining adaptable to evolving insights gained from preceding sessions.

The first phase in BDD involves the process of ‘deliberate discovery’ (2) where the stakeholders explore the problem space, define anticipated actions and start specifying the desired behaviour of the solution. They subsequently formalize these requirements and clarify them with practical examples. This is done using a domain specific language (3) that is comprehensible for both business and IT people.

This collection of requirements and examples functions as a single source of truth for all stakeholders. As a final step, a team that uses BDD can leverage automation tools that transform the practical examples into executable specifications. This can streamline your future development process and also results in ‘living documentation’ of your software – keeping your requirement documentation up-to-date and relevant. In this article, we aim to illustrate how this can be achieved by presenting a case study where BDD was applied, providing a tangible example of its practical implementation. This case study was done by the BDD work group of Testnet, the Dutch association of software testers (4). Our work group investigates how BDD fits into modern software development practises as it is often confused with software testing (5). Join us as we delve into the intricacies of BDD, demonstrating its effectiveness in a real-world scenario.

Impact Mapping: explore the problem space on a high level

For the featured case study, we engaged with experts in the equestrian domain that were interested in establishing a subscription-based learning platform dedicated to horse care and management. The platform will be founded on contemporary scientific insights and practical examples. During our initial session with these experts, we employed a practise called ‘Impact Mapping’ (6) to reveal how project deliverables connect to the needs of the platform’s target users.  It is important to note that BDD does not prescribe a specific starting point or set of practises: Impact Mapping is just one method among various available approaches (7). Our approach was based on the Capturing Agile Requirements by Example (CARE) training course (8) and that is why we started with Impact Mapping. Impact mapping, in essence, visualizes a subset of well-known questions for information gathering and problems solving (9) aimed to identify goals, key stakeholders, desired outcomes and the needs to achieve these outcomes.

Image 2: Impact mapping questions

Here is a summary of the session that was guided by the impact mapping questions:

Why?

Why do you want to set up a science-based learning platform for keeping and taking care of horses?

There is a lot of scientific research and practical knowledge available on horses, their behaviour and equestrian welfare. However, this knowledge is generally not accessible to horse owners or people who are considering keeping horses but want to know what it entails. There is a great need to distribute this knowledge to the right people. Partly, because these individuals are highly motivated to do things properly and also because the equestrian sport occasionally faces scrutiny regarding animal welfare.

Who?

Who are the people involved?

The target audience – the primary actors – of the platform consists of (potential) horse owners. The focus is on users that are highly educated and have both time and money to spare. Particularly recreational riders, but also professionals are welcome. Other stakeholders – the secondary actors – include the equestrian union and scientists in the equestrian field. Finally, there will also be requirements for privacy, security and performance – the off-stage actors.

Note that our equestrian domain experts are also actors as they will need to be able to manage the platform, the users and its content but we did not dive into that yet during this impact mapping session.

How?

How will the platform make the desired impact?

The platform will consist of an online training environment with learning modules, reading materials, and quizzes. The content will include text, video, and infographics, and possibly the option to listen to content. Therefore, there is also a desire for offline availability of content so that you can listen to content in your car, for example. In addition to training, the idea is to offer the following:

  • Lectures / theme evenings
  • Community building through intergroup discussions and experience sharing (by offering a forum or chat option)
  • Clinics (future goal)
  • Online master classes (future goal)

Because the content will change continuously there is also the desire for a newsletter and an ability to indicate new content and changes to existing content. The first version will be limited in content and start with a six-month trial period. The initial focus will be on quickly adding new content rather than adding new functionality. Possibly, a pilot or alpha/beta version will be considered. The subscription form is still under discussion and could include a multiple-tier model using silver, gold and platinum subscriptions.

Now the attentive reader will have noticed that we did not actually answer the question on how the platform will make the desired impact, but we were already making a list of deliverables of what we need to make the impact. What could have been valid answers on how to achieve the desired impact are:

While these examples represent our personal interpretations and assumptions rather than aligning with the vision of domain experts, they do not fit neatly into the category of ‘shared understanding.’ Nevertheless, through ongoing collaboration with domain experts, we managed to achieve our objectives in subsequent sessions. This hiccup underscores the challenging nature of establishing shared understanding, emphasizing the need for continual practice and experience to navigate potential obstacles.

What?

What are the deliverables that are needed to make the impact?

There will be four modules in the learning platform. Possibly in the form of chapters, with different target audiences and/or separate subscriptions.

  1. Housing
  2. Management
  3. Training
  4. Behaviour and Welfare

The four themes are closely interconnected, and there will be references back and forth between them.

From this impact mapping session, the following impact map was drawn. We focussed on the deliverables of the horse owners first as they are the target audience.

Image 3: Impact map with the first milestone: the four learning modules

For simplicity’s sake, the ‘What’ column only specifies the platform’s first milestone: the four learning modules. This visualization helps to align a development team’s efforts with the business goals of the domain experts. It also enables the team to take the next step by drilling down into the deliverable that is ranked first and therefore has the highest priority.

Event Storm: what is happening within a problem space?  

In a second session with the equestrian domain experts, we facilitated an ‘Event Storming’ (10) workshop. This is a lightweight collaborative modelling method that centres people around a large brown paper on the wall and lots of coloured sticky notes to discover what is happening, or what needs to happen, in a problem space. During the previous session ‘content generation for the four learning modules’ was identified as the top priority. However, it became evident during this Event Storming session that the domain experts wanted to prioritize ‘community building’ instead of ‘content creation’. Inspired by the discussions in the previous impact mapping session, the experts realized they wanted to focus on growth first. The platform’s success depends on the expansion of its member base. A thriving community with lively member interaction will lead to growth through word-of-mouth marketing. This change in insight that resulted in a priority adjustment is exactly what an agile approach like BDD supports. Through this adaptability we can cater to the evolving needs of our clients and the platform’s overarching success.

So, we followed the expert’s lead as they wanted to introduce a reward system on the platform. This system aims to foster healthy competition among members and to promote the platform’s recognition as members share their rewards on social media. To qualify for a reward the user must successfully complete a learning module and hand in a practical assignment which has to be approved by the platform administrators, our domain experts. We created a specific Event Storm around this process that starts when a member has completed a learning module successfully and which ends when the member receives a reward in the form of a ribbon as is customary in horse show competitions.  

Image 4: Photo of the Event brown paper with sticky notes

Below is a digital transcription of the sticky notes on the brown paper in the photo and an explanation of the event storming process:

Image 5: Digital version of storming sticky notes

The green square sticky note signifies the view model, a web page for example, that provides information to the user (yellow square) who decided to issue a command (blue square) invoked on the learning platform system (yellow rectangle) which produces an event ‘Practical assignment submitted’ (orange square). This event gets translated into the read model for the platform administrator who approves the assignment in the platform which results in the ‘Assignment approved’ event. This event activates an ‘Approved practical assignment’ policy (purple rectangle) that contains logic to automatically issue a command to the platform to check whether a ribbon has to be sent to the platform user based on the user preferences that have been registered during the onboarding process. Etcetera. The red sticky notes are questions, issues or ideas that came up during the event storming session. These items need to be addressed at a later time and may lead to new event storming sessions. 

The coloured sticky note visualisation on the brown paper is an artifact that helps stakeholders gain a clear understanding of the sequence of events within a process or system, identifying gaps and opportunities whilst effectively transferring knowledge to the development team. Moreover, the brown paper allows participants to draw, add relevant information, make connections by drawing arrows and is easy to roll up and use in a second session if needed.

Our event storming session yielded significant insight into areas requiring further refinement within the process, offering the domain experts clarity regarding their requirements. At the end, we had a productive discussion on how to activate the platform’s community through various strategies to be explored at a later stage:

  • Reward mechanisms for introducing new users to the platform
  • Integration with social media so earned rewards like ribbons can be displayed to enhance visibility and encourage engagement
  • Enhanced user interaction on a digital forum
    • Dedicated spaces where new users introduce themselves and initiate interactions
    • Video integration to enhance the user experience and knowledge sharing through informative videos

The collaborative approach of event storming resulted in a fruitful exchange of ideas between the domain experts and the technical experts. It opened up the eyes of the domain experts to new opportunities and obstacles to be tackled further down the road. Simultaneously, our work group achieved a deeper understanding of what the experts wanted to achieve and why.  

Source list:

(1) https://agilemanifesto.org/

(2) https://dannorth.net/introducing-deliberate-discovery/

(3) https://martinfowler.com/bliki/GivenWhenThen.html/

(4) https://www.testnet.org

(5) https://www.testnet.org/artikelen/why-is-bdd-confused-with-testing

(6) https://www.impactmapping.org/

(7) https://dannorth.net/bdd-by-example/#on-principles-and-practices

(8) https://agile-united.com/_files/ugd/b7b6d6_966dd97116ef4db599ed26eccccd886c.pdf

(9) https://wikipedia.org/wiki/Five_Ws

(10) https://www.eventstorming.com


Vervolg zie: deel 2


Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *