Summary
It’s easy to write a lot of code quickly. It’s just as easy to let that code get dirty to the point where it becomes difficult to comprehend and navigate. Unit tests provide the safeguards you need to clean up messy code without breaking things.
In this chapter, you learned techniques for keeping your system clean continually to help you keep your system from degrading into a frustrating mess. You renamed variables and methods, you extracted smaller methods, you in-lined variables, and you replaced older Java constructs with newer ones. You might call this very incremental method-level cleanup “micro” refactoring—a programmer’s version of the continuous editing that a writer performs.
Don’t let your code get to the point of the convoluted ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access