fitnesse in fifty minutes chris harbert resonate 1

22
FitNesse in Fifty Minutes Chris Harbert Resonate 1

Upload: ernest-maloney

Post on 31-Mar-2015

236 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: FitNesse in Fifty Minutes Chris Harbert Resonate 1

FitNesse in Fifty Minutes

Chris HarbertResonate

1

Page 2: FitNesse in Fifty Minutes Chris Harbert Resonate 1

What is FitNesse?

FitNesse is an open source collaboration and testing framework based on the wiki concept.

Written by Robert Martin (a.k.a “Uncle Bob”), a software consultant and prolific author who was one of the original signers of the “Agile Manifesto”.

2

Page 3: FitNesse in Fifty Minutes Chris Harbert Resonate 1

What is FitNesse?

Wiki pages are suites, tests, or static pages.

Suites are organized into hierarchies.

• TestSuites• TestSuites.SuiteOne

• TestSuites.SuiteOne.TestOne• TestSuites.SuiteOne.TestTwo

You can run at the suite level or at the test level.

http://yourfitnesseurl/TestSuites.SuiteOne?suitehttp://yourfitnesseurl/TestSuites.SuiteOne.TestOne?test

3

Page 4: FitNesse in Fifty Minutes Chris Harbert Resonate 1

When to use FitNesse?

4Collaboration

You want to encourage more collaboration around requirements and testing.** Results not typical.

Page 5: FitNesse in Fifty Minutes Chris Harbert Resonate 1

When to use FitNesse?

5Documentation

You want your tests to serve as documentation. The good kind.

Page 6: FitNesse in Fifty Minutes Chris Harbert Resonate 1

When to use FitNesse?

6Share the love

You want to provide the ability to write automated tests to a technical, but non-developer audience.

Page 7: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #1: Web Test (BDD)

7

Page 8: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #1: Web Test (BDD)

8

Page 9: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #2: Database/ETL

9

Page 10: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #3: Compare Excel Files

10

Page 11: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #4: Compare Query to Excel

11

Page 12: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #5: Verify Excel File Contents

12

Page 13: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #6: Taking Screenshots

13

Page 14: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Example #7: HBase

14

Page 15: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Other Fixtures• CSV File• REST API• Command Line / SSH• JIRA (e.g. to assert the ticket status)• PDF• Check Email

15

Page 16: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Creating Your First Fixture

Steps1. Identify a test (or create one) that needs a fixture

implemented.2. Select the appropriate fixture type.*3. Implement the methods that fixture type expects.4. Run the test.

* Fixtures can actually implement multiple fixture types simultaneously. In some cases, existing classes can be used as is.

16

Page 17: FitNesse in Fifty Minutes Chris Harbert Resonate 1

The Basic Fixture TypesDecision Table Supplies the inputs and outputs for decisions. This is

similar to the Fit Column Fixture

Query Table Supplies the expected results of a query. This is similar to the Fit Row Fixture

Subset Query Table Supplies a subset of the expected results of a query.

Ordered query TableSupplies the expected results of a query. The rows are expected to be in order. This is similar to the Fit Row Fixture

Script Table A series of actions and checks. Similar to Do Fixture.

Table Table Whatever you want it to be!

Import Add a path to the fixture search path.

Comment A table that does nothing.

Scenario Table A table that can be called from other tables.

Library Table A table that installs fixtures available for all test pages

Define Table Type A helper table that defines the default table type for named fixtures.

17

Source: FitNesse User Guide

Page 18: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Options for Running Tests• From the UI• From the Command Line• Using the web URLs• … with HTML response• … with XML response useful for integration w/ build servers,

TCM systems, etc.

18

Page 19: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Additional Cool Stuff and Tips• Suite filters allow you to run any tests with a given tag.• Symbols can be used to pass data around.• Use SLIM tables, not older fixtures.• Use collapsed sections to hide setup and teardown in order to

increase readability.

19

Page 20: FitNesse in Fifty Minutes Chris Harbert Resonate 1

When NOT to use FitNesse?• You’re writing fine-

grained unit tests. • Only developers will

see them.• No one can write

fixtures.

20

Page 21: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Caveats• Requires developers to provide appropriate fixtures (which

may be re-usable by non-developers).• No parallel runs (out of the box ;) ).• Is FitNesse dead?

21

Page 22: FitNesse in Fifty Minutes Chris Harbert Resonate 1

Resources• The website, http://fitnesse.org/• The User Guide (included in link of install)• The repo, https://github.com/unclebob/fitnesse

22