this post was submitted on 07 Jul 2025
699 points (100.0% liked)

Programmer Humor

24857 readers
979 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
top 40 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 16 hours ago

I never understood test driven development. Yes I do usually write tests for my code, but only after I've finished writing my code.

[–] [email protected] 44 points 2 days ago (2 children)

Isn’t test driven development also error driven development though?

[–] [email protected] 8 points 1 day ago

With a fun side quest of figuring out if your actual code has the error or the tests!

[–] [email protected] 7 points 1 day ago

caught errors, but yes

[–] [email protected] 18 points 1 day ago* (last edited 1 day ago)

Often I'm a doom-driven developer.

[–] [email protected] 56 points 2 days ago (1 children)

Bug report driven development

(And I use app reviews as my bug tracker)

[–] [email protected] 28 points 2 days ago* (last edited 2 days ago) (2 children)

Karen incident in the customer service call center driven development.

If someone hasn't yelled at a minimum wage phone rep over it, it doesn't need to be fixed.

[–] [email protected] 3 points 17 hours ago

mom driven development

if my mom doesnt yell at me because my code broke something impirtant, no need to fix it

[–] [email protected] 4 points 1 day ago

One of the few things “AI” is good for, absorbing Karens and Kevins.

[–] [email protected] 53 points 2 days ago (2 children)

Vibe coding is error driven development.

[–] [email protected] 46 points 2 days ago

Vibe coding is driving error development

[–] [email protected] 36 points 2 days ago

Joke’s on you, I vibe coded my tests too! Now my development is driven by errors in my tests!

[–] [email protected] 31 points 2 days ago (1 children)
[–] [email protected] 3 points 1 day ago

That's overly broad.

[–] [email protected] 17 points 2 days ago

I'm a github issue driven developer, if it doesn't get reported, I'm not fixing it, jk jk I love my 10+ users

[–] [email protected] 12 points 2 days ago (6 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....

[–] [email protected] 4 points 23 hours ago

It's a tool, our job is to collect tools in our toolbox and use them appropriately

TDD is great for when you want a really, really tight interface - whether it's your exposed surface to customers or you've got a lot of people working on something, it makes sense to write the standard and code to it, instead of documenting after the fact

Otherwise... Well, in practice it's an idiot proof methodology. That's useful, but it is a lot of work

[–] [email protected] 16 points 1 day ago (2 children)

Code normally works fine after you write it and then hopefully at least test by hand. The new guy 5 years later, which do not fully grasp the extent of his actions, and the guy reviewing the code also not being too familiar with it, will not make sure everything does as intended.

Tests are correctness guarantees, and requires the code and/or the test to change to pass. They also explain how something should behave to people that don't know. I work in a area where there are so many businesses rules that there is no one person that knows all of it, and capturing the rules as tests is a great way to make sure that rules remains true after someone else comes to change the code.

[–] [email protected] 6 points 1 day ago (2 children)

This might work when the test really describes&tests the business rule, not when the test simply contains a mirror of the implementation with everything replaced by mocks and just checks that the implementation is what it is, conditioning all people changing the code in the future to always have to change the test as well.

[–] [email protected] 1 points 17 hours ago

Tests can be messed up just like anything else can be messed up. Doesn't mean that the concept itself is flawed.

If you only do things that people cannot mess up, then you'll quickly end up not doing anything at all.

The biggest benefit to me that testing has is when refactoring. If I have decent test coverage and I change something major, tests help me to see if I accidentally broke something on the way, which is especially helpful if I am touching ancient code written by someone who left the company years ago.

[–] [email protected] 5 points 1 day ago

Blech, this is my least favorite kind of testing. I'd much rather have some all-encompassing integration tests even if they're confusing AF, than the "yep the language still works as advertised" nonsense that this approach often amounts to.

[–] [email protected] 3 points 1 day ago (2 children)

capturing the rules as tests is a great way to make sure that rules remains true

Capturing the rules as documentation is also a great way to make sure that rules remain true.

Lol just kidding! Documentation ... can you imagine?

[–] [email protected] 1 points 17 hours ago

Capturing the rules as documentation (especially external documentation like confluence) is a great way to make sure nobody ever reads it. Or even finds it.

[–] [email protected] 3 points 1 day ago

Yeah, good luck reading 20+ pages of interlinked rules of what is what, what does what and in what order, then comparing that to how system behaves after your changes

Lol just kidding. No business rules are harder than five lines of text

[–] [email protected] 4 points 1 day ago

You know that thing you do, where you write some code and then realize you need a main function to execute it? And then you write your main function, but it's not really your main function, it's a bunch of half commented test code to make sure that the important code works?

Do that in a unit test, and when you're done testing that particular piece, add some assertions and move on to the next piece of functionality. Boom, test driven development.

[–] [email protected] 3 points 1 day ago

Imagine you're writing a front end and that the backend that will be serving the data is not ready yet, or it's down for whatever reason, but you know how the data will look like. In that case you can write a test with hardcoded data as if it's coming from the actual backend, and test several possible cases of the front end logic.

Another example is this: say you have some functionality that's behind some UI that you have to click through; you make a change, the page refreshes and you have to click a bunch of stuff again - until the next change when the page refreshes again. If you have to do this over and over again, things get inefficient. Instead, you can write a test to make sure the functionality handles the data properly and only then go through the UI to maybe test this or that edge case.

Plenty of other examples, but yeah, depending on what you're doing, you might not need tests at all.

[–] [email protected] 1 points 1 day ago

I like testing my helper/utility functions mainly so I can be sure I implemented them correctly. That way I can focus on my main implementation and narrow down where the problems are coming from.

[–] [email protected] 5 points 1 day 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.

[–] [email protected] 1 points 17 hours 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.

[–] Mirror [email protected] 6 points 1 day 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.

[–] [email protected] 6 points 1 day 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).

[–] [email protected] 14 points 2 days ago (1 children)

Hey that's no fair, it's still test driven development but the test just runs in production!

[–] [email protected] 1 points 1 day ago

Developmestuction!

[–] [email protected] 8 points 2 days ago (1 children)

This was me today. Had to push a small fix to our API server, which serves 10 apps. It didn’t go quite as planned; boy was Slack and Zabbix not happy. My phone got a good workout though from all of the notifications – which didn’t stop until about 5 minutes after the fix was fixed.

[–] RamblingPanda 8 points 2 days ago

I wrote tests today and found an error in my code. What is that? Development driven test driven development?

[–] [email protected] 5 points 2 days ago (1 children)

B: "I test in production."
A: bows down

[–] [email protected] 2 points 21 hours ago

I literally do that. With real world customers, and real world payments and real world consequences running through the system, all the time.

I live in fear.

[–] [email protected] 5 points 2 days ago (1 children)

What movie is that guy from? I know I've seen it but I forget

[–] [email protected] 7 points 2 days ago (1 children)

Kingdom of Heaven, I believe

[–] [email protected] 2 points 2 days ago

Oh yeah I like that one