Wed, 07 Apr 2004
Inline comments in Fit
Part of a series on
FIT
extensions and stylistic tricks.
One of the nice things about FIT is that you can interweave
explanatory text with tables that serve as both examples and tests:
A clinician can have the clinic absorb some charges. Perhaps a test was done only for educational purposes, or the animal stayed an extra day.
AnimalProgressFixture
Note: this is a StepFixture.
|
new case
|
2353
|
Peoria |
|
order
|
intensive care
|
|
|
charge
|
100
|
|
|
charge
|
900
|
clinic
|
|
check
|
balance
|
1000
|
|
check
|
balance
|
clinic
|
900 |
check
|
balance
|
Peoria
|
100
|
...
|
|
|
|
Certain charges are always paid by the state.
AnimalProgressFixture
|
...
|
|
|
|
|
I love that. (See also Mark Miller's
Updoc,
which is used with a scripting-ish language
called E.)
I also find it useful to put "inline" comments in my tests. I do
that by taking advantage of the way that Fit stops looking at table
cells when it sees the first empty one in a left-to-right scan. So
I leave a blank cell and write a comment in the next
one. Here's the above test, so annotated:
AnimalProgressFixture
|
new case
|
2353
|
Peoria |
|
|
order
|
intensive care
|
|
|
|
charge
|
100
|
|
|
Normal diagnostics yield nothing, but the clinician wants
to press on...
|
charge
|
900
|
clinic
|
|
Absorb excess diagnosis charge.
|
...
|
|
|
|
|
I think this sort of thing is useful, particularly for step-by-step
tests, because it helps the test tell a story, helps it make sense
in business terms to both the reader and the writer.
## Posted at 14:26 in category /fit
[permalink]
[top]
PLoP 2004 reminder
The PLoP 2004 submission deadline is rapidly approaching.
## Posted at 07:02 in category /misc
[permalink]
[top]
Using XML for Ant
The Ant inventor
reflects:
If I knew then what I know now, I would have tried using a real
scripting language, such as JavaScript via the Rhino component or
Python via JPython, with bindings to Java objects which implemented
the functionality expressed in todays tasks. Then, there would be a
first class way to express logic and we wouldn't be stuck with XML as
a format that is too bulky for the way that people really want to use
the tool.
Or maybe I should have just written a simple tree based text format
that captured just what was needed to express a project and no more
and which would avoid the temptation for people to want to build a
Turing complete scripting environment out of Ant build files.
Both of these approaches would have meant more work for me at the
time, but the result might have been better for the tens of thousands
of people who use and edit Ant build files every day.
(Via Keith Ray.)
## Posted at 06:57 in category /misc
[permalink]
[top]
Big Visible Things
Alberto Savoia
describes
some clever and fun feedback devices. Scroll through to look at the
pictures, then read the text.
## Posted at 06:51 in category /agile
[permalink]
[top]
|