3 ms·
I'll get back on my "tests are better than types" hobby horse and say "or write a single test for this function". The problem here is that an engineer was able
by camgunz 4y ago
I'll get back on my "tests are better than types" hobby horse and say "or write a single test for this function". The problem here is that an engineer was able to push untested code to prod that irrevocably modifies the database.
You need a test here because types won't tell you that a user was banned. And that test would also have caught this error.
- nivertech 4y agoIMO the developer need multiple safety nets from the wide net to the narrow one: - informal methods: - unstructured time to think about the problem (Hammock Driven Development) - write things down = writing is thinking - Rubber Duck Driven Development - design reviews - lightweight formal methods: - Decision Tables - FSMs - FP / Algebraic Type System with rich scalar datatypes - DbC - Design-by-Contract - PBT - Property-based Testing - TDD - example-based tests
- camgunz 4y agoNice, yeah totally. And I would add you shouldn't put all your risk eggs in one safety basket. If you only have types or tests not only are you not covering all your bases, you're asking way too much from a given technique.