Nowadays software development life cycle shall become shorter and shorter. DevOps and Continuous Integration is a must. So is test automation. However, the requirements are changing frequently at the beginning of the projects. Automated test cases would change so frequently that making them immediately is wasting time and money. What can we do?
The answer is better automation. Not only the test cases, but the test design can also be automated. There are several tools do this. Unfortunately, for these tools the learning curve is long. Their output may be manual or automated test cases. However, for automated test cases, you should have some development knowledge and when the specification is changing you shall modify some code. Script-less tools, on the other hand, need running application.
We introduced a new method Test Design-Driven Development, by which the whole development life cycle becomes shorter while improving the code quality. Here the test cases are generated from a test design specification, which is a simple extension of Gherkin language. The test design specification is a series of constraints such as
Gherkin – feature Login
WHEN Login name IS Hall AND Password IS 2@A9ih
WHEN Login button IS #pressed
THEN Message IS successful login
From these constraints (accepatance criteria), the tools’ compiler can generate both manual and automated test cases. The automated test case is something like that:
SelectWindow( “Login” );
SetValue( “Login name”, “Hall” );
SetValue( “password”, “2@A9ih” );
ClickOn( “Login button”);
VerifyValue( “Message”, “successful login”);
Here “login name”, “password” and “message” are keywords. Developers make their code based on these acceptance criteria. In this way, the test automation code can be generated from the implementation-independent specification.
The key advantage of this method is that test design remains implementation-independent, thus manual testers or business analysts can do it. Maintenance is cheap as only the specification is modified, while the executable test cases are generated. The extended Gherkin syntax supports describing test design specification in a hierarchical way. In this way you can design simple Gherkin descriptions which form very complx test cases. Another advantage is that when the code is ready so is the test automation code.
Dr. stván, Forgács is CEO at 4TestDev GmbH. He has a PhD in computer science. István, Forgács has 30+ of years of professional experience in the fields of <software testing.
His / her special expertise includes test design, agile testing, test automation and static/dynamic analysis.
He published 25+ scientific articles in leading international journals and conference proceedings. He is the coauthor of the book Agile Testing Foundations, An ISTQB Foundation Level Agile Tester guide, and the first author of Practical Test Design will be published in 2019. Istvan Forgacs is a member of Agile Working Group of ISTQB.