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: