Chapter 15 - JUnit Framework
Key Takeaways
- Leave code (even good, well-written code) better than when you found it... Boy Scouts Rule.
- Well written tests should have 100% code coverage for the module you are testing.
- It's important to name things well and remove redundancy (such as unnecessary prefixes).
- Extract code into helper methods to make the intent of the function clear.
- It is common for a previous refactor to be undone by a later refactor as you have discovered a better way of doing things that works with the old version.
- Refactoring is a process of going backwards and forwards but not regressing and making little changes at a time.
See my repository here and check the commits out to get a good view of what was changed in the refactors.