| Path: | ReadMe.txt |
| Last Update: | Sun Oct 01 10:05:42 EDT 2006 |
Given a Cogswell state machine definition, including test vectors that generate events that pass and fail the transition guards, Alchemist examines the shortest traversal that covers all the guards, and uses this to build a sequence of Touchstone tests.
The shortest traversal is found by the solution to the directed Chinese postman problem (Mei-Ko Kwan, Graphic Programming Using Odd or Even Points, Chinese Math., 1:273-277, 1962), as found by Harold Thimbleby’s Java code at www.uclic.ucl.ac.uk/harold/cpp.
State machines defined using Cogswell can be partitioned into multiple scenarios. These state machines have test vectors that generate events which pass or fail guards. Alchemist generates test definitions from the state machines. The test definitions are run by Touchstone. The tests verify the option of a System which is assembled by Trimurti from components.
Alchemist holds one state machine that it uses to define tests. It also holds a Touchstone::System, where the tests are put. The Alchemist delegates determination of the shortest complete test sequence to a DirectedPostman.
Alchemist and documentation are currently previews, which have not yet undergone internal reviews. Alchemist is actively being used.
Alchemist can be downloaded in several forms:
cd $DevRoot/Projects/Alchemist
rake install_lib
You should start by defining a Cogswell state machine describing the system you want to test. This can be done in YAML or in code: please see the Cogswell documentation. The state machine Transitions need to include test vectors that pass or fail the guards. You can then build the tests, and execute them immediately, or save them in YAML form for later execution.
require 'nist/alchemist'
machine = nil
File.open('Cogswell_Telephone_Default.yml') {|f|
machine = Cogswell::Machine.load(f)
}
builder = Alchemist.new(machine)
# Build the tests
builder.build('Telewerks', 'Complete')
# Save a graph of the tests (view it with GraphViz):
builder.save_dot('Telephone_Test.dot')
# Save the tests for execution by Touchstone:
builder.save_yaml('Telephone_Test.yml')
Integration with Trimurti could be improved.
Currently mock objects can be used, but there are no helpers to simplify this. If you are interested in mocks, you might want to look into:
Official contribution of the National Institute of Standards and Technology; not subject to copyright in the United States. Certain commercial equipment, instruments, or materials are identified in this paper to foster understanding. Such identification does not imply recommendation or endorsement by the National Institute of Standards and Technology, nor does it imply that the materials or equipment identified are necessarily the best available for the purpose.