I have a BDD feature containing multiple scenarios. Should each scenario be completely self contained and runnable individually?
I have a BDD feature containing multiple scenarios. Should each scenario be completely self
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Should be, yes. It is generally good practise in all forms of TDD (BDD included) to make sure that each “test” can run independently, and isn’t coupled with or have a dependency on another test having been run first. This will help avoid creating a brittle test suite (i.e. one that is prone to breaking).
That’s not to say that you cannot chain readability together. For a very cheap/quick example:
Each scenario indicates a test that can be automated – and each should be designed behind the scenes to be able to run independently. But as a reader of the feature (say a business stakeholder) – the process is complete and they can understand the entire picture more easily.