2008/04/20

Acceptance Testing Application Behavior

Venkat Subramaniam on Seattle NFJS Java Conference


How do you ensure your applications meet the expectations of your key customers?

Agile Development, it's all about building relevant working software by constantly getting feedback. Testing is a key ingredient in Agile development. 

Type of tests and Level: 
- UI/Presentation: Watir, Selenium
- Controls/Services: BDD/FIT
- Classes/Models: Unit Testing

Gathering requirement is a challenge. Use case helps, but often tend to be heavy weight and in effective beyond certain point of diminishing returns. Agile development use User Stories. When creating User Stories, 3Cs is important: 
- Card: Feature expressed in an index card
- Conversation: Use short description as starting point for useful discussions that promote exploration and understanding
- Confirmation: Tests are written as a way to confirm completion of feature development

INVEST in User Stories:
- Independent
- Negotiable
- Valuable
- Estimable
- Small
- Testable

FIT: Framework for Integration Testing
- General purpose open-ended framework for expressing tests
- Help focus on business perspectives
- Easy for non-programmers to use (Table represent tests)
- Automated checking and reporting of results
- Useful for Business Rules related to business calculation  and business process/workflow

How does it FIT together?
- Table of Tests, expresses expectations by way of examples
- Fixture, check that the system satisfied the given tests
- Column Fixture, helps test calculations
- Action Fixture, helps test events or actions
- Row Fixture, helps test collections

Tables are in pure html, which includes the test that the fixture will be used to execute on. Fixture is glue code in java that extends from FIT abstract Fixtures.

FitNesse provides a single web based UI for developing, running and viewing results of test. 

BDD - Behavior Driven Design 

- Each behavior is expressed as a test/exercise method
- It tells what the object should do 
- Java Tools for BDD: JBehave, JDave, beanSpec, Instinct
- Groovy Tools for BDD: GSpect, easyb

Reference:

2 comments:

Java Blues said...

Process Consultants or Process Specialists are always trying to sell the old mature practices in new invented terms. They ever called its waterfall, spiral, iterative together with stages, phases, iterations, requirements, use cases, user stories, ever RUP, extreme programming, now renown agile. I have to say, no best process, no best practice, no worst process, no worst practice at all. It's only true that it's the best solution for you if it suits your needs and your organization.

O.K. I'm still supporting the evolving and new inventions on processes. However, I hate those so named specialist try to cheat money in names of process reforming. Do you evaluate your organization really need and suit for it or just for your personal fashion desire? (This is for Boss)

haha.

Anonymous said...

A new java/J2EE website develope by me please check it out
www.fabgabs.com and join the new social networking sensation with maps and videos

Well well... why another J2EE blog? I benefited from other people's technical blogs, and guess what, it's a good idea to contribute some of my works too. Hope it's helpful and useful, to all of your folks.