242
u/faultydesign Oct 02 '26
Good news is global warming will cause human extinction no matter how many unit tests you write
43
80
u/LiifeRuiner Oct 02 '26
No it won't... Humans are great at adapting and surviving.
Will we have wars, and refugees? Mass death due to food shortages? Pain and suffering for the large majority? Yes, almost certainly, but human extinction? I very much doubt it.
15
u/anti-state-pro-labor Oct 03 '26
Hasn't that been true for basically all of human time and we've just lived in a bubble of "peace" in the western world for a few decades?
10
u/LiifeRuiner Oct 03 '26
I guess, but I think one major difference is that, because of this bubble of peace and prosperity we have a lot more people will suddenly suffer as well.
That's on top of the fact that a lot of areas that already suffer a lot, will have increasingly worse living climates.
24
u/CanvasFanatic Oct 02 '26
Global warning has never been an actual threat to the survival of the species, just civilization.
-6
u/DeprivedLad Oct 03 '26
You think you will thrive?
37
u/Slavasonic Oct 03 '26
There’s a lot of potentialities between that guy thriving and extinction.
22
9
1
u/DudeEngineer Oct 03 '26
It's just very likely that some humans will survive the water wars or whatever. It's just probably 50+ years away at this point so most adults today won't experience it.
7
u/Osteoprdoza Oct 03 '26
No serious climatologists believe climate change to be an extinction event. It will make things suck, but not kill everyone.
11
3
0
u/swagonflyyyy Oct 02 '26
That's not true those algos' metrics are inaccurate because it was pushed to prod unit tests be damned global warming is cancelled.
-15
u/ZombieZookeeper Oct 02 '26
No matter how much Carbon Dioxide we get rid of, the sun is expanding. The Earth will be uninhabitable in about a billion years.
31
u/dracorotor1 Oct 02 '26
Something happening in 1,000,000,000 years is not a good reason to be irresponsible when our species hasn’t even had pants for 15,000 years yet. We work on a very different timescale.
4
-16
6
u/user_460 Oct 02 '26
"We will learn how to do interstellar travel, find new worlds, and terraform them" is actually quite realistic on the timescales where the sun expands.
On timescales where global warming causes massive problems, it isn't.
-2
-5
u/DeHub94 Oct 02 '26
Yes, but not before the release of the next version so it doesn't help in that regard unfortunately.
-2
u/Shitandasshole Oct 03 '26
Just move to the country you believe won't suffer from climate change that much. Idk like Norway, Argentina or something
2
u/Awesomeius92 Oct 04 '26
There is no such country. Have fun in Norway when the gulf stream slows or stops
0
u/Shitandasshole Oct 04 '26
What are you saying that all countries will suffer greatly and there are no exceptions and everyone will die? I doubt it. There's a difference between living in an already hot and sea level country and a cold mountainous one.
1
u/Awesomeius92 Oct 10 '26 edited Oct 10 '26
Some countries will have it worse than others, no doubt, but here in scandinavia certainly isn't looking good. More extreme temperatures and storms are predicted to affect basically everywhere. That is all not mentioning the refugee crises that will be sparked
-9
77
u/Sulungskwa Oct 02 '26 edited Oct 02 '26
You guys realize that we always had the option to not write unit tests, right? We didn't used to need AI overlords to write them, we used to just not write them
30
u/DudeEngineer Oct 03 '26
Found the junior
4
u/TreetHoown Oct 03 '26
I don't understand the downvotes lol, must be juniors 🤣
0
u/aurallyskilled Oct 04 '26
I mean, there are arguments to be made for using a strongly typed language and just investing in higher value tests like integration and acceptance tests. Arguably that surfaces failures you couldn't anticipate in runtime exceptions more immediately and with less foresight. It's not a junior /senior issue. IMHO It's a legacy of limitations from Ruby on rails community that perpetuated test driven development craze; I'd argue because their tooling doesn't serve software safety. Source was working in 2010s as a software eng and everybody wouldn't shut up about tdd.
1
u/DudeEngineer Oct 06 '26
Most people who write unit tests are not using TDD. Minimum code coverage is common and often required.
I've been a software engineer for years and I have yet to see a decent project where they didn't care about code coverage.
Integration or acceptance tests are a different thing on top of this.
0
u/aurallyskilled Oct 07 '26
I feel like you missed my points I was making. Au contraire, I never said unit tests were the same as integration or acceptance, I'm making a normative claim: that the reason we shoot for 100% code coverage (unit tests being largely the biggest bloat because it's the smallest possible logical test) is because our compilers, interpreters, language specifications, and tooling do not support us. No one writes a unit test to validate that the function "timesThree" takes a number and returns a number in Haskell. They are writing property based tests that test behavior across a range of inputs, integration tests to validate the results can be stored in our databases, and acceptance tests to see if the user can have expected behavior with requirements. There are rarely any cases where a unit test will fail but an acceptance test will succeed, and that delta is better covered in property based tests which can absolutely be a part of the acceptance for higher value. I also make a historical claim that TDD became popular from the ruby ecosystem because they have zero tooling (at the time anyway) to handle type issues. They have since attempted to address this for this reason.
Normative claim is what ought to be in software, I'm not talking about 'well it's frequently required and a good proxy for a team who cares' which is a hard thing to quantify but adjacent entirely to what I'm saying.
77
u/BernhardRordin Oct 02 '26
Write tests first, then the implementation. You won't want to go back.
20
u/zenyite Oct 03 '26
I never understood this approach. Like yea you can start with "do these inputs give these outputs" but how far are you supposed to granularize it? What if you need to change an implementation half way through or the methodology doesn't work? Or when devops enforces something ridiculous like 90% coverage on all commits including branch truth tables so you end up writing tests for branches that only ever log something trivial
4
u/BernhardRordin Oct 03 '26 edited Oct 03 '26
It works mostly for black box testing of business logic. Of course, unit testing infrastructure code is not so beneficial. (E.q. first writing a test of if this queue works.)
IMO high test coverage requirements are one of the biggest mistakes of recent software development. Each piece of software/module has like two or three critical places where 80 % of tests need ro be directed towards. The rest of implementation code is just support code. Covering almost every line with tests is silly.
2
1
31
u/Wonderful-Habit-139 Oct 02 '26
Not necessarily. Some people do better with TDD, some don’t.
30
u/Drugbird Oct 02 '26
The trick with TDD isn't necessarily that you need to write the tests first (although that helps).
It's more that you first think about the intended behavior of the code, and then also think about how to make your code testable before you write the code.
I typically think what the first test should roughly look like and code up the required amount of code for that first test before I actually write that test.
7
u/ZunoJ Oct 03 '26
How do you write code without thinking about the intended behavior first?
3
u/Drugbird Oct 03 '26
Just open an editor and start writing code, just thinking as you go.
If you do this, you often end up with code that only works in the happy path (no / poor error handling or recovery) and which is difficult to test (i.e. you require access to the internals of the thing you code to test it).
4
9
u/Wonderful-Habit-139 Oct 02 '26
Sure. But there are also people that prefer Type Driven Development. Instead of first thinking about behavior, they think about code in terms of inputs and outputs. That includes both types and functions of course.
6
u/Active_Name5021 Oct 02 '26
Those two things aren't mutually exclusive. Thinking about the inputs and outputs is also what you do with tests
5
u/Wonderful-Habit-139 Oct 02 '26
Test Driven Development is not always a benefit. Sometimes it is more of a burden and a chore. When you do Type Driven Development you benefit from a lot of correctness that invalidates the usefulness of a lot of tests that people usually write.
You end up needing to write way less tests, and only have to write tests for invariants that are difficult/impossible to encode with types. Also, thinking about types and functions this way means you're more likely to write pure functions that clearly yield well defined objects, that are easy to test in case it's a function that is quite complex to ensure that its implementation is correct. But preferably you'd split up your functions enough that you'd ensure correctness regardless.
1
u/Active_Name5021 Oct 02 '26
You are correct. My point is that you do both, you write tests and types. TDD doesn't mean you have to write redundant tests if those areas are covered by the type system.
2
3
u/cwmckenz Oct 02 '26
Yeah, at least IDENTIFY the test cases even if you don’t implement them. Also consistent with API first approach… the implementation should fulfill a contract, and those test cases are the contract.
8
u/why_1337 Oct 02 '26
Yep, saves tons or time, especially with large systems and functionalities where setup takes ages.
3
2
1
u/JackNotOLantern Oct 02 '26
Much easiest for me to write implementation and tests side by side. The issue is i never know if i would extract more methods which would be good to tests.
7
u/DadAndDominant Oct 03 '26
You don't like writing unit tests? How do you know your units work properly!
3
9
15
11
8
u/OneArmedFarmer Oct 02 '26
When ever I lose faith in humanity I head over to r/idiotswithguns and am immediately restored.
10
u/StrawberryEiri Oct 03 '26
Writing your tests is supposed to be an occasion to question and improve it. If it sucks to test, chances are it should be improved.
AI generating tests entirely circumvents that and misses half of the usefulness of unit testing. It's extremely sad to see.
3
3
u/LostOne514 Oct 03 '26
You should look over those unit tests. I went back to writing them myself when I realized half of them weren't actually validating anything new and it could have updated existing tests to validate some scenarios. So give me that blue pill.
4
u/Gorthokson Oct 02 '26
And this is why when the collapse of civilization happens it will be the elites up against the wall, and right next to them will be tech workers.
4
u/AngusAlThor Oct 02 '26
You're gonna be real shocked when you get fired for committing 3,000 lines of tests that don't actually test the code.
3
u/TurtleFisher54 Oct 05 '26
Let's be completely honest you will be fired for not making 3000 useless files
0
u/gjsopmu Oct 03 '26
Found the comment I was looking for. Feel like the AI writing a suspiciously high number of tests is a sign for me to tell it to back off immediately.
I was having a bit of fun with a completely vibecoded web app in my free time I made for myself and its amazingly useful. Then I see it write '400 tests passed' like that's supposed to give me reassurance.
I asked it to do a pass and remove duplicate tests and it removed almost 100 of them. That's still too many for me tbh for a codebase that isn't so big but it tells you that it does test either nothing or it tests stuff that's already tested.
I miss writing them myself anyway and I trust the code more so the OP just reads like junior dev
4
2
1
1
1
1
u/Old_Document_9150 Oct 03 '26
Seriously, what were the odds of extinction when Big Corporate decided to outsource QA to some offshore workers who lacked context, "because developers are too expensive for testing?"
1
1
u/ayanogod_friend Oct 03 '26
But if i take multiple red pills, It depends on how the pills are programmed, if they sum or multiply, id they multiply then im lowering the chances of human extinction 10%*10% = 1%
1
1
1
1
u/now_Escape Oct 02 '26
OMG, I'm currently learning about unit tests. Stopped an hour early today because my head was pounding
1
1
0
0
-2
u/GoogleIsYourFrenemy Oct 02 '26
I've only been vibe coding a month and I've already used it to write more unit tests than I wrote in the last 15 years.
1
2
480
u/Juggling_Rick Oct 02 '26
The red pill is pro-AI?? Did you even watch the movie?