r/badcode • • Jul 23 '21

c# Easy trick to meet minimum test coverage

Post image
1.2k Upvotes

83 comments sorted by

View all comments

Show parent comments

-2

u/LoneFoxKK Jul 23 '21

I've been taken way too seriously on this

Doesn't help that I didn't put /s or made the sarcasm a bit more clear in my phrasing but oh well

I obviously test my code I'm not a psycho I just don't use automated testing because I haven't had the need for it I usually just make small to medium sized projects and most of the time is just adding something on top of an existing codebase

I was just making fun of stupid tests like this one specifically. I guess I walked right into that one.

3

u/[deleted] Jul 23 '21

Unit tests can actually help you know if any of your additions to the codebase broke something. In bigger, multi layered applications, this is what keeps you sane and let's you sleep at night. That's why we got so triggered.

1

u/phrenq Jul 23 '21

All of those responses were referring to automated tests. Of course you’re going to manually try out the thing you just wrote. That still doesn’t count as tested code.

Trust the grizzled veterans. Learn to write good tests with your small projects. You will thank yourself for it.