Jump to content

FitNesse

From Alfawiki
Adapted from the English Wikipedia article FitNesse, available under CC BY-SA 4.0Updated 9 August 2025
FitNesse
Company typeSoftware platform
IndustrySoftware testing, software development
PredecessorFramework for Integrated Test
FounderMicah Martin
Area served
Worldwide
Key people
Micah Martin, Robert C. Martin
ProductsAutomated testing platform, Wiki server
Websitefitnesse.org

FitNesse functions as a combined web server, wiki, and automated testing platform tailored for software development, inspired by Ward Cunningham's Framework for Integrated Test. It facilitates acceptance testing by allowing comprehensive and clear articulation of system functionalities.

The system accepts specially formatted inputs designed to be accessible to users without programming expertise; these inputs are processed to automatically generate and run tests, delivering prompt feedback. Developers contribute by creating "fixture" classes that adhere to defined standards.

Originally developed in Java by Micah Martin, with contributions from Robert C. Martin and others, FitNesse began with exclusive support for Java. It has since expanded to accommodate multiple programming languages including C++, Python, Ruby, Delphi, and C# among others.

FitNesse as a testing approach

FitNesse acts as an intuitive front-end for the Fit framework, created to support an agile methodology focused on black-box acceptance and regression testing. In this model, functional testers collaborate closely with developers to assemble test suites.

The testing perspective treats the application as a black box, emphasizing the verification of outputs generated from specified inputs. Testers design test cases within FitNesse, while developers implement connections between the tool and the system under examination to enable execution and output validation.

This cooperative strategy nurtures mutual understanding between testers and developers by establishing a shared vocabulary for articulating system requirements efficiently.

FitNesse as a testing application

In FitNesse, tests are defined as pairs of inputs and expected results, primarily represented through various forms of decision tables. These include literal decision tables, tables that execute queries, as well as scripted stepwise tables. All tests are displayed in tabular format.

The tool focuses on simplifying test creation, allowing both testers and developers to concentrate on improving quality rather than dealing with execution complexities. This simplicity is achieved through three key elements:

  • Straightforward table construction.
  • Seamless conversion of tables into system calls.
  • Versatile documentation of tests.

To support these objectives, FitNesse employs a wiki-based approach that enables rapid generation of HTML pages and tables. The underlying WikiWiki syntax offers an ideal interface: it permits flexible table structures while limiting content to basic alphanumeric text easily mapped to software functions. Each test corresponds to a wiki page, enabling testers to combine descriptive narratives with test tables for comprehensive documentation.

FitNesse as a software solution

Built using Java, FitNesse is packaged as a single executable jar file encompassing a wiki engine, an embedded web server, a testing engine, and all essential resources such as images and stylesheets to maintain a uniform web interface.

Ease of use is central to FitNesse’s design: starting the application launches a lightweight embedded web server that serves test pages locally or remotely via the Internet. The wiki engine operates without requiring a database by storing pages as files interpreted dynamically by the server.

The default wiki setup includes the FitNesse user manual and sample content along with all components necessary for publishing a fully styled wiki within FitNesse’s framework. The core wiki engine provides standard capabilities including search engine, revision history, file operations like deletion, relocation, renaming, and test-specific features such as buttons for running tests, defining individual tests or suites, and historic overviews of test results for trend monitoring. Additionally, it incorporates fundamental security measures for page locking and controlling access permissions within the wiki environment.

Test execution

A FitNesse test comprises four essential elements:

  • The wiki page that represents the test using a decision table format.
  • A test engine responsible for interpreting the wiki content.
  • A test fixture called by the engine, which interacts with the system under evaluation.
  • The actual system being tested.

From a development standpoint, two main artifacts are created: the wiki page and the fixture. The wiki page usually features a decision table outlining the test scenarios. For instance, a test for a division module might be structured as follows:

Division module test
Numerator value Denominator value Result?
10 2 5.0
10 5 2.0
5 2 2.5

The connection between the testing engine and the target system is established via a Java fixture class. An example fixture for this scenario could be:

<syntaxhighlight lang="java"> public class DivisionComponentTest extends ColumnFixture {

   private double num;
   private double denom;
   public void setNumeratorValue(double numerator) {
       num = numerator;
   }
   public void setDenominatorValue(double denominator) {
       denom = denominator;
   }
   public double result() {
       return SystemUnderTest.divide(num, denom);
   }

} </syntaxhighlight>

The translation from wiki table headers to fixture methods follows a convert-to-camel case rule. Columns ending with a question mark represent output values retrieved from the fixture, while others serve as input parameters. Fixture methods are invoked sequentially from left to right according to column order.

Testing engines

FitNesse offers two distinct testing engines: Fit and SLIM.

Fit

Fit serves as both a testing framework and engine, combining test execution, wiki parsing, and result reporting into one package. Initially, FitNesse was developed on top of Fit, which influenced its naming.

Nonetheless, Fit merges several responsibilities instead of separating them, requiring fixtures to extend Fit base classes. This dependency restricts Java developers due to single inheritance limitations and produces fixtures that tend to be bulky. These constraints have encouraged FitNesse's transition toward the more flexible and modular SLIM engine.

SLIM

SLIM (Simple List Invocation Method) provides an alternative testing engine implementing the Slim Protocol. Unlike Fit, SLIM focuses exclusively on invoking fixtures and runs as an independent server accessed remotely by the FitNesse wiki engine. The wiki engine manages parsing and result presentation.

SLIM enables lightweight fixtures built as plain POJOs without needing to inherit from or couple with framework classes, thereby simplifying fixture design and allowing developers to concentrate on thorough system testing. This method also supports fixture inheritance hierarchies when necessary.

See also

Bibliography

External links