This is an introduction to the framework and its implied methodology intended for technical people with a general understanding of ExtremeProgramming practices. This talk will be presented by the author.
You can read these slides as a single wiki page or step through them as a presentation. Use this link for the presentation. Adjust your browser for 14 point fonts with 2x text magification on a 1024 x 768 window.
Framework for Integrated Test
x p d x
Ward Cunningham
October 1, 2002
Integrated Tests
We desire, and the framework enables, integration at two levels.
- Check facts at every program interface.
- Share facts with every group.
Structured Exploration
Group method based on aligned interests.
- Specification that is as agile as the code.
- All that wonder are not lost.
TestFirstDesign
Let automated tests guide programming.
- Formal supplement to communication
- Written before program works
- Apply to whole system and its parts.
UnitTests
Programmers communicate with code and unit tests.
- Written in programming language
- 100% pass before check-in
- Enables collective ownership
- Enables relentless refactoring
AcceptanceTests
Customers communicate with stories and acceptance tests.
- Written in words and facts
- 100% pass before iteration over
- Shows expectation (simplicity)
- Shows visible progress (confidence)
"Fit" Style Acceptance Tests
- Scrape tables from html docs
- Keep stories & tests together
- Browse results online
SimpleExample
eg.ArithmeticFixture |
x | y | x + y | x - y | x * y | x / y |
200 | 300 | 500 | -100 | 60000 | 0 |
400 | 20 | 420 | 380 | 8000 | 20 |
http:run.cgi
Words and Facts
DataDriven tests embedded in web documents.
- Understandable by everyone
- Examples ground concepts
- Checked against program automatically
Part 1 -- The Specification
Division shall work with positive and negative numbers. http:run.cgi
eg.Division |
numerator | denominator | quotient() |
1000 | 10 | 100.0000 |
-1000 | 10 | -100.0000 |
1000 | 7 | 142.8571 |
1000 | .001 | 1000000 |
4195835 | 3145729 | 1.3338196 |
Part 2 -- The Fixture
This is how we divide in Java.
class Division extends ColumnFixture {
float numerator;
float denominator;
float quotient() {
return numerator / denominator;
}
}
Reflection to Instantiate Fixture
eg.Division |
numerator | denominator | quotient() |
class Division extends ColumnFixture {
float numerator;
float denominator;
float quotient() {
return numerator / denominator;
}
Reflection to Set Fields
eg.Division |
numerator | denominator | quotient() |
class Division extends ColumnFixture {
float numerator;
float denominator;
float quotient() {
return numerator / denominator;
}
Reflection to Check Methods
eg.Division |
numerator | denominator | quotient() |
class Division extends ColumnFixture {
float numerator;
float denominator;
float quotient() {
return numerator / denominator;
}
Kinds of Fixtures
Experience has shown there to be three kinds of fixtures.
ColumnFixture
Reflects on a single fixture that runs all the cases.
RowFixture
Reflects on domain objects retrieved by the fixture.
ActionFixture
Reflects on "screen" fixtures instantiated by the main fixture.
MusicExample
http:run.cgi
fit.ActionFixture |
start | eg.music.Browser | |
enter | library | Source/eg/music/Music.txt |
check | total songs | 37 |
enter | select | 1 |
check | title | Akila |
check | artist | Toure Kunda |
enter | select | 2 |
check | title | American Tango |
check | artist | Weather Report |
check | album | Mysterious Traveller |
check | year | 1974 |
check | time | 3.70 |
check | track | 2 of 7 |
ParsingTables
Parse nodes correspond to paired tags with surrounding text. Parsing recurses on both body and trailer with results stored in parts and more respectively.
leader <TABLE> body </TABLE> trailer
WebPageExample
We can use the same parser to parse application html. http:run.cgi
fit.ActionFixture |
start | eg.Page | |
enter | location | http://google.com |
check | title | Google |
enter | link | Jobs |
check | title | About Google |
enter | link | Press |
enter | link | Review |
check | title | Google Press Room |
FrameworkHistory
This implementation builds on four previous implementations.
- Wyatt Software
- ThoughtWorks
- Role Model Software
- Vulcan
ReadMore
The web site http://fit.c2.com all these examples plus downloads and more documentation.