Behaviour Driven Testing – An Introduction

What is Behaviour Driven Testing (BDT)?

Behaviour Driven Tests focuses on the behaviour rather than the technical implementation of the software. If you want to emphasize on business point of view and requirements then BDT is the way to go. BDT are Given-when-then style tests written in natural language which are easily understandable to non-technical individuals. Hence these tests allow business analysts and management people to actively participate in test creation and review process.

Why BDT originated?

Since the time test automation started, it has evolved tremendously with new concepts, framework design and tools. The low usability, rigidity and high maintenance cost has been the reason of evolution of automation frameworks.

model1

 

 

 

 

 

 

 

The one common disadvantage of using any of these frameworks is the difficulty in understanding the automated test cases by the non-technical people such as business analysts and management.

BDT has helped to plug-in this gap. It has helped to bridge the communication gap by writing human readable test cases. It is a relatively new agile software development approach that focuses on communication; encouraging collaboration between developers, QA and business participants; to help bridge the Business-IT alignment gap. The scenarios are written to build up a clear understanding of the desired behaviour and this happens through discussion with stakeholders.

How is BDT implemented?

There is a plethora of open source BDT frameworks available in many programming languages and supporting different platforms. For instance, Cucumber (preferably with Ruby), JBehave for Java, NBehave and specflow for .Net, Behat for PHP and Twist for Groovy etc. The BDT layer is implemented on top of customized framework so it’s about building up layer upon layer only. The behaviour driven tests are given- when-then style steps written in natural language. Ofcourse, the implementation of these steps has to be done in a programming language of one’s choice.

Advantages and challenges of BDT

•  Collaboration: It engages product teams, business analysts,
QA   team and developers onto the same page and provides a
platform to resolve the differences in point of view. Thus,
ensuring that all stakeholders have the same expectations.
This co- operation between stakeholders in-turn results in
good and clear set of Acceptance Criteria

    • Easy Review and Feedback: No development skills are required for creating tests as tests are written in ubiquitous language. Business Analysts can actively participate in automated test cases review process and give their feedback to enhance them.
    • Right Focus: BDT helps to focus on the user’s needs and the system’s expected behaviour rather than focusing too much on testing the implementation.
    • Greater ROI: It has been observed that the behavior of the software stays for longer than the implementation. So, behavior driven tests are easier to modify and hence results in greater ROI. Also, the BDT tools are open source which further reduces the investment.
    • Easy Maintenance: With BDT code redundancy can be minimized due to ‘step reusability’ feature. Hence, these tests are less costly to maintain.
    • Availability of skilled resources: The BDT tools and framework development approach are different from other popular automation tools in the market like QTP, SilkTest, TestComplete. So, skilled resources are required to build and maintain the BDT framework.
    • Re-engineering: In some cases, the tests written by the manual tester/client/ business analysts are not good enough for automation. So, some rework may be required to make them suitable for automation.
    • Support Community – The concept of BDT is relatively new that is why the support community is yet not large enough. So currently, it might take a little longer to resolve the technical issues or queries.

Conclusion

BDT is gaining momentum as lot of organizations are looking at it as a solution to their automation and collaboration challenges. BDT framework has been successfully implemented by various QA teams in various domains. Implementing BDT with automation best practices and integrating it with CI & test case management tool produces all the benefits of automation. BDT for sure is here to stay

About the Author

Divya Madaan is a test automation specialist with 11 years of experience in quality control. She has extensive experience in various automation tools, frameworks and latest technology. She is currently working with Aspire Systems.

Leave a Reply