Title: FIT
1FIT
- Framework for Integrated Testing
- Roy Osherove
- Sela Group
- Royo_at_Sela.co.il
2Why?
- Acceptance tests by customers
- Automation
- Readability and Test Cases
- Executable Requirements
- Above Unit Tests
3The FIT Framework
- Customer Testing
- Uses HTML Tables
- Allows testing flows
- Requires Adapter classes to execute the system
under test
4HTML Document (Tables)
FitRunner
Results (Xml, Html)
5Specification Document
Text.
Html Table.
Text.
Text.
6Mapping Test To Code
Class MyClassColumnFixture Public int
Num1 Public int Num2 Public int
Result() return new Calculator.Add(Num1,Num2)
7Fit Engine
MyClassFixture
ProductionCode
ProductionCode
DB
8From Fit to Fitnesse
- Fit Testing Engine
- Fitnesse Wiki that uses the FIT Engine
- Wiki Shared Information, editable by anyone
9Fitnesse
- Manage HTML Tests and documentation
- Requirements
- Create Test Hierarchies
- Built with Java
- Runs .NET
10- Using Fitnesse as Wiki
- (ColumnFixture)
11Types of Fixtures
- Column Fixture
- RowFixture
- ActionFixture
- DoFixture
12ColumnFixture
Class MyClassColumnFixture Public int
Num1 Public int Num2 Public int
Result() return new Calculator.Add(Num1,Num2)
13RowFixture
public class ListActiveUsersfit.RowFixture
public override object Query() return
User.GetAll()
14 15ActionFixture
public class RegistrationScriptfit.Fixture
public string name private CustomerDatabase cd
new CustomerDatabase() private int
customerId public void Register() customerIdcd.
Register(new Customer(name)) public bool
IsCheckPending() return cd.IsCheckPending(custome
rId) public bool IsApproved() return
cd.GetCustomer(customerId).approved public
string GetStoredName() return cd.GetCustomer(cust
omerId).name public void Approve() cd.Approve(
)
16 17Example ActionFixture in Fitnesse
!ActionFixture startNetFit.RegistrationScript
enternameJango Fett pressregister checkg
etStoredNameJango Fett checkisCheckPendingtru
e checkisApprovedfalse pressapprove check
isCheckPendingfalse checkisApprovedtrue
18DoFixture
public class MyClassDoFixture Public int
LastSum Public void AddTo(int a, int
b) LastSum new Calculator.Add(a,b) Public
void SendMessageWithBodyAndSubjectTo(string
body, string subject,string to) MailMessage
mm .....
19 20Types of Fixtures
- Column Fixture Testing values easily
- RowFixture Batch comparisons
- ActionFixture Complex Scripts
- DoFixture Your own test language
21Test Hierarchies and flow
- Wiki
- SubWiki (Test Suite)
- MyTestPage.Setup
- MyTestPage (Test and text)
- MyTestPage.TearDown
22Installing Fitnesse
- JRE 1.5
- Unzip fitnesse to the server
- Run run.bat (edit to include p port)
- Go to server http//serverport
- Create first test by going to
- http//serverport/YourNewTestPage
23Fitnesse Process
- Create stories in fitnesse
- Create examples (tests) in fitness
- Dont run them
- Create the code with TDD and unit tests
- As the code is built, run the FIT examples
24Resources
- Official Java docs http//www.FitNesse.org
- Fit Docs
- http//fit.c2.com/
- Fitnesse yahoo group
- http//tech.groups.yahoo.com/group/fitnesse/
- FitLibrary
- http//fitlibrary.sourceforge.net/
- FIT for developing software (book)
25Questions?
26(No Transcript)