Testing Use Case: Dev wants to write a series of related and very similar tests

Say the dev is writing tests to verify that authentication always happen correctly, no matter the circumstances. He may easily have to write a dozen of individual tests which carry out more or less the same actions and verifications in slightly different circumstances (ex: empty user db, blank user name, blank password, etc...).

As much as possible, the dev wants the common parts of these tests to be modularised (ex: use the same code or XPATH expression to verify whether or not the userid and pwd were accepted), so that he doesn't have to do it 12 times, and so that he doesn't need to change it in 12 places if it later needs to change.

History Source Comments