Matti Bar-Zeev
Mar 10, 2017 · 1 min read

If I remember uncle Bob’s definition correctly— a unit is the smallest testable part of your code. In general this comes down to the smallest logical unit of your code which is a function since you “extract till you cannot extract no more”, right? ;)

I wouldn’t consider a class or a module a unit for testing since they may contain several public APIs, each needs to be tested separately.

Matti Bar-Zeev

Written by

Mind reflections & individual thought patterns of one code musician ▪ Believes in craftsmanship ▪ Culture over Technology ▪ Always learning...

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade