News for hackers. Stuff that matters.
Re:Absolute truths I unlearned as junior developer by vortico on Friday June 07, 2019 @10:53AM (#20125135)
Perhaps the reason for "nobody writes tests" in the real-world isn't primarily because of time/cost, but because virtually no real potential bugs are testable. If you're writing a JPEG encoder or database model handler, yes, you can test that all day, but those things already exist and are well-tested for you. But if you're designing retail software or a web app, there are 2^10000 things that can go wrong, so most companies ignore automated unit testing in favor of human quality control.
Re:Absolute truths I unlearned as junior developer by wan23 on Friday June 07, 2019 @01:00PM (#20126587)
This is all wrong. When you have enough people working on a codebase such that not everyone knows everything about it, tests are a great way to document the behavior. They're much better than something like a wiki, in fact, because nobody actually keeps that kind of documentation up to date.
Re:Absolute truths I unlearned as junior developer by vortico on Friday June 07, 2019 @06:25PM (#20129188)
I'm not arguing that tests are useless. I'm arguing that tests are usually impossible. I invite you to suggest a test for https://github.com/VCVRack/Rack for example that could either 1) have prevented a bug, or 2) document the software's behavior.
Re:Absolute truths I unlearned as junior developer by nickda on Saturday June 08, 2019 @03:22PM (#20134496)
You only have 2^10000 if you have bad boundaries and overcoupling of your subsystems. Thus another benefit of unit testing is validating your architecture: bad architectures are inherently difficult to unit test.
Re:Absolute truths I unlearned as junior developer by vortico on Saturday June 08, 2019 @08:08PM (#20136072)
>bad boundaries and overcoupling of your subsystems

And that's the overwhelming majority of ways to make money with software. Think of every video game, desktop application, and mobile app that people purchase. What you call "bad boundary" isn't bad at all. The customers just expect the software to do 2^10000 combinations of possible things across N platforms on M hardware and integration with P external services. Imagine if you emailed a company's tech support saying that the CAD software you bought doesn't work with your Nvidia 1060, and they responded "sorry, that makes our sybsystems overcoupled".