FitNesse – Kick-Off

Document Sample
FitNesse – Kick-Off Powered By Docstoc
					FitNesse
On the Road to Success

     By Pierre Veragen
   pierre.veragen@comcast.net
What we will cover today
       What is FitNesse?
           Quick introduction
           How it works


       Different types of tables

       Principles you can use
Fit / FitNesse
   Framework for Integrated Testing
   FitNesse, a wiki using Fit
   Defining Acceptance Tests, checking that “We are
    building the right thing”
   Creating a feedback loop between customers,
    testers and programmers




   Provides a one-click test environment
Now some Demos
   Simple Calculator

   Discount Calculator
How it works
   The text is interpreted so it can trigger the
    fixtures that call the System-Under-Test
    (SUT)
   Fit interprets the results and display
    Pass/Fail in each cell

   Proper syntax is key
   Not so hard to learn…
                         …after you get going
                                                Table, Fit, and
                                               Fixture together



Fixture Class
Public Class CalculatorAsColFixture
  Inherits fit.ColumnFixture                            Fixture and SUT
  Public Number1 As Double
  Public Number2 As Double
                                                        working together
  Private _oSUTCalculator As
DemoSUT.SUTCalculator

  Public Sub New()
    _oSUTCalculator = New                         System Under Test
DemoSUT.SUTCalculator                             Public Class SUTCalculator
  End Sub                                           Public Function Multiply( _
                                                     ByVal firstNumber As Double, _
  Public Function Product() As Double                ByVal secondNumber As Double) _
    Return _oSUTCalculator.Multiply(Number1,         As Double
Number2)                                             Return firstNumber * secondNumber
  End Function                                      End Function
                                                  End Class
End Class
                                                   The Actual Page
What we will cover today
   What is FitNesse?
     Quick introduction

     How it works



 Different     types of tables

   Principles you can use
Different Types of Tables
   The most common:
       ColumnFixture, when a test case can be
        expressed in a row with input/outputs
       RowFixture, when checking a list
       DoFixture, when doing
           Actions alone
           Do, Column, and Row fixtures together
       And many more
       ActionFixture, an old and limited DoFixture > stay away
        from it
Examples - Testing
   Column-based, could not find one
   Do fixture as actions
   Do Fixture as test driver, our preferred way
   Let the fixture generate all the combinations

Avoid these:
 A laundry list page

 Just tables, what is the purpose of the test?

 A page that does everything
Examples – Documentation
   A page as “Executable Requirement”
   A FitNesse page is a good way to hold
    current documentation, accessible by
    everyone
What we will cover today
   What is FitNesse?
     Quick introduction

     How it works



   Different types of tables

 Principles      you can use
Principles, related to fixtures…
   Fixture should be as thin as possible
   No code duplication in fixture
    >>> all good coding practices apply
   Use business domain words for all public
    members displayed in pages
    >>> Ask the business people or let them drive.
Principles, related to pages
   Most maintenance is going to be on the
    pages not the fixtures, if well designed
   No table duplication
    >>> use the “!include” syntax to share a page among
      other pages
   Use business domain words
   Keep the page focused and simple
Some parallels
  Code being          FitNesse             Comments
    Tested
 Duplicate code     Duplicate tables    Duplication is more
                                           expensive in
                                              FitNesse
Use domain driven      Use page         This isolates pages
   architecture   structure driven by        from SUT
                   business domain          refactoring

    Decouple         Avoid coupling     Avoid geeky talk and
   components        tables to SUT            reflection
                          code
How to get help
   FitNesse on the web http://fitnesse.org/
   Yahoo Group http://groups.yahoo.com/group/fitnesse/
   Fit Web Site http://fit.c2.com/
   A great book “Fit for Developing Software” with its
    samples http://www.vlagsma.com/fitnesse/

   Ask others
Others have been busy
Fixtures:
   http://fitnesse.org/UsefulFixtures

Environments:
 http://benefit.sourceforge.net/

 http://fitpro.sourceforge.net/

 http://ase.cpsc.ucalgary.ca/ase/index.php/FitClipse
  /FitClipse
 http://sourceforge.net/projects/profit
Some advice to get started
   Use a scout and get help
   Work as a Team
   Test pages should look simple and straight to the
    point
   Focus on expressing the intents (requirement) and
    the corresponding acceptance tests
   Accept the fact that you will refactor page structure
    and fixtures
    Better sooner than later

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:26
posted:3/10/2010
language:English
pages:17