Why write tests in plain-text?

Soumya Swaroop Gupta
Gauge
Published in
3 min readJan 17, 2017

--

Writing scenarios to test a functionality involves a lot of thinking. Over time test cases and scenarios become complex even for trivial applications.

Writing tests in plain text helps to keep it clear and simple.

As a team, both technical and non-technical members interact to gather feedback. Specifications written like a story enables all stakeholders to easily understand and verify intent.

I work on Gauge an open source automation tool with the ability to author test scenarios and cases in business language.

While building Gauge, we looked at a lot of options to make it easy to author the test scenarios. Structured formats like fixture, HTML, XML, JSON and Gherkin didn’t suit our requirement. While Asciidoc, reStructuredText came close to expressing natural language we chose Markdown, as it was simpler and suited our needs.

The specifications can be authored using any simple text editor across platforms or Operating Systems. It’s great for productivity. It is intuitive and it gets to the core of what matters: ease of use.

In this post, I’d like to show you, how to get the most of Markdown with Gauge using a few examples.

Natural Language: to create common understanding. Specifications in Gauge inherit Markdown’s readability.

For e.g.

Separation of concerns: of data and scenarios. Test data sets and scenarios can be easily separated and maintained using tables!

For e.g.

With the test data and scenario steps separated, there’s flexibility to manage the test cases.

Flexibility: to express intent. We can word the same functionality differently to set a context or express intent better.

For e.g.

The following steps have the same underlying functionality.

They check for the system generated email. Gauge allows wording them differently without having to repeat the code block giving the user the flexibility to express.

Convey more: with images. Visually enrich the test case reports by associating images.

For e.g.

The generated html report will show the specified image after executing the specification above.

Abstraction: code behind the steps. Markdown allows Gauge to abstract text from executable code blocks.

For e.g.

The Gauge step to code journey can be iterative. The steps can be authored without code blocks. Gauge skips such scenario(s) until all its steps have an association to a code block. This makes building the test cases fast and easy.

Language Choice: with UTF-8 character support. The Markdown’s UTF-8 character support enables you to write Gauge’s specifications in the language you actually like!

For e.g.

To explore more, Get started on Gauge!

--

--

Soumya Swaroop Gupta
Gauge

Multi-faceted software techie. Played roles of BA, Developer, and now QA for Gauge. PS: I love to travel.