Increasing efficiency with mock frameworks

While hand-crafting test doubles is a skill each unit tester should be able to master, mock frameworks aim to ease stand-in component creation and configuration. Hence, they profess to make your daily testing work more efficient. But as opinions on these tools are divided, this section will clarify the pros and cons and give some examples of decent usage.

The promised land?

"If all you have is a hammer, everything looks like a nail."

There are a couple of frameworks available claiming to simplify the usage of stand-in components. Unfortunately, these libraries do not always do a good job when it comes to the precise test double terminology, [GOUL12], which we've learned in the previous sections. While JMock, ...

Get Testing with JUnit 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.