3 ms·
TL;DR: The blogger took 4 Python projects, rewrote them in Haskell, and 3 of them had type errors. Therefore unit tests are not replacements for static typing.
by koito17 3y ago
TL;DR: The blogger took 4 Python projects, rewrote them in Haskell, and 3 of them had type errors. Therefore unit tests are not replacements for static typing.
---
I don't get how this post says anything about unit testing or static typing at all. Doesn't it just imply that bugs are easier to detect with one method than another method? Most statically typed languages out there have a type system too weak to make the expression 1/0 a compile-time error. But you work around this with linting, unit tests, using a language with a stronger type system, etc.
- l0b0 3y agoYeah, as a big unit testing proponent I'd still definitely say they are not a silver bullet. They simply have a good cost-to-confidence-in-code ratio. So do static types, or type annotated code with strict validation.
- AnimalMuppet 3y agoBut did they have type errors in Python? Or was the type error introduced by translation?
- efarrer 3y agoHi, I'm the author of the blog post and the paper. Every bug that was caught by the Haskel transition was verified to exist in the original Python. If I couldn't reproduce it in the Python, I fixed my translation. More information on my methodology can be found in the paper. https://drive.google.com/file/d/0B5C1aVVb3qRONVhiNDBiNUw0am8/view?resourcekey=0-K61wvljWNvWuiqYkwSUSlQ https://drive.google.com/file/d/0B5C1aVVb3qRONVhiNDBiNUw0am8...
- tome 3y ago> Doesn't it just imply that bugs are easier to detect with one method than another method? Yes, but then how can you say > I don't get how this post says anything about unit testing or static typing at all. It does say something about unit testing and static typing!