System Testing and Domain Specific Languages

Systir stands for System Testing In Ruby. This doesn’t mean “system testing of Ruby code”; rather, it means we used Ruby to create a tool for helping you automate your system tests.

In short, Systir allows you to write system-level tests in a “domain language”; that is, a custom language that pertains to your target software functionality and its own particular constructs.

Example

The Tester (i.e. the person in charge of designing and running tests for the software – not necessarily the developer) expresses tests in language like:


launch_accounting_program

login_as_administrator 

go_to_user_admin_panel

add_user {
    name "Charles" 
    password "hello123" 
    privileges normal
}

logout 

login_as "Charles" 

verify_user_can_see personal_info_screen 

verify_user_cannot_see user_admin_panel 

logout 

close_accounting_program

The script above is an example of executable code… as long as you have created a language driver to support the macros and symbols being used in the test.

It is the duty of a Toolsmith (someone with development skills designated to support the needs of a Tester) to implement the language driver to support the above sample and to establish a launcher script to use as a harness.

See the examples/ directory of the source package to see more concrete examples.

Why Bother?

The test script may look like nothing more than a piece of vague documentation with a lot of underscores. The difference is that this is executable documentation. It is self explanatory, easy to follow, short… and can never get out of sync with actual requirements.

Even if the role of Tester, Developer and Toolsmith are rolled into a single individual, this approach is valuable as a means of separating the (sometimes considerable) “tool code” used to drive the application under test from the actual specification of the test, a specification which should be no more or less than a direct mapping of a customer requirement (user story).

Under the Hood, Building on Test::Unit

Systir itself is a small library that encapsulates the standard-issue Test::Unit framework that is built into Ruby 1.8. Your tests will ultimately run in the context of a Test::Unit::TestCase, giving your language driver the convenience of Assertions and the test harness and results collector.

The magic is in the runtime transformation and execution of standalone .test scripts and perhaps most importantly, a shift in metaphor from Unit Testing into System Testing.

Resources

Systir at RubyForge
API Docs

Quick Start: Download, unpack systir-0.5.zip, and read INSTALL. Also see systir-0.2/examples/basic/README for a simple example.

See Designing Your Test Language for introductory guidelines on designing and using your custom domain language.

Copyright © Atomic Object LLC. — +1 616 776 6020 — Contact Us

Edit