I’m doing a lot with FitNesse lately, and it’s going quite well. Unit testing ensures that each component is doing what it is supposed to, and integration testing ensures that the components work well together. Acceptance tests are a bit different. They actually test that the software does what the customers think it’s doing. They test that the developer understood the business need. They give the customer (or product manager) assurance that the system actually works.

With FitNesse, our product manager (and crew) can use a simple wiki to exercise the system. The developers create test Fixtures that speak in the domain language but actually exercise the system under test. A user may type:

This simple table is enough to actually exercise the system under test and get it to do something. If all is well, the Emailer will send a default email. If this test fails, it saves the company from a black eye when a user encounters the problem.

It was a little tricky to get the FitNesse test integrated with our CC.Net build. We wanted the acceptance test to be a current status report of where we are. When all the acceptance tests are passing, we are done. Consequently, we didn’t want failing acceptance tests to break the build. Only NUnit tests break the build because they should _always_ be passing. No problem. We create a new target with some exec tasks:

This will actually call the FitNesse server (with the wiki on it) and execute all the acceptance tests. This will produce a file in the raw FitNesse format. We’d like it in xml so we can incorporate it in the CC.Net build report. Xml transforming isn’t a part of the .Net port, but it is in the Java version, so we’ll just use it.

This hooks into the transform logic on the FitNesse server to change our raw output file to a nice Xml format. Now we have something that CruiseControl.Net can use for a build report and email. We will have to make an Xsl, though. Here’s a simple Xsl that will pull out the FitNesse summary information and through it out to your CC.Net build summary:

Hook this Xsl into your CC.Net configuration, and that’s as hard as it is! FitNesse results “magically” show up in the build summary. It’s really a big win for visibility into the state of the software. The build summary is now the actual status report of the software, and it’s not subjective. What does 83% actually mean? With a list of acceptance tests to fulfill, we know exactly when we are done.

Related

Chris Gardner
10:13 pm on September 16, 2005

Thanks for putting this script together. I had to tweak, though, to get it to work with CruiseControl (did not try it with CC.Net). Here are my changes. Hopefully they won’t get corrupted in this post.

We started out running it manually, but now we’ve integrated it with ServiceAny that allows any command to be run as a service. Another option we considered was using the Windows scheduler to ensure that it is always running.

Hi Jeffrey, as always, thinks are not crystal clear.
What do you mean by “Hook this Xsl into your CC.Net configuration”?
CC.net 1.3 already comes with fitnesse.xsl and fit.xsl.
And I still cannot see the Fitnesse summary into CruiseControl dashboard…
Anyhow, you did a great job!

Chandu
3:54 pm on March 17, 2008

Hi All,

Can anyone please tell me how to convert the Fitnesse output to HTML format??