this post was submitted on 24 Jul 2026
527 points (97.8% liked)
Programmer Humor
32477 readers
425 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Except that then you'll shape your interfaces to drive tests nicely, instead of being, you know, sane and useful (been there, done that).
Unit tested test for accuracy, if your code isn't "shaped to drive tests nicely", it's bad code.
They enforce requirements. You do start with code, you start with the "shape", you architect how your application should be developed and you write unit tests for the functions you already know you want but haven't written the logic to yet, the unit test validates the logic so you don't spend 2 hours hunting down a missing negative sign.
Read my comment again, instead of half way through.
I did, and I responded to your comment in its entirety. If there's a point you made that I missed, try rephrasing it instead of being snarky...
Unit tests tests known facts and validate requirements, good unit tests are defined after you define your requirements and as you design your infrastructure, not after you write your code. They ensure your code does what you require it to do.
I don't know what part of your comment I missed reading...