โ Back to Roadmap
โ
Master Level
Unit Testing
Complete Beginner โ Advanced Syllabus (Pin-to-Pin)
๐ข LEVEL 1 โ Foundations
1. Introduction to Unit Testing
- What is a unit test
- Purpose: verify individual components
- Unit test granularity
- Test-driven development (TDD)
- Benefits: confidence & regression prevention
2. Testing Frameworks
- Jest for JavaScript
- Mocha for Node.js
- pytest for Python
- JUnit for Java
๐ข LEVEL 2 โ Test Anatomy
3. Arrange-Act-Assert Pattern
- Arrange: setup test data
- Act: execute function
- Assert: verify results
- Clear test structure
4. Assertions & Matchers
- Equality assertions
- Boolean assertions
- Thrown errors
- Custom matchers
๐ก LEVEL 3 โ Mocking & Stubbing
5. Mock Objects
- Creating mocks
- Mock expectations
- Verifying calls
- Argument matchers
6. Stubs & Spies
- Stub implementation
- Spy on function calls
- Call verification
- Return value stubbing
๐ก LEVEL 4 โ Fixtures & Setup
7. Test Fixtures
- Setup & teardown
- BeforeEach & afterEach
- BeforeAll & afterAll
- Fixture inheritance
8. Test Data
- Minimal test data
- Factory functions
- Fixture builders
- Parameterized tests
๐ LEVEL 5 โ Coverage & Completeness
9. Code Coverage
- Line coverage
- Branch coverage
- Function coverage
- Statement coverage
10. Coverage Analysis
- Istanbul for JavaScript
- Coverage reports
- Coverage gaps
- Coverage targets
๐ LEVEL 6 โ Edge Cases & Error Testing
11. Boundary Testing
- Edge case identification
- Boundary value analysis
- Off-by-one errors
- Null & undefined handling
12. Error Testing
- Exception testing
- Error handling paths
- Invalid input testing
- Recovery testing
๐ต LEVEL 7 โ Async & Performance
13. Async Testing
- Promises testing
- Async/await testing
- Callback testing
- Timeout handling
14. Performance Testing
- Execution time limits
- Memory leak detection
- Performance regression
- Benchmarking
๐ด LEVEL 8 โ Dependency Management
15. External Dependencies
- Mocking external APIs
- Database mocking
- HTTP mocking
- File system mocking
16. Isolation Strategies
- Dependency injection
- Service locator pattern
- Constructor injection
- Factory injection
๐ด LEVEL 9 โ Best Practices & Maintenance
17. Test Quality
- DRY principle in tests
- Readability & clarity
- Single responsibility
- Test naming conventions
18. Test Maintenance
- Keeping tests updated
- Flaky test elimination
- Test refactoring
- Deprecation handling
โญ Senior Frontend Focus (Must Master)
- React component unit testing (React Testing Library)
- Hook testing strategies
- Redux reducer testing
- Utility function testing
- DOM event simulation
- Snapshot testing limitations & best practices
- Coverage targets for UI code