3 ms·
Unit tests allow complex and nontrivial code to be modified without introducing nasty bugs. A lot of software that I've seen that has no unit tests and runs wel
by ironman1478 4y ago
Unit tests allow complex and nontrivial code to be modified without introducing nasty bugs. A lot of software that I've seen that has no unit tests and runs well got there because people slaved away cleaning up nasty bugs that would have been caught with unit tests. I cannot understand how people think unit tests aren't worth doing and I can only assume these people don't know how to prove their code works, which is quite worrying.
- theshrike79 4y agoUnit tests are overrated. They are for algorithms and really complex functions. Unit testing with 100% coverage is a red flag for me, someone spend insane amounts of time writing tests for useless shit. Integration tests are the ones that determine whether stuff actually works, have more of them. There's no point in having a test to see if pushing a button produces the correct event if there is no integration test to see if pushing the button does what it's supposed to do in the backend.
- ironman1478 4y agoWhat type of software do you write? I cant imagine writing a db implementation without unit tests for example.
- YZF 4y agoJust like Agile unit tests came about as a fashion. I think the history is a bit murky but Kent Beck was one of the proponents and he also happens to be one of the signatories on the Agile Manifesto. Let's say circa 1997. There was plenty of very well written software in existence at that point. Large applications, operating systems, databases, games, embedded applications etc. etc. That's not to say there's anything bad about unit tests just like there's nothing bad about the Agile principles. They don't prove your code works though, that's not really possible. A useful tool- sure.
- astrange 4y agoThere are bad things about unit tests compared to any other way of getting test coverage. You have to make your architecture more complex to allow them - people call this “testable” and pretend dependency injection and other weird ways of avoiding straightforward code are good. And they rarely fail and have to be maintained. It might be good to write them as you’re bringing up new code, but deleting the useless ones after that could be an improvement.
- ironman1478 4y agoWell written by what metric? How are you evaluating that? And how do those software systems compare in complexity to what is being developed today?
- YZF 4y agoHonestly- subjectively. Does the software crash often, do I see weird behaviour as a user, what's the number of users, bug report rates. I think those systems do compare in complexity to at least pieces of todays software. A lot of this older code is still powering things today/morphed into newer/larger systems. I've worked in more recent times on software that was used by millions of people, was extremely reliable, and didn't have a lot of unit tests. We did have other forms of automated testing though.