DEV Community

Discussion on: What’s a concept you understand now, but took you forever to grasp?

Collapse
 
ggingell profile image
Grant Gingell

This will sound strange but: Efficiently writing effective unit tests. Too often when starting out I would write tests that were redundant, dual purpose and overly complex. I would even test functionality that was not the responsibility of the unit under test. Now I focus on strong coverage of the API and refactoring each unit so that a high percentage of coverage is easy to accomplish while remaining meaningful.

This talk is one of many that helped me improve:

destroyallsoftware.com/talks/bound...

But mostly it has been learned through time and tears spent re-reading old unit tests that did not stop bugs and took way too long to write.