SleepyBanana
SleepyBanana
34mo

Why do you write unit tests? Honest answers please.

I’ve been told to write
I genuinely want to catch bugs
131 votesexpired
34mo ago
GigglyNarwhal
GigglyNarwhal

Writing unit tests has saved my ass multiple times and I have caught bugs even in code written by others.
It's not fun but a great tool to write quality code. Also writing UTs just to achieve a certain percentage is utter bullsh!t.

SleepyBanana
SleepyBanana

You have hit the nail on the head. You seem to code with a genuine purpose. 👏

WigglyPenguin
WigglyPenguin

Code coverage in deployment pipeline which makes its mandatory to write test cases. It's a good practice as well and helps catches impact earlier. It's a pain to write though

GigglyBiscuit
GigglyBiscuit

I started like a month ago and already stopped a major bug from shipping into prod

Discover more
Curated from across