Album Cover

Faking & Mocking Java

Close Preview
Wait just a minute.

Aren't you really hacking all these fakes into place? Won't that destroy the design?
You could consider some of this work as hacking. Remember:
Our goal in microtesting is to bring every
interesting part of a class under test.
We will do whatever's needed to accomplish that. Microtesting is a dirty business.
But think about it. If you maintain the quality of the code, as well as the quality and clarity of the test itself, where is the real hacking? In this case, hacking is more like cutting things off than it is like writing undisciplined code.
When we use fakes, we hack off the code we don’t want to test now, so that we can more readily test the code we do want to test now.
| Tweet...
Page rating: | Rate this Page