News for hackers. Stuff that matters.
Re:Has UML died without anyone noticing? by closeparen on Sunday April 25, 2021 @11:38PM (#26939018)
How rational this is depends on your testing culture. With a comprehensive test suite, the guarantees offered by a compiler are not very important. The software goes through all its runtime paces before production anyway.

If you’re not going to write any tests, then obviously compile time is a crucial line of defense.

Most shops will be somewhere in the middle where compiler guarantees offer a real but marginal benefit, to be weighed against other tradeoffs.

Re:Has UML died without anyone noticing? by zozbot234 on Monday April 26, 2021 @05:17AM (#26940707)
The point is not "let's just not write any tests". With a compiler that offers meaningful guarantees, you can write more worthwhile tests than "does this function always take/return integers".
Re:Has UML died without anyone noticing? by closeparen on Monday April 26, 2021 @12:04PM (#26944092)
If you’re passing or returning values of the wrong type, it’s going to blow up one of your tests. Asserting on a value implicitly asserts its type. Passing a value and not getting a runtime error for your trouble, pretty strongly indicates that it’s the right type.
Re:Has UML died without anyone noticing? by corty on Monday April 26, 2021 @04:37AM (#26940519)
Writing tests instead of utilizing the compiler is wasted time and effort. And it is one of the worst kinds of code duplication, because you are reimplementing all the type-checking, bounds-checking, etc. Usually badly, buggy and again and again. And since usually the test suite doesn't have tests for the tests, you will only notice if something breaks in the most inopportune occasion possible.
Re:Has UML died without anyone noticing? by jnwatson on Monday April 26, 2021 @10:54AM (#26943136)
In unit testing for dynamically typed languages, very rarely do you make explicit type checks. The type checking naturally falls out of testing for correct behavior.

The "tests for the tests" is code coverage.