Cover page by Don Roberts, William Opdyke, Kent Beck, Martin Fowler, John Brant

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 4. Building Tests

If you want to refactor, the essential precondition is having solid tests. Even if you are fortunate enough to have a tool that can automate the refactorings, you still need tests. It will be a long time before all possible refactorings can be automated in a refactoring tool.

I don’t see this as a disadvantage. I’ve found that writing good tests greatly speeds my programming, even if I’m not refactoring. This was a surprise for me, and it is counterintuitive for many programmers, so it’s worth explaining why.

The Value of Self-testing Code

If you look at how most programmers spend their time, you’ll find that writing code actually is quite a small fraction. Some time is spent figuring out what ought to be going on, some ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required