Perl Actor

PerlActor is a simple automated executable acceptance test framework for Perl. It can be used by Extreme Programming (XP) teams to rapidly develop executable acceptance tests for their Perl code.

PerlActor enables an XP Customer to write executable acceptance tests as plain text files, using a very simple syntax. Each test consists of a number of parameterized commands (one per line), which PerlActor uses to exercise the application. PerlActor parses the test, invokes the commands with any parameters, and reports the test result. The developers provide glue code that implements the commands required by the tests.

PerlActor allows tests to be grouped into suites so that related tests can be run as a group. The Customer can also just place test scripts in a directory structure and have PerlActor find and execute them all.

The PerlActor approach to acceptance testing has a number of advantages:

An example:

The following sample test script is adapted from one of the example scripts contained in the 'examples/calculator' directory of this distribution. It tests a toy calculator "application":

    # Script to check addition
    # 10 + 32 = 42

# Create a new calculator application NewCalculator

# Ensure that the display reads '0' intially CheckDisplayReads 0

# Press key '1', then key '0' PressKeys 1 0 CheckDisplayReads 10

PressKeys + CheckDisplayReads 10

PressKeys 3 2 CheckDisplayReads 32

PressKeys = CheckDisplayReads 42

The following is sample output from the included test runner:

    Running Acceptance Tests at Sun Apr 10 17:59:11 GMT 2005
    ==========================================================
    .....
    0.545077 wallclock secs ( 0.42 usr +  0.11 sys =  0.53 CPU)
    Run: 5, Passed: 5, Failed: 0, Aborted: 0.

and with test failure:

    Running Acceptance Tests at Sun Apr 10 18:04:36 GMT 2005
    ==========================================================
    .F...
    1.24811 wallclock secs ( 0.47 usr +  0.07 sys =  0.54 CPU)
    Run: 5, Passed: 4, Failed: 1, Aborted: 0.

!!!FAILED!!!

1) FAILED: 'Display is wrong: expected 41, got 42' in scripts/test_addition.pact at 'CheckDisplayReads 41', line 37

PerlActor is inspired by a similar open source framework for Java called 'exactor' published by eXoftware [see http://exactor.sourceforge.net/].


EditText of this page (last edited May 18, 2005) or FindPage with title or text search