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.
XP mandates that the Customer writes acceptance tests for the application under development. The acceptance tests, also known as customer tests, demonstrate that application features are complete and that they work as expected. Ideally, the tests should be directly executable and automated so that they can be run continuously, without manual effort.
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 result. The developers provide glue code to implement 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:
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', initially 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:
.....
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:
.F...
1.24811 wallclock secs ( 0.47 usr + 0.07 sys = 0.54 CPU)
Run: 5, Passed: 4, Failed: 1, Aborted: 0.
!!!FAILED!!!
CREDITS
PerlActor is inspired by a similar open source framework for Java called 'exactor' published by eXoftware [see http://exactor.sourceforge.net/].
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Test::Unit - needed for running PerlActor's own unit test suite.
(Note: Test::Unit 0.24 does not seem to install from CPAN without doing 'force install Test::Unit'.)
COPYRIGHT AND LICENCE
Copyright (C) 2005 by Tony Byrne
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.