As a Clockworker, I’m consistently looking for ways to become a better tester, improve my programming skill set and find ways to do my job more efficiently. While life as a software tester at Clockwork is full of challenges and surprises, I found a particular part of my responsibilities tedious: Test Plan Entry.

Prior to launching the testing phase of a project, we enter test plans into TestLink, an open-source project. TestLink allows us to track test plan execution, and for the most part, it works well. However, entering test cases manually into TestLink can be time consuming.

A self-challenge was established: Find a way to speed up test plan entry, and level up my novice programming skills.

What is a Test Plan?

A Test Plan is a combination of scenarios (test cases) and the anticipated behavior (expected results) for features and functionality on a product; the amount of detail each plan contains can vary, depending on the complexity of a product, its schedule, and the test engineer assigned to the project. 

Here’s a sample Test Case:

Test Plan Entry

To get the above test case into TestLink, every line must be entered into a separate text box, and each new test step requires a page reload; updating a test case, because our processes are dynamic and fluid, requires similar effort.

To get around this, our test team creates test plans in plain text. This works great; changes to the plain text test plan can easily be tracked using version control software, and any Clockworker can easily edit, add, or change the test plan.

When a test plan is ready to execute, the process of entering test plans into TestLink begins. We migrate the plain text test plan into TestLink, using the tried-and-true cut-and-paste method, test case by test case, step by step, result by result. If a plan had a particularly detailed test case, migrating that individual case into TestLink could easily take 3-4 minutes to enter in this method. A standard-sized project might have 100 unique test cases; cutting and pasting these into TestLink impacts a project’s budget, and getting the most out of our time is important.

Improving the Test Plan into TestLink workflow

As a Clockworker, part of my responsibility is improving processes. Was there a way this process could be improved? Can I import a test plan into TestLink?

Unfortunately, importing from a plain text file (our preferred format) isn’t supported by TestLink. At one point, TestLink supported importing from Excel spreadsheet files, but this functionality is no longer supported, and tracking TestPlan changes in an Excel file isn’t as slick as our plain text solution. However, TestLink supports importing from an XML file format.

For a novice programmer (but experienced tester), it couldn’t be that hard to convert plain text to XML, could it? As proof of concept, a simple shell script was drafted that converted a plain text test plan into the very basic elements of a TestLink-compatible XML file.

Adventures in PHP

This initial script was bare bones. After a review by the test team, a distillation of TestLink’s XML specification, a series of feature requests, and encouragement from senior staff, I took it upon myself to get familiar with PHP.

Over a couple of nights with PHP and a Clockwork Lab Day, a refined little application was born. Support for complex test cases was added and a simple syntax implemented for our plain text test plans. The Summary section was updated to support HTML for cleaner presentation in Testlink. Finally, the project was christened “TestOutlineConverter” and put into production. Now, our test plans are written faster and easier.

Now, with more TestOutlineConverter

Here’s how that test case looks with TestOutlineConverter’s simple syntax. This also has a little HTML thrown in for prettier formatting.

TestOutlineConverter Output

And the test case, after being imported into TestLink

Leveling Up

The gains of my efforts were immediately tangible to Clockwork and our clients; budget for Test Plan Entry dropped from over an hour to less than five minutes, the Clockwork Test Team can work faster, and I now have a +1 to PHP on my personal stat sheet.

Where to see, get, and/or contribute to TestOutlineConverter?

TestOutlineConverter is hosted at github. Updates to the program will be committed there and contributions are welcome.

Future plans for TestOutlineConverter include an expanded markup language, TestLink keyword and preconditions support, and the ability to process exported files from TestLink.