Question

Can we write generic test cases in BDD? I mean that we have a generic test class, and we could have an instantiator to instantiate the value that we want and then execute the test?

Was it helpful?

Solution

BDD has a strong focus on customer communication, so I would recommend not to write generic test cases, as it will likely be harder for a customer to understand. For example, I would prefer:

authenticates_user_with_4_digit_password
authenticates_user_with_8_digit_password

However, you should do what works best for your situation and if your customer understands a generic test case, then you should use it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top