Fitnesse Testing Framework

12,096 views

Published on

Published in: Technology
1 Comment
9 Likes
Statistics
Notes
No Downloads
Views
Total views
12,096
On SlideShare
0
From Embeds
0
Number of Embeds
56
Actions
Shares
0
Downloads
302
Comments
1
Likes
9
Embeds 0
No embeds

No notes for slide
  • Links with no warranties
  • Fitnesse Testing Framework

    1. 1. FitNesseOn the Road to Success by ajit Koti
    2. 2. What we will cover today  What is FitNesse?  Tradition Approach  Quick introduction  Quick Demo  How it works  Different types of tables  Conclusion
    3. 3. Traditional Approaches for acceptancetesting Manual Acceptance testing. User exercises the system manually using his creativity. Disadvantages: expensive, error prone, not repeatable, … Acceptance testing with “GUI Test Drivers” (at the GUI level). These tools help the developer do functional/acceptance testing through a user interface such as a native GUI or Disadvantages: expensive, error prone, web interface. “Capture and Replay” not repeatable, … Tools capture events (e.g. mouse, keyboard) in modifiable script.
    4. 4. 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
    5. 5. What is FitNesse?FitNesse is a software development collaboration tool Great software requires collaboration and communication. FitNesse is a tool for enhancing collaboration in software development. FitNesse enables customers, testers, and programmers to learn what their software should do, and to automatically compare that to what it actually does do. It compares customers expectations to actual results. Its an invaluable way to collaborate on complicated problems (and get them right) early in development
    6. 6. What is Fit? The Framework for Integrated Test (Fit) is the most well- known implementation (open source framework) of the table-based acceptance testing approach. Fit lets customers and analysts write “executable” acceptance tests using simple HTML tables. Developers write “fixtures” to link the test cases with the actual system itself. Fit compares these test cases, written using HTML tables, with actual values, returned by the system, and highlights the results with colors and annotations.
    7. 7. Now some Demos  Simple Calculator  Discount Calculator
    8. 8. What we will cover today What is FitNesse? How it works Using Fit Fit table Fixture Test Runner Different types of tables Conclusion
    9. 9. Using FitJust two steps are required to automate user acceptance tests using Fit: Express a test case in the form of a Fit table. Write the glue code, called a Fixture, that bridges the test case and system under test.Thats it!You are all set to execute the tests automatically for the rest of the application’s lifetime.
    10. 10. Fit table A Fit table is a way of expressing the business logic using a simple HTML table. Fit tables help developers better understand the requirements and are used as acceptance test cases. Customers and Analysts create Fit tables using a tool like Word, Excel, or even a text editor
    11. 11. Fixture A fixture is an interface between the test instrumentation (in our case, the Fit framework), test cases (Fit tables), and the system under test. Fixtures are procedures/functions/classes usually written by developers. In general, there is a one-to-one mapping between a Fit table and fixture.
    12. 12. Test Runner The Test runner sample.VerifyRating compares the team name played won drawn lost rating() customer-set Arsenal 38 31 2 5 83 expectations with the Aston Villa 38 20 2 16 54 actual results and Chelsea 38 35 1 2 93 reports any errors by Dummy 38 35 1 2 100 expected ------------------- color-coding the table 93 actual rows. Wigan 38 26 7 5 75 “red for failures and green for passed tests”
    13. 13. 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
    14. 14. The Fit picture Output Table o ≠ o’ Developer Fixture Test Runner o’Customer/ iAnalyst (i, o)User Story System Fit Table O = expected output O’ = actual output
    15. 15. Table, Fit, and Fixture togetherFixture ClassPublic Class Calculator Fixture and SUT Public Number1 As Double Public Number2 As Double working together Private _oSUTCalculator AsDemoSUT.SUTCalculator Public Sub New() _oSUTCalculator = New System Under TestDemoSUT.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 DoubleNumber2) Return firstNumber * secondNumber End Function End Function End ClassEnd Class
    16. 16. What we will cover today What is FitNesse? How it works Different types of tables Decision Table Query table Script Table Table Table Conclusion
    17. 17. Different styles of TablesTest System Fit Slim
    18. 18. Fit Tables ColumnFixture This is the style you may end up using most: rows of data represent inputs and expected outputs. RowFixture This is good for testing queries that should return an exact set of values (order-independently) .ActionFixture This style allows you write a script that emulates a series of events (such as controls manipulated on a user interface). Comment Tables Sometimes you want a tablular comment that is not executed as a test.
    19. 19. The SLIM Test System Slim (Simple List Invocation Method) is an alternative to Fit. Rather than running all the HTML processing, comparisons, and colorizing in the System Under Test (SUT), Slim keeps all that behavior on in FitNesse. What executes in the SUT is a very tiny kernel that implements the Slim Protocol. This protocol is a bare bones RPC system that allows FitNesse to call functions in the SUT. Different table styles in Slim Decision Table Query Table Subset Query Table Ordered query Table Script Table Table Table
    20. 20. Decision TableDecision Tables are a common way to get test data into a System Under Test. A Decision table has three parts One Title Row - Names the fixture to execute, optionally includes constructor parameters One Heading Row - Names of columns, which map to either setter methods or method calls (if they end in ?) Zero or more Data Rows - rows of data used to either provide data into a system or data used to compare to values returned from the fixture
    21. 21. Query table A Query table is a means of performing a single query and verifying the results. They can pass parameters into the constructor of their fixture. They expect a method, query, which returns a List of a List of a List of strings..
    22. 22. Script Table Script tables are a convenient way to introduce code- like sequences into your tests. They derive their design from Smalltalk keyword messages but other than that, they behave like other Slim tables: They are backed with a fixture They have one or more method invocations, one per line. There are several keywords you can start a line with such as show and check. The full method name is in parts, alternating with parameters passed in to the backing fixture. The method name starts in cell 1 if the line does not start with one of a small set of pre-defined keywords (check, reject, ...). Otherwise, it begins in cell 2.
    23. 23. Table Table
    24. 24. What we will cover today What is FitNesse? How it works Different types of tables Conclusion How to get help Q& A
    25. 25. Conclusions Manual acceptance testing is expensive, error prone and not repeatable. Fit/Fitnesse is a tool to write, organize and execute table- based tests. Fit tables help to clarify “textual requirements”. Fit tables “are requirements verifiable and executable”. Fit is compatible with Junit. The motivation of Fit/Fitnesse testing is demonstrating working functionalities while the motivation of Junit is finding faults
    26. 26. How to get helpFitnesse on the webTo install FitNesseWORKING WITH FITNESSE WIKI PAGESVIDEO TUTORIALSA great book “ Fit for Developing Software” with its samples
    27. 27. Q&A
    28. 28. Thank You

    ×