O'Reilly logo

Extreme Programming Installed by Chet Hendrickson, Ann Anderson, Ron Jeffries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Run All the Tests

It's most important that the code does what it has to do. In XP, there is only one way to know whether the code does what it has to do: there must be a test. A feature does not exist unless there is a test for it.

Does this mean that every class must have tests? Not necessarily, but it wouldn't hurt. If a class has no behavior that could possibly break, then it doesn't need tests. If it could possibly break, test it.

What if another class uses ours, and the other class has tests? Does our class need tests? More likely than not, it does. Does the test for the other class test every feature of our class? Probably it does not. Will our class ever need enhancement or clarification or optimization? Probably it will. Changing our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required