Requirements Testing with FitNesse
Rob Whitener
QA Consultant

GXS

Introduction:

Software requirements can be very difficult to pin down and are usually in a constant state of flux. For many software project, this causes severe problems with budgets, quality, and customer relations. While there are some very expensive requirements management tools out there, FitNesse offers an inexpensive way to not only get a handle on ever changing requirements, but also offers an efficient way to communicate what requirements are being worked on and how much progress is being made. Additionally, FitNesse allows all this information to be communicated easily to all stakeholders, including customers (arguably, the most important stake holders).

Participants will learn:

  • How to use the FitNesse wiki to document requirements and create test tables
  • What a “Fixture” is in FIT, and what fixtures are available right out of the box
  • The use of variables on wiki pages, to parameterize content
  • Use of the import feature to import a wiki from another server
  • Symbolic links that allow tests to be targeted at different environments
  • Best Practices for requirements and test creation

Outline:

  • What is FitNesse
    • It's a wiki
    • comes with its own web server
    • web interface for FIT
    • Open source – you can't beat the value
  • What is FIT
    • Framework for Integration Testing
    • Table driven approach to integration testing
    • Allows for tables to be created in Word docs, HTML, Spreadsheets and fed into the test engine
  • Communicating with FitNesse
    • By its nature, a Wiki allows for rich text documentation
    • Wiki allows for requirements to evolve overtime
      • start of vague, become more precise
    • Requirements tests can be documented in the same place
      • tests can be run by anyone
    • Requirements no longer exist in a silo
      • Anyone with a web browser can see them
      • no special tools or software required
      • The entire organization, including customer representatives can comment on requirements and tests
  • Requirement-Test architecture
    • Wiki text is rich text;
      • bold, italics, strikethrough, bullets, etc.
      • collapsible sections
      • links to external sites and documents
    • Test tables work with Fixtures
      • A fixture is an object which contains public variables and methods executed by fit
      • There is a set of standard fixtures
      • Or, you can build your own
    • My two favorite Fixtures
      • Column Fixture
        • Easily express test cases in tabular format: each row is a test case
        • used for executing an action and verifying the result
      • Row Fixture
        • Verifies repositories of information, ie. rows in a database, messages in a mailbox
        • Performs an action that returns a set of data
        • Verifies that all the rows are present, and each cell contains the expected result
        • Regards surplus rows as test failures
        • 1 row fixture is a test case
      • Versioning
        • FitNesse has its own versioning engine
        • Rolling back to a previous version of a wiki page can be done with three clicks of a mouse
        • Still not a bad idea to put into Subversion
      • Requirements and Test case design
        • Keep requirements concise
        • Don't use vague language, concrete details are best
        • Test tables should clearly express what is being tested
          • Column names should clearly indicate the field and data type being entered
          • test method names should relate to the action being executed
          • Expected results should be as close to what is seen in SUT as possible
            • where possible, use Boolean types for expected results
        • Create subwikis for lengthy requirements and tests
          • FitNesse is hierarchical in nature, child pages inherit from parent pages
          • Can group a set of requirements and tests across multiple pages into a suite
        • Use variable to parameterize dynamic data
          • URL's, userids, filenames: all these items change from test to test and environment to environment
          • FitNesse variables can allow this information to be parameterized
          • Variables on a parent page are inherited by child pages
  • Handy Features
    • Symbolic Links: Build once, run anywhere
      • By using variables to parameterize data, a test can be run against any target environment
      • A symbolic link can be created which redefines all the variables on a test page, to target the test towards:
        • a specific environment: dev, QA, pre-prod
        • a specific set of users
        • specific scenarios (different workflow paths)
      • Import: How to pull pages from a common install
        • Wiki Import feature allows a subwikis to be imported from one installation into another
        • Variables are used to ensure that the page pulled will contain the correct information for the test
        • Another way to point tests at different environments
        • One Gotcha: Importing a page overwrites any changes in the target page
          • something to keep in mind!
  • Links and information
  • The End

Biography:

In 2002 Rob received a BS in Computer Science from the University of South Florida . He had spent a year after graduation rebuilding the website for a small office furniture manufacturer in Tampa . After that he took a position with IBM working with test automation. At that time the department Rob was going to work with used WinRunner and didn't have anyone dedicated solely to test automation. His first year at IBM he learned how to use WinRunner extensively, and became increasingly frustrated with WinRunner's proprietary scripting language and the fragility of GUI based tests. In 2004 Rob's department (EDI Services) was sold to GXS (formerly GE Information Services) and around that same time he began to experiment with many open source tools for testing, mainly FitNesse. Currently they are integrating the customer base of his IBM platform with the Trading Grid platform central to GXS' business. During the development effort they have had great success with FitNesse as a testing and requirements management tool. Currently Rob is also working towards an MBA (part time) at the University of Maryland .