this post was submitted on 07 Jul 2025
698 points (99.3% liked)

Programmer Humor

24957 readers
2271 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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] PurplebeanZ@lemmy.world 11 points 5 days ago (15 children)

I've never actually tried or got the point of this test stuff tbh. It didn't exist when I started so I never really got the point of it. I tried reading up on it a bunch of times and it seemed like extra work for nothing 🤷

It seems popular though so maybe one day I'll get around to it....

[–] neomachino@lemmy.dbzer0.com 2 points 5 days ago (3 children)

My job used to outsource a bunch of dev work to another company and oh boy did those people love their tests. I don't get it. In my case they weren't even using our actual database to pull data from. They had a bunch of fixture files with generic data that they would use to make a temporary sqlite db for the tests. All of the test ran perfectly with that data, not so much with the actual data. The code is there, can't you just read it and know what will happen?

When I write something I'm never not building it and at least checking that it works and trying to break it.

[–] Mirror Giraffe@piefed.social 6 points 5 days ago

Imo each test tests a specific functionality which requires a fixture set up for that. Its important that these figures mirror exactly how it would look in production or the tests are pointless.

For example customer A uses product A in a specific way it's important that we enter customerA.settings and productA.props into the test and only test the specifics in said transaction.

[–] boblin@sh.itjust.works 6 points 5 days ago

There are certainly different kinds of developers writing different types of tests. I usually only write the tests first if I‘m adding a critical functionality to some method or function already present. However having automated tests can help you when you can‘t easily understand the code or when you want to refactor that code to make sure you‘re not breaking existing functionality.

What you‘re describing with external devs often happens when these devs can‘t access the real data - plus you often want these tests to be automated, which usually brings with it the requirement of atomicity, i.e. you want one test run running in parallel with another not effecting each other. That usually doesn‘t work well with a real database (unless you really take your test engineering to the overengineered tier).

[–] squaresinger@lemmy.world 1 points 4 days ago

It's hard to test the whole system with all special tests manually. At least if your project is more than a static website or something similarly trivial.

That's why auto tests are there to increase your testing coverage, so that one change won't break your system in unexpected ways, especially if you do system-wide changes like upgrading your framework or core systems to a new version.

load more comments (11 replies)