Jan 18 2008
Test Driven .NET Development With FitNesse
“This book fills a big gap that’s kept a lot of people from using Fit successfully.”
– Mike Stockdale, author of FitNesse.NET
Buy online at Amazon.com, Barnes and Noble, Lulu.com or Buy the PDF
Table of contents
Errata
Source code for the examples
Register your book
Sample chapter
This book takes you on a journey through the wonderful world of FitNesse, a great web-based collaboration tool for software acceptance testing. FitNesse enables software developers and business people to build a shared understanding of the domain and helps produce software that is genuinely fit for purpose.
The book is primarily aimed at .NET developers interested in starting with TDD and those who already practise unit testing and want to move beyond that into development driven by acceptance tests. Java developers can also benefit from the third part of this book, which presents best practices for using FitNesse in a team environment and integrating FitNesse into the wider software development ecosystem, including web and database tests.
Test Driven .NET Development with FitNesse provides practical advice for solving real-world problems, based on experience from several big .NET projects. Here are some of the topics covered in this book:
- Applying test-driven development principles and practices to guide projects and improve the quality of code
- Writing FitNesse tests for .NET code effectively
- Getting customers involved in testing
- Building a shared understanding between business people and developers using acceptance tests
- Setting up and managing FitNesse in a team environment
- Using FitNesse and Selenium for Web interface testing
- Testing legacy code and databases
- Extending FitNesse to meet your particular project needs
- Understanding how FIT and FitNesse work under the hood
For more information, see the Table of contents.
Register your book
Register your book to get free PDF updates and notifications about corrections and new editions of this book. Your e-mail will only be used to send information related to this book and not for anything else.
32 Responses to “Test Driven .NET Development With FitNesse”




I dont know fitnesse but i find the book interesting and am a java developer. Is fitness.net a direct port of fitness for java?
Do you plan to do a java port of this book as well ?
I will definitely buy the book if you do so.
Hi Karthik,
fitnesse.net is a test runner enabling you to run .NET tests from FitNesse. the same FitNesse server is used for both, and a lot of advice from the book can be applied to Java straight away. See http://fitnesse.info/fit_framework_implementation_differences for a quick list of differences between Java and .NET features.
I was not really planning to do a Java version of the book, as there is a lot of good information on how to use FitNesse for Java tests on http://www.fitnesse.org. I was planning, however, to point out .NET specific features better in the next version, so that Java developers what they can use.
Hi,
Is it easy to use with PHP project ?
@sph75,
As far as I know, there is no PHP test runner for FitNesse
On page 21 you mention that you can edit the test site home page by clicking the edit link. I see no such link at http://localhost:8888/ Am I missing something? Everything else so far is working properly.
Hi Tad,
default page properties change from release to release, so you might not be seeing the edit button there. You can add it in page properties (click on properties button on the left). if you do not see that as well, you can go to the url directly, just append ?properties to the page name. So, the home page properties are on
http://localhost:8888/FrontPage?properties
you can edit the home page directly using the url
http://localhost:8888/FrontPage?edit
Hello, there.
I bought your book and I have gone through the chapter examples.
I am having a problem though and I think is more a fit problem than my own.
I have a column fixture test which sometimes does not pass the values to the code. I notice that if I change the column positions, it works. but then after a few tests it does the same.
Have you ever experienced this?
regards,
Adriano
Hi Adriano,
can you send me the code and the page?
[...] at Fitnesse.NET for a while; if you have not come across this testing tool I cannot recommend Gojko Adzic book highly enough; an excellent real world introduction to [...]
hi Gojko,
I am trying to use Fitnesse in c# integration testing, however I have some
questions regarding how to prepare the data in WIKI.
Let me explain my situation here.
once the domain service is ready, QA can start testing. Let’s take CreateMember method as an example. There are three DTO in Createmember method, UserDTO,AccountDTO and ProductDTO.
in UserDTO, contains user’s information, such as name, age, birthdate and contact information,
in AccountDto, set up this user is credit/cash, credit limit, something like that.
in ProductDto, configure which product used and what kind of revenue model.
1. problem is that, Some of these properties’ values come from the UI, so BA and customers can provide such data in the Wiki page, however, some values maybe come from the App layer, so it’s backend operation, User have no idear about that.
my question is, in this case,how to write wiki page for BA and Customer ?
2. for this create member, we need select under which company create this member.
in the createmember method, we need provide CompanyAccountID, however in UI, ask user to select Companyname.
my question is, if use Fitnesse for this case, does it mean, write Company name in the wiki page, however in the fixtures code, we get CompanyAccountID by company name provided in wiki page, and pass to Create member method??
3. last question, I am really want to know the working process for the whole project team. if Based on my understanding, dev team must finish domain service, at least, finish defining the interface, then the BA and customer can start write wiki page.
in the same time, domain team can finish web service, and they or QA team can start write fixtures code.
then try to run test to know the test result, is it right? can u tell me the real situation regarding the work process? thanks.
i am looking forward to your answers. thanks
thanks
Lala
in other words, if the design for the interface is not decided yet, seems cannot start writing wiki,right? in our situation, the interface is changed frequently, maybe it’s requirement change, maybe it’s real design change, if so, how to use fitnesse to catch up the fast agile web development??
Hi Lala,
FitNesse is best used to define acceptance tests before any code is written – examples of how the system should behave once it is complete. those examples/tests are then used as a target for development. Watch the video on http://gojko.net/2008/09/19/agile-acceptance-testing-video/ for a general introduction on how this all fits together into the development process.
As a general rule of thumb, FitNesse fixtures should connect to the business domain services, not necessarily to DAO objects directly. They should work under the user interface. So it does not matter if the user interface is not yet defined, FitNesse tests will help you define business services.
Hi Gojko,
I haven’t bought a copy of this book yet, however planning to buy it soon.
Can you tell me please if Fit supports all the version of .Net framework?
fit.net runner supports 2.0 onwards. there are earlier versions which support 1.1 as well, but that code is no longer maintained.
Thanks Gojo for the quick responce.
I am referring to the RowFixture on http://www.fitnesse.info/fixturegallery and trying to implement it for .Net. I successfully compiled the code for set-up fixture and row fixture and I got the setup fixture working on wiki page however the Rofixture is giving me following error-
System.ApplicationException: Couldn’t cast RowFixtureTest to Fixture.
Can you please advice if there is something I am not doing right
Thanks
there are two possible causes:
1. your class RowFixtureTest is not a fixture
2. you are using the latest package of fitnesse which comes with an outdated test runner and have not upgraded the fitnesse.net test runner to the latest version
I downloaded and installed the testrunner from Rel 1.8 which is the latest one available for .Net 2.0 and onwards.
and here is my compiled class-
using System;
using System.Collections.Generic;
using System.Text;
public class RowFixtureTest: fit.RowFixture
{
public override Type GetTargetClass()
{
return typeof(Player);
}
public override object[] Query()
{
return Player.players.ToArray();
}
}
have you replaced the DLLs in fitnesse dotnet folders with the 1.8 test runner?
I think I made it more worst by downloading the .dll again. Now the things which were working earlier are giving errors:not sure how do I roll back
System.TypeLoadException: Could not load type ‘fitlibrary.XmlFixture’ from assembly ‘FitLibrary, Version=1.4.3183.38422, Culture=neutral, PublicKeyToken=null’.
at System.Reflection.Assembly._GetExportedTypes()
at System.Reflection.Assembly.GetExportedTypes()
at fit.Assemblies.FindType(TypeName theName)
at fit.TypeName.get_Type()
at fit.StoryTest.DoTables()
Ok, I am all good now, I had that that eg.dll copied into the folder which was conflicting with my dll. I have everything working now….
thanks!
Just got into DbFit and we feel very excited..we have stored procedures with over 100 input parameters and it has become a nightmare to test various scenarios..we think we may get to like this….
But after a few hours we ran into a problem that some of our SPs make calls to assemblies and to third party components. The duration of this is often greater than your default page timeout…where can one extend the timeout of the test page or other significant properties?
Thanks anyway for a great tool….
page timeout is not enforced by fitnesse (the test runner), so the timeout is coming from the db side. can you tweak it in the connection string?
Hi,
I am looking forward to get some help connecting to the database. Is there a standard format I can use?
Thanks!
DbFit is a good library to connect to the database from fitnesse. An early version of DbFit is described in the book, and there are also some good guides on my web site and on http://www.fitnesse.info/dbfit
awesome , thank you
A question , how complex queries does dbfit supports? I have a long query which works in DB however gives error on fitnesse page. Is there a specific format to write complex queries in fitnesse?
Thanks!
dbfit just passes the queries to the database, so whatever your driver supports, dbfit supports as well. if you want to use multi-line queries or special characters such as |, you might want to escape them. see the dbfit doc for an example.
Hi,
Is it possible to use cross reference query which involves 2 different databses? if so how do I need to modify my connect command to include both dabases? Thanks!
Chanakya,
this depends on your database system. in oracle, you can have queries executing on tables from different systems using db links. in general, dbfit uses the underlying db driver technology. it does not try to do any fancy tricks. so if you can execute the query across 2 different databases using java or .net with the same driver, you can do it using dbfit as well.
Hi, I am trying to test a storedprocedure using following format:
!|Execute Procedure|[ProcedureName]
|PersonID|TypeID|ID?|
|888812|6|112121|
But, it is not recognizing the output value ID? and my procedure is giving an error.
what could be possible reason. I do have all the rights to the database I am connecting to and I can execute rest of the queries just fine.
Chanakya – what is the signature of the procedure. does it actually have an output argument ID or are you just returning the default output argument in SQL Server?
It is set to return an integer. In SQL it does return proper output with the required result in a row.