Requirements Gathering Process
Requirements Workflow
Business Stakeholders
│
â–¼
┌───────────────────â”
│ Discovery Phase │
│ (Interviews) │
└─────────┬─────────┘
│
â–¼
┌───────────────────â”
│ Documentation │
│ (BRD, User │
│ Stories) │
└─────────┬─────────┘
│
â–¼
┌───────────────────â”
│ Technical │
│ Translation │
│ (Specs, ADRs) │
└─────────┬─────────┘
│
â–¼
┌───────────────────â”
│ Validation │
│ (Review, Signoff)│
└───────────────────┘
Business Requirements Document Template
# Business Requirements Document
## Project: [Project Name]
### 1. Executive Summary
- Project vision and objectives
- Business value proposition
- Success criteria
### 2. Business Context
- Current state analysis
- Pain points and challenges
- Market/competitive landscape
### 3. Stakeholder Analysis
| Stakeholder | Role | Interest | Influence |
|-----------------|-------------------|-------------------|-----------|
| CEO | Sponsor | Revenue growth | High |
| Marketing | Business owner | Customer experience| Medium |
| Operations | Daily user | Efficiency | High |
| IT | Technical owner | Maintainability | Medium |
### 4. Functional Requirements
- Feature catalog
- User stories
- Acceptance criteria
### 5. Non-Functional Requirements
- Performance targets
- Security requirements
- Scalability needs
- Availability SLA
### 6. Constraints and Assumptions
- Budget limitations
- Timeline constraints
- Technology stack
- Resource availability
### 7. Risk Assessment
- Technical risks
- Business risks
- Mitigation strategies
Stakeholder Interview Template
## Interview: [Stakeholder Name]
**Date:** [Date]
**Role:** [Role]
### Business Goals
1. What are the primary business objectives for this project?
2. How does this project align with company strategy?
3. What does success look like?
### Current Pain Points
1. What challenges do you face with the current system?
2. What processes are inefficient?
3. What are the biggest time wasters?
### Requirements
1. What features are must-haves vs nice-to-haves?
2. Are there specific metrics you want to improve?
3. What integrations are critical?
### Constraints
1. Budget limitations?
2. Timeline expectations?
3. Resource availability?
4. Regulatory/compliance requirements?
### Success Metrics
1. KPIs to measure success
2. Baseline numbers
3. Target improvements
User Stories and Acceptance Criteria
User Story Format
As a [user type]
I want to [action/goal]
So that [benefit/value]
Acceptance Criteria:
- Given [context], when [action], then [result]
- Given [context], when [action], then [result]
- Given [context], when [action], then [result]
E-Commerce User Stories
## Epic: Product Catalog
### Story: Product Search
As a customer
I want to search for products by name, SKU, or category
So that I can quickly find what I'm looking for
**Acceptance Criteria:**
- Given I am on any page, when I type in the search bar, then autocomplete shows suggestions
- Given I enter a search query, when results load, then products are sorted by relevance
- Given I search for a product, when results display, then I see product image, name, price, and availability
- Given I search for a non-existent product, when results load, then I see "No results found" with suggestions
**Priority:** High
**Story Points:** 8
**Sprint:** 1
---
### Story: Add to Cart
As a customer
I want to add products to my shopping cart
So that I can purchase multiple items
**Acceptance Criteria:**
- Given I am viewing a product, when I click "Add to Cart", then the product is added to my cart
- Given I add a configurable product, when I select options, then the correct variant is added
- Given I add a product, when cart updates, then I see a confirmation notification
- Given I add a product, when I view cart, then I see correct quantity and price
- Given I add out-of-stock product, when I click "Add to Cart", then I see an error message
**Priority:** Critical
**Story Points:** 5
**Sprint:** 1
---
### Story: Checkout Process
As a customer
I want to complete my purchase quickly and securely
So that I receive my products
**Acceptance Criteria:**
- Given I have items in cart, when I proceed to checkout, then I see shipping address form
- Given I complete shipping, when I proceed, then I see available shipping methods with prices
- Given I select shipping method, when I proceed, then I see payment options
- Given I complete payment, when I place order, then I receive order confirmation
- Given I complete checkout, when order is placed, then I receive email confirmation
- Given I checkout as guest, when I complete order, then I can track without account
**Priority:** Critical
**Story Points:** 13
**Sprint:** 2
Acceptance Criteria Examples
## Given/When/Then Format
### Scenario: Product Search with Filters
**Given** I am on the product listing page
**When** I select the "Electronics" category filter
**And** I set price range to $50-$200
**Then** I see only electronics products priced between $50 and $200
**And** the product count updates to reflect filtered results
**And** the URL updates with filter parameters
### Scenario: Cart Persistence
**Given** I have items in my cart
**When** I close the browser
**And** I return to the store
**Then** my cart items are preserved
**And** quantities remain unchanged
**And** prices reflect current pricing
### Scenario: Order Email
**Given** I have successfully placed an order
**When** the order is confirmed
**Then** I receive an order confirmation email
**And** the email contains order number
**And** the email contains item list with quantities and prices
**And** the email contains shipping address
**And** the email contains estimated delivery date
Technical Specification Translation
Technical Specification Template
# Technical Specification
## Feature: [Feature Name]
### 1. Overview
- Business context from BRD
- Technical approach summary
- Impact on existing systems
### 2. Architecture Impact
- New modules/components
- Modified existing components
- Database changes
- API changes
### 3. Data Model Changes
#### New Tables
```sql
CREATE TABLE vendor_feature_entity (
entity_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
status SMALLINT DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb DEFAULT CHARSET=utf8mb4;
Modified Tables
ALTER TABLE catalog_product_entity
ADD COLUMN vendor_feature_id INT UNSIGNED NULL,
ADD FOREIGN KEY (vendor_feature_id) REFERENCES vendor_feature_entity(entity_id);
4. API Design
REST Endpoints
GET /V1/vendor/feature/:id → Get feature
POST /V1/vendor/feature → Create feature
PUT /V1/vendor/feature/:id → Update feature
DELETE /V1/vendor/feature/:id → Delete feature
GET /V1/vendor/feature/list → List features
GraphQL Schema
type Query {
vendorFeature(id: ID!): VendorFeature
vendorFeatures(filter: VendorFeatureFilterInput): VendorFeatureSearchResult
}
type Mutation {
createVendorFeature(input: CreateVendorFeatureInput!): VendorFeature
}
5. Module Structure
app/code/Vendor/Feature/
├── registration.php
├── etc/
│ ├── module.xml
│ ├── webapi.xml
│ ├── schema.graphqls
│ └── di.xml
├── Api/
├── Model/
├── Controller/
└── view/
6. Performance Considerations
- Expected load: X requests/second
- Response time target: <200ms
- Cache strategy: Redis + Varnish
- Database optimization: Indexes, query optimization
7. Security Requirements
- ACL permissions
- Input validation
- SQL injection prevention
- XSS protection
8. Testing Strategy
- Unit tests: Service layer
- Integration tests: API endpoints
- Functional tests: User flows
- Performance tests: Load testing
## Architecture Decision Record (ADR)
```markdown
# ADR-001: Use Message Queue for Async Processing
## Status
Accepted
## Context
We need to process inventory updates asynchronously to avoid blocking the main request flow during high-traffic periods.
## Decision
We will use RabbitMQ with Magento's message queue framework for async inventory processing.
## Consequences
### Positive
- Non-blocking inventory updates
- Better fault tolerance
- Scalable consumer count
### Negative
- Eventual consistency for inventory
- Additional infrastructure (RabbitMQ)
- More complex debugging
### Risks
- Message loss during broker failure
- Consumer backlog during high load
## Alternatives Considered
1. **Synchronous processing** - Rejected due to performance concerns
2. **Redis queues** - Rejected due to persistence requirements
3. **Database polling** - Rejected due to scalability limitations
Implementation Planning
Sprint Planning Template
# Sprint [Number] Plan
**Duration:** [Start Date] - [End Date]
**Sprint Goal:** [Goal]
## Committed Stories
| Story | Points | Assignee | Status |
|------------------|--------|----------|----------|
| Product Search | 8 | Dev 1 | Not Started |
| Add to Cart | 5 | Dev 2 | Not Started |
| Cart Display | 3 | Dev 1 | Not Started |
## Sprint Capacity
- Team members: 3
- Available days: 10 per person
- Total capacity: 30 story points
- Committed: 16 points
- Buffer: 14 points (for bugs, meetings, etc.)
## Dependencies
- Design approval for search UI
- API mockups from UX team
- Test environment setup
## Risks
- Third-party search API integration delays
- Design changes mid-sprint
## Definition of Done
- [ ] Code complete
- [ ] Unit tests passing
- [ ] Code review approved
- [ ] Integration tests passing
- [ ] Documentation updated
- [ ] Deployed to staging
Story Point Estimation
## Fibonacci Estimation Scale
| Points | Description | Example |
|--------|----------------------------------------|----------------------------------|
| 1 | Trivial, < 1 hour | Fix typo in config |
| 2 | Simple, 1-3 hours | Add simple field to form |
| 3 | Small, 3-8 hours | Create basic CRUD module |
| 5 | Medium, 1-2 days | Implement API with validation |
| 8 | Large, 2-3 days | Complex search with filters |
| 13 | Very large, 3-5 days | Full checkout customization |
| 21 | Epic, 1-2 weeks | ERP integration module |
| 34+ | Too large, needs splitting | Split into smaller stories |
Project Timeline
Project: Magento Custom E-Commerce Platform
Duration: 16 weeks
Week 1-2: Discovery & Planning
├── Stakeholder interviews
├── Requirements documentation
├── Technical specification
└── Architecture design
Week 3-4: Foundation
├── Module scaffolding
├── Database schema
├── Base API structure
└── Development environment
Week 5-8: Core Features (Sprint 1-4)
├── Product catalog
├── Search functionality
├── Shopping cart
├── Checkout process
└── Order management
Week 9-12: Advanced Features (Sprint 5-8)
├── ERP integration
├── Inventory sync
├── Payment integration
├── Shipping methods
└── Custom admin panel
Week 13-14: Testing & Optimization
├── Integration testing
├── Performance testing
├── Security audit
└── Bug fixes
Week 15-16: Deployment & Launch
├── Staging deployment
├── UAT
├── Production deployment
└── Post-launch monitoring
Risk Register
# Risk Register
| ID | Risk | Probability | Impact | Mitigation |
|----|-------------------------|-------------|--------|-------------------------------------|
| R1 | Third-party API delays | High | Medium | Early integration, fallback plan |
| R2 | Scope creep | High | High | Strict change control process |
| R3 | Performance issues | Medium | High | Early load testing, optimization |
| R4 | Key resource departure | Low | High | Knowledge sharing, documentation |
| R5 | Data migration issues | Medium | High | Thorough testing, rollback plan |
| R6 | Security vulnerabilities| Medium | High | Security audit, penetration testing |
Definition of Done
## Definition of Done (DoD)
### Code
- [ ] Code follows PSR-12 coding standards
- [ ] No PHPStan level 8 errors
- [ ] No critical PHPCodeSniffer violations
- [ ] Unit tests written and passing (>80% coverage)
- [ ] Code reviewed and approved by peer
### Functionality
- [ ] All acceptance criteria met
- [ ] Integration tests passing
- [ ] No critical bugs
- [ ] Works in all supported browsers
- [ ] Mobile responsive
### Documentation
- [ ] Code documentation (PHPDoc)
- [ ] API documentation updated
- [ ] User guide updated (if applicable)
### Deployment
- [ ] Deployed to staging environment
- [ ] QA tested on staging
- [ ] Performance benchmarks met
- [ ] No regression in existing features
### Security
- [ ] Input validation implemented
- [ ] CSRF protection enabled
- [ ] XSS prevention in place
- [ ] ACL permissions configured
Quiz
1. What is the format for user stories?
2. What is an ADR?
3. What is the Definition of Done?
Flashcards
Question
What is a user story?
Click to reveal answer
Answer
As a [user], I want [action], so that [benefit]
Question
What is an ADR?
Click to reveal answer
Answer
Architecture Decision Record documenting technical decisions
Question
What is story point estimation?
Click to reveal answer
Answer
Fibonacci scale (1,2,3,5,8,13) for effort estimation
Question
What is Definition of Done?
Click to reveal answer
Answer
Criteria that must be met before work is considered complete
Question
What is a BRD?
Click to reveal answer
Answer
Business Requirements Document describing project scope and goals
Revision Notes
Key Takeaways
- 1. Requirements gathering involves stakeholder interviews and documentation
- 2. User stories follow As-a/I-want/So-that format with acceptance criteria
- 3. Technical specs translate business needs to implementation details
- 4. ADRs document architectural decisions and trade-offs
- 5. Sprint planning includes estimation, capacity, and dependencies
Interview Tips
- • Describe your requirements gathering process
- • Explain how to write effective user stories
- • Discuss technical specification structure
- • Talk about sprint planning and estimation techniques
Cheat Sheet
Requirements Gathering:
Stakeholder interviews → Pain points, goals
BRD → Business context, constraints
User Stories → As-a/I-want/So-that
Acceptance Criteria → Given/When/Then
Technical Translation:
Tech Spec → Architecture, data model, API
ADR → Decision, context, consequences
Sprint Plan → Stories, points, timeline
Estimation:
Story Points: 1,2,3,5,8,13,21
Capacity: Team × Available days
Velocity: Average points per sprint
Definition of Done:
Code: Standards, tests, review
Functionality: Criteria met, no bugs
Deployment: Staging tested, perf met
Security: Validation, CSRF, XSS