If you haven’t heard of FIT yet, you need to know about it. FIT is an open source framework that allows you to add and execute complex tests from a simple web interface.

The requirements of FIT are pretty basic.
- You need Apache installed on the machine
- You need to be able to edit httpd.conf to give the FIT folder execution rights
- If you’re using Perl, you need to install Test::FIT

FIT works with a variety of languages, though I’ve only used it in Perl. The premise is simple:

  1. Expose your test suite to a web page via a simple HTML table.
  2. Use input and output terms that non-technical folks (customers, PMs,etc) can understand.
  3. Write a simple “fixture” that acts as the glue between the web page and the backend code that will execute the test (or just have your fixture execute the test).
  4. Expose all the test results in a simple “green means pass, red means fail” format that anyone can understand.
  5. Let everyone in the company contribute to the testing process by adding and executing tests along with the QA/testing group.

Some may cringe at the idea of allowing anyone in the company to write and execute tests but, trust me, its a good idea. Trust me. FIT is:

  • Agile friendly (used commonly in Scrum and eXtreme programming environments)
  • It will allow your users/customers to continue to clarify their expected behaviors by understanding what inputs and outputs are important to them.
  • It allows anyone in the team/company to execute tests and immediately see results which lowers workload on QA and increases confidence by other stakeholders
  • Its easy to set up, easy to maintain

Here is a quick example of a FIT test, unfortunately I can’t build a live version for you because FIT isn’t installed on my web host’s servers:

MathFixture
Input1 Input2 InputSums
7 4 11
3 2 5
7 7 17

The table above is what a standard FIT page may look like. You have a standard HTML table with a Fixture name listed in the first row. The second row contains column names which will correspond to subroutines within your Fixture. All subsequent rows correspond to test inputs and expected outputs.

The fixture files themselves are simple. As they can be written in may languages, I’m not going to include a completely accurate example here, but this is a bit of what a basic Fixture in Perl may look like:

package MathFixture;
use Test::Fit;attribute(’Input1′);
attribute(’Input2′);sub InputSums {
$sum = $Input1 + $Input2;
return $sum;
}1;

It really is as simple as that. The package name must match the first row of the FIT test table. The inputs must be treated as incoming variables to the script. Subroutines much exist for each output value that you are going to calculate. The subroutines much return a value equal to the output you expect based on the test table.If you haven’t tried fit yet, I strongly recommend you give it a shot. Its a great tool, works pretty well out of the box, and is a great way to extend your testing resources to other people in the company.

During my time in Quality Assurance, one of the most important things I’ve learned is that understanding what the customer expects and testing for that is paramount. With a tool like FIT, your customers (be it external customers, marketing, or product management) can write tests directly into the tables allowing you to quickly build a functional, replicable, archivable regression suite that you can use in the future.