DEV Community

Discussion on: The Short Term Benefits of Unit Tests

Collapse
 
vinaypai profile image
Vinay Pai

Another often overlooked benefit of unit tests---at least well-written unit tests---is it can help expose flaws in your designs and abstractions. If writing tests is a struggle and you're forced to go through vast amounts of setup or mock many different kinds of objects, or worry about the internals of the implementation while testing the public methods, that's probably a sign that the design should be rethought.