Mar 28 2008
FitNesse Workshop — key ideas
First of all, here is a big thank you to everyone who attended the FitNesse workshop at skillsmatter today. It was a real pleasure to do the session and I hope that you learned a few new tricks. Here are the key ideas to take away:
Agile acceptance testing
- It’s not about testing at all — it is more about flushing out enough examples before development, and using those examples as a target for work.
- It’s about building a shared understanding and making sure that everyone on the project has the same target in their minds
- User stories are the scope for development, (acceptance) story tests are the specifications.
- Business people, developers and QA all have different things on their mind, and view the system from different angles. Get them all to work together to produce the best results. Business people will have a better overview of the domain, developers will spot inconsistencies and QA engineers will suggest edge cases that should be verified.
- Describe-Demonstrate-Develop is a great way to think about the whole process
- Unit tests and acceptance tests complement each-other. “xUnit insures the code is built right, and FitNesse insures the right code is built.” (Andrew Dassing on FitNesse Mailing list)
FIT/FitNesse
- Tables describe tests — both inputs and expected outcomes
- FitNesse allows you to manage and execute tests easier, build test suites and organise the tests.
- FitNesse stores tests into text files, and they can be easily stored in the same version control system as the code. Folder-based systems like SVN might have some issues with refactoring, so don’t use FitNesse refactoring when you keep files in Subversion. Also, turn off automatic archiving and property updates (
-e 0 -o)
Writing FitNesse tests
- Start by identifying and analysing the business rules.
- For each rule, roughly decide whether it is more like a tabular calculation rule or a story.
- For tabular calculation rules, use ColumnFixture and CalculateFixture
- For story-like rules, use DoFixture and SequenceFixture. Those fixtures can work in Flow mode and coordinate other fixtures as well.
- Symbols work with FitLibrary in .NET as well, but you have to add this table to the page:
!|Cell Handler Loader| |load|SymbolSaveHandler|FitLibrary| |load|SymbolRecallHandler|FitLibrary|
Writing Fixtures
- Fixtures are a very thin integration layer.
- Use a
public static Parse(string)method to allow FitNesse to automatically bind your domain types to table cells - .NET version supports Target objects that can save a lot of code by not requiring you to re-declare the DTO properties in fixtures.
- Alternating Target Object pattern: use the first column to initialise the target object. All other columns are bound to the target object. Use
Reset()to clean up after a row is executed.
!|Bet placement and payouts| |fields|bet name?|payoff?| |30|Straight Up|35| |11,14|Split Bet|17| |19,20,21|Street Bet|11| |25,26,28,29|Corner Bet|8| |Red|Red Or Black|1| |3rd 12|Dozen|2|
public class BetPlacementAndPayouts:fit.ColumnFixture { public Bet fields; public override void Reset() { fields = null; } public override object GetTargetObject() { if (fields == null) return this; return fields; } } - Use the SetUpFixture instead of ColumnFixture to prepare the data or create new objects
- Use the System Under Test feature of DoFixture and SequenceFixture to bind tables directly to your business services and classes
Update: Download the source code and the missing example
![]() |
![]() |



Great presentation, it was a great introduction to FitNesse and has given me a lot to think about
Hello,
Is there a way to get the presenation soft copy for the webinar. It will be quite helpfull in understanding the video on .net tdd
Hi Rajesh,
You can watch the video here: http://gojko.net/2008/04/02/fitnesse-workshop-video/