ASML - a modeling tool for testing
John Tobler talks
a bit about Abstract State Machine Language (ASML) on his blog. This is
actually a really cool technology – one my test team has been looking at for a little
while now, and one that I personally have been struggling to wrap my mind around.
At first I thought it was a test-case generator; we have other state-based tools here
at Microsoft that do that kind of work, so that is where my mind goes when I think
about “state machine” tools. However, I’ve come to realize that its true role
(ok, one of its true roles) is as an oracle.
Suppose you write a test, and want to check if the result is correct. How do
you know? If you hand-wrote the test, then you probably “know” the expected
result. But if you automatically generate thousands of test cases, it gets harder.
What you really want is a second, completely independent version of the program, whose
results you can compare to the real program. This second source of expected
test results is what testers call an ‘oracle’. ASML is a computer language (a
.NET language, even) that lets you write that oracle really fast. The oracle
will encapsulate the broad strokes of the real thing, while likely glossing over a
few of the details – but its close enough to serve as a good point of comparison against
the production code. Thus your ASML program is a ‘model’ of the real thing.
It’s a really cool concept, especially since the more I do this testing thing, the
more I realize that automation is the only way to fly. Being clever about the
automation and about choosing what to test is the future of software testing.
Another role of ASML is as a spec validator; the process of implementing your spec
in ASML can show spec flaws a lot faster than doing so in a production development
effort.
Another super-cool thing about ASML is that it is a full-fledged .NET language, so
it has access to the whole .NET Framework. It’s a real programming language,
and you can write real programs with it. I have a colleague who has an exercise
he does to learn a new programming language; he writes ‘Tetris’ in that language.
I’ve seen a functional version of Tetris written in ASML.