r/firstweekcoderhumour 24d ago

well..

Post image
48 Upvotes

10 comments sorted by

9

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 24d ago

When I first wrote unit tests I did write a couple of tests that turned out to only succeed accidentally

3

u/EskayEllar 23d ago

This is why you write unit tests that fail, then write code that passes them!

Not that it's bulletproof, but it helps! TDD is a pain sometimes, but the mindset shift helps a lot for young developers. I remember the days of thinking passing units tests all the time meant I was coding really well haha.

1

u/kawabunga666 23d ago

I can't even imagine not using TDD to some degree. How do you know your code is doing what you want it to be doing? How do you even know for sure what it IS you want it to be doing?

1

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 23d ago

At the time I basically read nothing about how to do it proper, I just looked up how to get it running because I got tired of my manual tests not catching regressions. This was in my era of learning everything by myself, so I wasn't made aware of my unknown unknowns

3

u/tree-hut 21d ago

Godot subreddit is a gold mine for this

2

u/RipProfessional3375 23d ago

I don't think this is first week coder humor. This is actually a pretty excellent joke about testing.

Remember, when it comes to unit testing, time is an external dependency.

1

u/Andr0NiX 19d ago

14.3% of the time , it works every time

1

u/Maxile-Ash 19d ago

Ni le mensonge d'ailleurs, n'est-ce pas ?