Ch23: How Do I Know That I'm Not Breaking Anything?
Sun Sep 30 20:53:00 UTC 2007
How Do I Know That I'm Not Breaking Anything?
Code is resilient and only breaks when we mess with it (or change underlying environment). Humans are primary introducers of bugs in code and code absorbs bugs from humans easily. This chapter discusses a few things to reduce risk when we edit. Some are mechanical but some are psychological.
Hyperaware Editing
what does each key stroke contribute to? Is it refactoring or is it a functional change, or is it cosmetic
Single-Goal Editing
Consider putting off the depth changes and focusing on doing one thing at a time. Don't get sucked in
Preserve Signatures
Refactoring is often very invasive and so it is error-prone. Preserve signatures and don't pull off multiple refactorings/breaking of dependencies all in one step.
Lean on the Compiler
break something and go fix the bleeding.
Pair Programming
2nd set of eyes makes the world go round. Don't be afraid if you have not done it before. Try it, you'll like it.