Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial →
⚡
← Courses
›
Senior Deep-Dives
›
Module 6 · Architecture & Code Review
›
Refactoring: characterization tests first
quiz
82 / 161
🇺🇸
EN
▼
↗
Share
⋯
More
+100 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** First step refactoring legacy with no tests? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** First step refactoring legacy with no tests? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
Pin the buggy behavior with `pytest --collect-only` first, then run coverage and refactor anything below 80%.
B
Characterization tests — pin current behavior (bugs included). Then refactor with safety net
C
Run `mypy --strict` over the legacy module and fix every type error before touching runtime logic.
D
Add structured logging at every public function so production traffic produces a behavior baseline.
Submit answer
💬 Discussion
Be the first to ask a question or share a tip.
Sign in
to join the discussion. Reading is free.
Loading discussion…