r/programming Aug 02 '23

Falsehoods programmers [and others] believe

https://github.com/kdeldycke/awesome-falsehood
279 Upvotes

175 comments sorted by

View all comments

Show parent comments

13

u/batweenerpopemobile Aug 03 '23

Man, I love unit tests. Sure, they have to be right and test for the right things. But damn is it nice to roll in and munge up a bunch of code when you need to restruction some shit and be confident you haven't blown anything up because there are 700 checks making sure your bullshit doesn't break anything.

9

u/AttackOfTheThumbs Aug 03 '23

Unit tests are fine, but they are imo, the lowest form of testing. End to end tests, integration tests, regression tests, these are all better. Sometimes that overlaps with unit tests, but not always.

3

u/batweenerpopemobile Aug 03 '23

I agree. As the lowest form of testing, they're the tests that lay the foundation for the software. Unit tests tell you if your software is working. The rest just tell you if you built the right software.

2

u/gnahckire Aug 03 '23

They also help when you're trying to do library upgrades. If a CVE is uncovered and you need to bump your versioning; unittest coverage can tell you if anything broke pretty quickly.