adesso Blog

The Cucumber Framework is a powerful open-source tool that is used as part of Behaviour Driven Development (BDD). It enables collaboration between non-technical and technical team members through the use of a common language. It often supports the creation and execution of automated test cases.

This introduction provides an overview of the basic concepts and features of the Cucumber framework.

BDD - Behaviour Driven Development

BDD is an agile software development method whose approach is based on the conviction that software is not or cannot be based solely on technical aspects. Rather, the focus should be on the desired behaviour of the software from the stakeholders' perspective. BDD aims to improve communication and collaboration between the various roles in the project. A common language should help to break down the barriers between non-technical and technical colleagues.

Cucumber

Cucumber was developed to implement the principles of BDD. It is an open-source solution designed to realise the definition, execution and automation of test scenarios in a simple and natural language.

Cucumber uses the Gherkin syntax to describe test cases in so-called feature files.


Example of a feature file in Gherkin syntax (source: https://www.jetbrains.com/help/idea/creating-feature-files.html#examples-scenario-outline)

Finally, Cucumber itself converts the feature files into executable code (step definitions). Each step definition is linked to the corresponding feature file. In this way, later tests are compared with the corresponding feature files to detect discrepancies in the definition/implementation of the test cases.

How is Cucumber used?

Cucumber is not a stand-alone software solution. Rather, it is a type of framework or library that can be used in various programming languages to create feature files with the Gherkin syntax.

The following programming languages are particularly popular for implementation:

  • Java: Cucumber JVM
  • C#: SpecFlow
  • Python: Behave
  • Ruby: Cucumber .rb
  • JavaScript: Cucumber .js

Numerous instructions on the Internet are easy to find for the corresponding setup in the respective programming environment.

Development of the test cases by the Three Amigos

The so-called Tres Amigos principle is a proven method in BDD that improves collaboration and intrinsic understanding between three important key roles in the development process. It refers to the following three roles:

  • Business analysts/product managers
  • Developers
  • Testers

The aim is to precisely refine the requirements using the different perspectives and expertise of the various roles. Someone from product management or business analysis can describe the requirements in a simple and readable language for the non-technical roles in the project. Gherkin syntax is used to create feature files that describe the desired behaviour of the software.

The developer then takes over the feature files and creates the corresponding step definitions in the code, which are then linked to the corresponding logic in the code that implements the desired behaviour.

The tester also takes over the Gherkin feature files to create automated test cases.

This approach ensures and improves the inherent understanding between the three key roles and enables a more resource-efficient development and implementation of requirements.

Conclusion

The central question that now arises is: How does adesso benefit from this tool/framework? Today's IT project environment is characterised by high dynamics and complexity. The development of requirements and the implementation of quality assurance measures are made even more difficult by the time-limited cooperation between team members. This limited collaboration can harm the intrinsic understanding between team members. Nevertheless, a solution must be found to achieve the best possible result from the collaboration under these conditions. By clearly defining the roles as described above and using the tool as an alternative, we can look at the test cases from different perspectives. This helps to minimise the risk of the project going in the wrong direction.

Interested readers can find further information on this website: https://cucumber.io/docs/cucumber/

Would you like to find out more about exciting topics from the world of adesso? Then take a look at our previous blog posts.

Also interesting:

Picture Siver Rajab

Author Siver Rajab

Siver Rajab is a Consultant in the Banking division at adesso. With a background in data integration and many years of experience as a business analyst, Siver supports decision makers in taking the right steps towards success.

Category:

Methodology

Tags:

Cucumber

Save this page. Remove this page.