When a TDDed test fails, you can often make it pass by "sliming": making the method in question return a hard-coded value, instead of computing the answer in the "right" way. When you write that slimed code, when should you generalize to the full implementation, and when should you write another test to force the generalization? We'll look at some specific cases where I jump straight to the generalization.

Execute Program

Looking for something more interactive? Try Execute Program, an interactive learning platform from Destroy All Software LLC! It has courses on TypeScript, SQL, regular expressions, JavaScript concurrency, and more. All Destroy All Software subscriptions include full access to Execute Program, or you can subscribe to Execute Program directly.