Which observations should stay the same after extracting a function?
The judgment behind the action
Characterization tests capture existing behavior. Decide which behaviors are intentional before preserving them. Keep structural changes separate from behavior changes where practical, and review callers and edge cases. A refactor should not smuggle in new requirements.
A bounded way to ask
Extract the existing filter function without changing empty-query results, matching semantics, order, or mutation behavior.
List invariants for a filter utility extraction.
Which observations should stay the same after extracting a function?
Guided practice contributes completion, not independent mastery.
Make the lesson yours.
Your reflection is attached when you submit your decision. Drafts remain in this tab.
Try it somewhere unfamiliar.
Apply this skill to an unfamiliar repository: list invariants for a filter utility extraction. Record the evidence you would need.
Choose your next practiceSource checked 2026-09-09 · Documentation profile · Runtime example untestedOfficial reference