Wednesday 19th June 2019,
SQA²

Importing BDD feature files into the BBT Tool

David Conard June 27, 2015 Uncategorized No Comments
test_automation-1024x837

BBT stands for behavior based testing, which is built upon BDD which stands for behavior driven development.  A lot of the rules and best practices that you would normally see in BDD exist in BBT.  The usage of Given, When, and Then. The fact that simple text can translate into automated tests.  This is why the BBT tool can directly import BDD feature files and graph them on a BBT chart.  This simple feature allows anyone who is currently using BDD, and is looking for an alternative solution that can provide better coverage, make the switch.

The importing tool takes any file with the extension “.feature”, normalizes it, and graphs it out using the BBT best practices and principles.  This feature is perfect for anyone that is currently using BDD.  First, all one needs is a proper BDD feature file.  The extension is just one part, the file needs to be a properly formatted feature file as well.  This means the feature line and scenarios are required. If any one thing is missing or improperly formatted then  the import wont normalize correctly.  This shouldn’t be a problem for anyone who has invested time into BDD, the files wouldn’t run for you without the correct formatting anyway.

Next comes the normalization, every feature file is normalized to fit a specific pattern so that the BBT can read it and map it.  Mainly the normalize process will just move the keywords that BBD utilizes, Given, When, But, And, and Then.   As a BDD user myself, I’ve seen some pretty badly written feature files that don’t follow any best practices.  This normalize process tries to apply them for you, things like making sure each scenario has a Given and a Then, and a  When step is used right before a Then step when applicable, things of that nature.  The biggest change you will notice is that the scenario outlines get converted into regular scenario’s.  A best practice in BDD is to refrain from using scenario outlines because it’s not as obvious what’s going on when business takes a  look.  They shouldn’t need any additional training to understand plain text.  Back to the normalization process, when normalized, you will see a pre and post normalized file, this will give you a change to review it before mapping.

The last part, if you choose to continue is to click the map button.  This will tell the tool that you’re happy and you’d like to see it graphed.  You will then see every Then step mapped out as an outcome, every Given and And after the given step mapped out as contexts with the When step mapping out to an event.   If you have things like quotes in your feature file, these are handled as well with BBT parameters.  Visually you’ll see your quoted terms in curly brackets.

So making the transition to BBT from BDD is pretty much the easiest transition there is.  The benefits from importing verse starting from scratch is pretty obvious in my opinion but in case it’s not so obvious, you save time, money, and retain all you existing tests in a new tool.  You won’t have to support two different frameworks.  Even though the tests are retained, it would probably be in your best interest to review those graphs to see what’s missing.  The graphs in my opinion are easier to read then a wall of text  and making changes and updates are a breeze.

Like this Article? Share it!

About The Author

Leave A Response

You must be logged in to post a comment.