3 ms·
"much better safety" Every bug to to ever hit production has * passed all manual testing * passed all unit tests * passed the type checker
by gregors 4y ago
"much better safety"
Every bug to to ever hit production has
* passed all manual testing
* passed all unit tests
* passed the type checker
- pohl 4y agoEveryone who has died drank milk.
- Kinrany 4y agoThis is a fully general argument for debugging in production.
- __alexs 4y agoI have written and shipped many Python bugs that did not pass the type checker but it was impossible to run the type checker because it would not be invented until many years later.
- gregors 4y agoIf you had a type checker bug you didn't you manually test that code path at the bare minimum. Type check bugs are the most simplistic bugs to catch. Is it nice sure, but if you can't spot those before you ship I can almost guarantee that you have larger logic bugs that the types won't catch. What isn't helpful is the the notion that types replace testing. Either manual testing or unit/functional/generative testing. It isn't "safer" at all, it does speed up development by catching the simple bugs so the run edit compile loop is less. If you're saying "my code compiles then it's works", I don't buy it.
- __alexs 4y ago> If you had a type checker bug you didn't you manually test that code path at the bare minimum. I'm glad that you agree type checkers help avoid error prone and expensive manual testing work. > What isn't helpful is the the notion that types replace testing. Types are a type of testing. They are another tool in the toolbox for writing correct programs.
- schwartzworld 4y ago> passed all manual testing Or been ignored. It happens. > passed all unit tests If they have been written at all. And every bugfix should come with a regression test. > passed the type checker If it hasn't been disabled. And I would expect that a bug that could be fixed with better typing would include making types more restrictive when necessary. Unfortunately, tools like testing and types are seen in two conflicting ways. Some people embrace them and see that they can use them to write better code with less bugs. Others see them as obstacles that have been placed in their way due to the additional learning curve.
- nightski 4y agoThat's a tautology. If you have manual testing, unit testing, and type checking then of course you are only going to see bugs that pass those. But what bugs did you not see hit production because these eliminated it?