← Courses
IND 512 · 2 credits
Course Outline
Testing & Debugging
Write tests that catch bugs before users do, and debug with a method instead of guesswork. You will build assert-based tests from scratch, practice test-driven development, learn what mocks really are, read stack traces like prose, and finish by testing and fixing a genuinely buggy module.
What you will learn
- ✓Write clear, focused unit tests with arrange, act, assert structure and honest names
- ✓Discover edge cases systematically and hunt down off-by-one errors with boundary tests
- ✓Practice the red, green, refactor TDD loop and know when it pays off
- ✓Isolate code under test using fakes, stubs, and mocks, and explain the difference
- ✓Debug with a hypothesis-driven loop: reproduce, isolate by halves, fix, and prove the fix
- ✓Read any Python stack trace bottom-up and translate it into a plain-language diagnosis
Course outline
Unit 1Why Tests: Your Safety Net
- 1-1Your First Test4 checks · 9 min
- 1-2The Refactoring Safety Net4 checks · 10 min
- 1-3A Tiny Test Runner5 checks · 11 min
Unit 2Anatomy of a Good Test
- 2-1Arrange, Act, Assert4 checks · 9 min
- 2-2One Behavior per Test, Honest Names4 checks · 10 min
- 2-3Failure Messages That Explain4 checks · 9 min
Unit 3Edge Cases and Boundaries
- 3-1Finding the Cases You Forgot5 checks · 10 min
- 3-2Off-by-One Hunting4 checks · 10 min
- 3-3Table-Driven Tests4 checks · 10 min
Unit 4Test-Driven Development
- 4-1Red, Green, Refactor3 checks · 9 min
- 4-2A TDD Walkthrough3 checks · 12 min
- 4-3When TDD Helps (and When It Does Not)3 checks · 8 min
Unit 5Test Doubles and Mocking
- 5-1Isolating the Unit3 checks · 9 min
- 5-2Stubs by Hand: Dependency Injection4 checks · 11 min
- 5-3Mocks: Asserting on Interactions4 checks · 11 min
- 5-4Fakes: A Working Stand-In3 checks · 10 min
Unit 6Integration and End-to-End Tests
- 6-1The Testing Pyramid2 checks · 9 min
- 6-2Testing the Seams5 checks · 11 min
- 6-3Continuous Integration: Tests on Every Change4 checks · 10 min
Unit 7Debugging Methodology
- 7-1Debug Like a Scientist2 checks · 9 min
- 7-2Reproduce, Then Minimize3 checks · 11 min
- 7-3Isolate with Checkpoints3 checks · 10 min
Unit 8Reading Stack Traces Like Prose
- 8-1Anatomy of a Traceback4 checks · 10 min
- 8-2The Exception Bestiary5 checks · 10 min
- 8-3Bug Hunt: Four Broken Programs5 checks · 12 min
Unit 9Bisection and Debugging Tools
- 9-1Narrowing by Halves4 checks · 11 min
- 9-2Print vs Debugger, Honestly4 checks · 10 min
Unit 10Capstone: Test and Fix a Buggy Module
- 10-1Capstone Part 1: Write the Tests2 checks · 13 min
- 10-2Capstone Part 2: Fix Every Bug3 checks · 13 min
Practice while you learn
Use Hack University's public online code editor when you want to run code online before committing to the full curriculum. The browser compilers are free for quick syntax checks, exercises, and interview practice in an isolated sandbox environment.