1 / 23

FitNesse Building the right code

FitNesse Building the right code. Trond Arve Wasskog – JavaZone’05 14.09.2005. Version 1.0. Who am I?. What is this talk about?. Waiting at the sphincter muscle…. May. Jul. Sep. Nov. Analysis. Design. ?. Implementation. Test. Source: Uncle Bob.

shaman
Download Presentation

FitNesse Building the right code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FitNesseBuilding the right code Trond Arve Wasskog – JavaZone’05 14.09.2005 Version 1.0

  2. Who am I?

  3. What is this talk about? Waiting at the sphincter muscle… May Jul Sep Nov Analysis Design ? Implementation Test Source: Uncle Bob

  4. Acceptance tests and the agile rhythm Running, tested features May Jul Sep Release Iteration Test Iteration Test Iteration Test Iteration Test Iteration Test System Test

  5. FIT Framework for Integrated Test Created by Ward Cunningham Coordinated by Jim Shore FitNesse FIT in a Wiki Created by Uncle Bob (ObjectMentor) Maintained by Micah Martin FIT and FitNesse

  6. Acceptance Test Input Data Expected Result Acceptance Tests User Story

  7. Let’s create a calculator!

  8. Test table styles and Fixtures • Query • Business rules • ColumnFixture (Fixturous Logicus) • List • Test lists of values • RowFixture (Fixturous Recordus) • Workflow • Interaction • Possibly stateful • ActionFixture (Fixturous Interactous) DEMO: <Alt>-<Tab>

  9. FitLibrary – Rick Mugridge • Fixtures for actions (workflow): • DoFixture • SequenceFixture (mostly the same as DoFixture) • Fixtures for lists: • ArrayFixture - ordered lists • SetFixture - unordered lists • SubsetFixture for parts of unordered lists • ParamRowFixture to simplify the use of RowFixture with other FitLibrary fixtures • Fixture for calculations: • CalculateFixture • Fixture for set up: • SetUpFixture

  10. Project examples • http://localhost/JavaZone.ProjectExamples

  11. Include FitNesse in test and CI cycle! • Reduce the feedback loop • Developers must pay attention to acceptance tests

  12. Structure and configuration Latest version of application and database Stable application and database FitNesse Root Stable Config Developer Config All Tests Approved Tests Suite of all approved tests run in CI cycle Root of all FitNesse tests Feature 1 Suite Feature 1 Test 1 Feature 1 Test 2 Feature 2 Suite Configuration Test Suite Feature 2 Test 1 Test Feature 2 Test 2 Subpage Symlink

  13. Development Environment

  14. Running FitNesse from the command line • CommandLineRunner • Ant • Debugging • Maven plugin • Note • Using client classpath • ... but server FitNesse server test tables • ... and variables defined on the server

  15. A word about GUI/WebUI testing... • Don’t do it! • Hard to understand and maintain • Brittle • Slow • Hard to test-drive • If you really must... • FitNesse • JWebFit - JWebUnit • HtmlFixture – HtmlUnit • Canoo WebTest • Selenium • Watir • Test as much as possible on the backside

  16. What is this really about? • Communication, Feedback and Collaboration • Customer involvement • Specification instead of Verification • Building the right code • Agile development • Running, tested features • Delivering business value • Iterations • Know when you are done • Measuring progress and velocity • Regression testing

  17. C’est tout Thank you very much for listening to me! Questions? Now get out and start writing FitNesse acceptance tests! Feel free to contact me: trond.arve.wasskog[AT]bekk.no

  18. Hints & Tips • FitNesse - Excel • Refactoring FitNesse • !path • Use / (forward-slash) • No Spaces in paths • System properties • Version control • Built-in • File system

  19. Resources • Fit for Developing Software – Rick Mugridge/Ward Cunningham • http://www.amazon.com/exec/obidos/tg/detail/-/0321269349/102-7666705-8612148?v=glance • FIT • http://fit.c2.com • FitNesse • http://www.fitnesse.org/ • http://groups.yahoo.com/group/fitnesse/ • FitLibrary • http://fitlibrary.sourceforge.net/ • http://www.cs.auckland.ac.nz/~rick/FitLibrary/

  20. Developer tips • Database tests • Start a transaction in a DoFixture setup • Perform the required database setup • Execute the tests • Roll back the transaction • Mocks and stubs • Use mocks and stubs to focus coherent tests • Transactions and mocking is easy using Spring

  21. TypeAdapters • TypeAdapters support domain types in tests • String to domain objects • Domain objects to Strings • Test for equality • Built-in type adapters for primitives and wrappers • Three ways to add TypeAdapters • Add a public Object parse(String s, Class type) in your Fixture • Add a public static <Type> parse(String s) in your domain object • Uses toString() and equals() • FitNesse only • LibraryTypeAdapter.registerParseDelegate( Class type, Object parseDelegate) • FitLibrary Fixtures only • New plugin architecture underway

  22. FIT vs FitNesse • FIT runs HTML tables • Must be run from the command line • FitNesse is more dynamic • Easy to specify and execute tests • Wiki • Widgets • Symbolic Links • Must copy and paste from Excel

  23. FitNesse Architecture

More Related