Terminology - Fakes and Mocks
Aren't You Really Hacking The Code?
Wait just a minute.
Aren't you really hacking all these fakes into place? Won't that destroy the design?
Aren't you really hacking all these fakes into place? Won't that destroy the design?
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.interesting part of a class under test.
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.
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |