3 ms·
Yes, we should all write unit tests, have 100% coverage, all that stuff. I practice it never happens. If you are lucky enough to have unit tests, they are full
by GuB-42 9y ago
Yes, we should all write unit tests, have 100% coverage, all that stuff. I practice it never happens.
If you are lucky enough to have unit tests, they are full of holes and/or outdated. I've seen it happen on critical software. The kind where a crash can literally kill people, and where appropriate testing is mandated by law.
Relying on unit tests for anything is madness. They are nice to have, but they are just another layer in a defense in depth strategy, not something you can count on. Static checks (including typing) is another layer, just like code reviews, functional tests, etc...
And yeah, you can write very robust code in any language, but Python doesn't help much.
- kiriakasis 9y agoi agree, something i always wondered about 100% coverage was "am i going to unit test my unit tests too"
- luord 9y ago> they are [...] outdated How can an unit test be outdated? Honest question because, from what I've seen, if whatever it was testing doesn't work anymore (or if something that wasn't supposed to work starts working) then the test fails, fulfilling its purpose. In other words: I don't see how I would write a test that wasn't self-updating, by alerting that it needs to be changed. > Relying on unit tests for anything is madness. They are nice to have, but they are just another layer in a defense in depth strategy, not something you can count on. Static checks (including typing) is another layer, just like code reviews, functional tests, etc... Not sure what you tried to say here. "Relying on unit tests is madness" I can understand (if not agree with), but then you went out to compare it with other practices. Is relying in those practices madness too? If so, what's the point of anything? > And yeah, you can write very robust code in any language, but Python doesn't help much. Is there a language that does? I could turn this around and say that you can write truly horrible code in any language, and [insert whatever language you like here] doesn't prevent it much.