13
Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Embed Size (px)

Citation preview

Page 1: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Using Fit on an Agile J2EE

Project

John Tyler

Houston Java Users Group

January 30, 2008

Page 2: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Contents

Intro & background Excel vs. HTML vs. FitNesse Performance and maintenance Test data Users writing tests? Things that would've made our lives a lot

easier Q&A

Page 3: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Intro & Background

Rewrite of public content-based website 6mm page views per day 500k+ registered users

ATG Dynamo → Spring MVC + Hibernate Heavy emphasis on automated testing

(JUnit, Fit, Selenium) Maven + Continuum

Page 4: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Why Fit?

Fit: Framework for Integrated Test Encourage communication and transparency ”Executable requirements” Keep unit tests pure and fast

Fit: Ward Cunningham, Jim Shore FitNesse: Ward Cunningham FitLibrary: Rick Mugridge

Page 5: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Excel / HTML / FitNesse ?

Product Managers (PMs) to maintain tests Subversion Maven + Continuum Easily accessible by PMs and developers Easy to edit & run

Page 6: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Why We Chose Excel

PMs didn't like wiki-style of FitNesse Thought Excel formulas & fill-down would be

helpful Everybody was comfortable with Excel Easily versioned and organized files Can edit directly in Eclipse

Page 7: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Fit Refresher

Test defined in Excel file reference fully-qualified name of fixture must be formatted correctly

Fixture defined in Java extend one of many provided fixtures in Fit and

FitLibrary (e.g. ColumnFixture, DoFixture) translate test data/sequence into calls on

underlying ”system under test” Output in color-coded HTML + summary

Page 8: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Challenges with Excel

Excel Dates != Java Dates Keeping up with borders is annoying No support for multiple sheets Limited support for running individual files Excel is a heavyweight editor

Page 9: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Performance & Maintenance

Test parsing was slow, and Maven made it

worse reportIndex.html was helpful, especially with

continuous integration Fixtures were refactoring-safe, but tests

would break Entire suite of 90+ test files would take ~10

minutes to run

Page 10: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Test Data

Full-stack integration tests would hit dev

database Tests must clean up after themselves Define setup data inside the test Try not to depend on existing test records

Page 11: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Users Writing Tests?

Typical scenario:1) Developer creates fixture and basic test

2) PM looks at test to see if it makes sense

3) Developer maintains test, adding scenarios as

they think of new cases● Occasionally PM would add new test cases● A few times PM would define new test from

scratch

Page 12: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

I'd Give My Right Arm For...

JUnit-style IDE integration Faster test parsing Spreadsheet runner that supported multple

worksheets Console / log output More flexible formatting

Page 13: Using Fit on an Agile J2EE Project John Tyler Houston Java Users Group January 30, 2008

Q & A

???