Fitter

From LaughingPanda

Contents

Fitter

Fitter is a framework for functional tests. It is fully inspired by Ward Cunningham's FIT, but with a twist. Instead of focusing on letting customers write functional tests, Fitter tests are authored solely by programmers. Fitter is meant to be used for Test-Driven Development with functional tests.

See the following blog entry for background information: http://kaksles.wordpress.com/2006/05/01/analytical-design-for-driving-test-granularity-in-tdd/

1. Write your first programmer tests as high-level acceptance tests,

2. and when making them pass, don't hesitate to step down to lower levels of analysis when encountering new non-trivial concepts or functionality that warrant more focused tests.

Installation


<repositories>
  <repository>
    <id>laughing-panda</id>
    <name>Laughing Panda</name>
    <url>http://www.laughingpanda.org/maven2/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>fitter</groupId>
    <artifactId>fitter-XXX</artifactId>
    <version>0.3.0</version>
  </dependency>
</dependencies>

Where 'XXX' is either 'junit4' or 'testng'.

Jars can be downloaded manually too from:

Requirements

  • Java: 5, 6, ...

Usage

Functional test is specified by creating a file with '.ft' extension. The syntax is similar as in FitNesse. Example Division.ft and Division.java:


|eg.Division|
|numerator|denominator|quotient?|
|10       |2          |5        |

package eg;

public class Division {
    public float numerator;
    public float denominator;

    public float quotient() {
        return numerator / denominator;
    }
}

The tests can be run with a selected launcher which integrates with a unit test tool. We currently support JUnit 4 and TestNG, JUnit 3 integration is work in progress (and is very similar to JUnit4 integration).

JUnit4 example:


@RunWith(AllTests.class)
public class FunctionalTests {
    public static Test suite() {
        return new FitterSuite("FunctionalTests", "path/to/tests");
    }
}

TestNG example:


<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Tests" verbose="1">
  <test name="Functional Tests" >
    <parameter name="rootDir" value="path/to/tests"/>
    <classes>
      <class name="fitter.testng.FitterFactory"/>
    </classes>
  </test>
</suite>

Resources

Developers

  • Pekka Enberg
  • Joni Freeman

Bugs/RFEs

Version Control

License

Copyright by 2006 original author or authors

Fitter is Licensed under the Apache License, Version 2.0. Please refer to the URL http://www.apache.org/licenses/LICENSE-2.0 for details.