Problem Breakdown: Decomposing Tasks ๐งน๐๏ธ โ
In programming, if a function is 500 lines long, it is hard to read. You break it into 10 smaller functions. In Agile, if a Task is too big (like a "13" or "21"), we break it into smaller Tasks.
This process is called Refinement (or Grooming).
Key Activities in Refinement ๐ โ
Refinement isn't just about splitting tasks. It involves:
- Removing irrelevant items (The "We're never going to do this" items).
- Splitting large items (Epics) into smaller User Stories.
- Estimating items (Playing Planning Poker).
- Prioritizing items (Moving high-value items to the top).
When? Usually mid-sprint, preparing for the next sprint.
Definition of Ready (DoR) ๐ฆ โ
Before a task enters the sprint, it must be "Ready". Think of this like a checklist before running a script:
- [ ] Clear Goal: Do we know what the output should be?
- [ ] Estimated: Have we guessed the points?
- [ ] Small Enough: Is it small enough to finish in a few days?
- [ ] Dependencies Resolved: Do we have all the libraries/API keys we need?
Strategies to Break it Down (The SPIDR Method) ๐ ๏ธ โ
Just like refactoring code, we refactor tasks. We can use the SPIDR method:
- S - Spikes: Don't know how to do it? Create a research task first.
- P - Paths: Happy Path vs. Unhappy Path (Error Handling).
- I - Interfaces: Logic vs. UI.
- D - Data: Simple Data vs. Complex Data.
- R - Rules: Basic Rules vs. Complex Logic.
Example: "Build a Chess Game" โ๏ธ โ
Original Task: "Build a Chess Game" (21 Points - Too Big!)
Splitting using SPIDR:
Interface Split:
- Task A: Write the
Boardclass in Python (Backend). - Task B: Draw the board using
pygame(Frontend).
- Task A: Write the
Data Split:
- Task C: Make it work with just Pawns.
- Task D: Add Knights and Bishops.
Path Split:
- Task E: Valid moves only.
- Task F: Prevent invalid moves (e.g., moving through other pieces).
Case Study: "The Python Bookstore" ๐๐ โ
Let's apply everything we've learned to a full feature lifecycle.
1. The Vision ๐ญ โ
We want to build an online bookstore specifically for Python books.
2. The Backlog (Initial) โ
- Show list of books.
- Search for books.
- Buy books (Too Big!).
- User profile.
3. Refinement (Breaking it down) ๐จ โ
The "Buy books" item is an Epic. Let's split it using SPIDR (Interface/Steps):
- Story A: "Add book to cart".
- Story B: "View cart".
- Story C: "Checkout process".
- Story D: "Payment integration".
4. Writing the User Story ๐ โ
Story A: Add book to cart.
"As a Shopper, I want to click an 'Add' button so that the book is saved for later purchase."
Acceptance Criteria:
- Given I am on a book detail page.
- When I click "Add to Cart".
- Then the cart counter in the navbar increments by 1.
- And the button text changes to "Added!".
5. Estimation (Planning Poker) ๐ โ
- Dev A: "3 points. Just a session update."
- Dev B: "5 points. What about handling out-of-stock items?"
- Discussion ensues...
- Consensus: 5 points (Handling edge cases increased complexity).
6. The Sprint (Development) ๐ โ
- Daily Standups: Tracking progress.
- Coding: Using Python/Django.
- Testing: Using Pytest.
7. Review & Retro ๐ โ
- Review: Show the "Add to Cart" feature to the stakeholders.
- Retro: "Our estimates were good, but we need to clarify the 'Out of Stock' behavior earlier next time."
Why do this? ๐ โ
By breaking it down:
- You get working code faster (Story A works on Day 1!).
- You feel progress.
- If you run out of time, you still have a Calculator that adds and subtracts (better than nothing!).