2/3 - Agile Processes and Extreme Programming Flashcards
Test Driven Development
- Testing first clarifies the task at hand
- Forces you to think in concrete terms
- Helps identify and focus corner cases
- Testing forces simplicity
a. Your goal is to pass the test
b. Avoids premature optimization - Test acts as a useful documentation. Expose the programmer’s intent.
Bug Fixes
- Fail a unit test
- Fail an acceptance test (user story)
- Fail on beta testing
Bug Fix for Unit Test
Fix the code to past the test
Bug Fix for Acceptance Test (User Story)
Add a functional test to fix the code
Bug Fix for Beta Testing
- Add user stories, acceptance tests
2. Make one or more tests from failing scenario
When do we need to write code to fix tests?
ALWAYS write code to fix tests
Refactoring
- It is done to make code easier to read, use and extend
- Change how code does something
- Tests should work as before
- Refactoring is also done to remove duplicated code
- Comprehensive suite is needed for refactoring
- Only refactor working code
- Plan it to allow frequent regression tests
How should tests work during refactoring?
Tests should work AS BEFORE
What does refactoring do to duplicated code?
Refactoring REMOVES duplicated code
What kind of suite is needed for refactoring?
A COMPREHENSIVE suite is needed for refactoring
Which kind of code can be refactored?
Only refactor WORKING code
What’s Different About XP
- Every XP programmer participates as an analyst, tester, programmer, architects
- No complete upfront design and analysis
- Infrastructure and framework is developed as you develop the app
- Quick delivering business value
When are infrastructure and framework developed in XP?
Infrastructure and framework is developed as you develop the app
What do you use XP for?
- Dynamic project done in small teams
- Project requirements prone to change
- Customer is available
When do you NOT use XP?
- Cost of late changes is very high
2. Customer is not available