DEV Community

Discussion on: Code Smell 135 - Interfaces With just One Realization

Collapse
 
explorer14 profile image
Aman Agrawal • Edited

How is creating an implementation for testing, not a test double?

Thread Thread
 
mcsee profile image
Maxi Contieri

You need to use real objects for testing, not mock or test objects

Thread Thread
 
explorer14 profile image
Aman Agrawal

Interfaces for external dependencies allow you the flexibility of using either a test double or a real implementation without much overhead. Arguing about that is a moot point.

There is a lot to be said about levels and granularity of testing but that's not this post!

Thread Thread
 
mcsee profile image
Maxi Contieri

Right! there also a lot of test smells, many on this series and many others to come!