Part 2. Testing and refactoring

Object-oriented programming and design may seem theoretical and hard to follow. In part 2 of this book, we get to the techniques that will help make them clearer in practice. Unit testing and refactoring (improving the design of existing code) are ways to improve the quality of software, making it easier to maintain and allowing us to prevent bugs. This makes a programmer’s job easier and saves time in dreary debugging. Just as important, test-driven development and refactoring are a unique learning process that let you discover the difference between good and poor application design on your own.

Testing and refactoring are related subjects, since refactoring depends on full test coverage. We will study unit ...

Get PHP in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.