3 ms·
My review of that PR would be : "where's the test for this parsing code?". I'd expect to see many test inputs that are both valid and invalid. Note: I'm very
by dboreham 4y ago
My review of that PR would be : "where's the test for this parsing code?".
I'd expect to see many test inputs that are both valid and invalid.
Note: I'm very much not a testing freak, but for this kind of code I think it's essential to have unit tests, if only because they provide necessary documentation about the intended functionality of the code.
- trasz 4y agoIf you wrote a code that contains some bug, usually your your tests won’t catch it either. You’d need a fuzzer instead. But then again, it just doesn’t work this way - you can’t write perfect code, you need to follow the principle of least privilege, ie use compartmentalisation.
- water8 4y agoWhat’s the point of compartmentalization, if all your airlocks are broken or unsecured?
- trasz 4y agoIts not compartmentalization if your airlocks are broken or unsecured.
- e12e 4y agoWell, using a fuzzer would probably be a good idea? See eg: > Fuzzing 100+ open source projects with OSS-Fuzz - lessons learned. (2021) https://adalogics.com/blog/fuzzing-100-open-source-projects-with-oss-fuzz https://adalogics.com/blog/fuzzing-100-open-source-projects-... Short hn discussion of post (but project has been featured many times): https://news.ycombinator.com/item?id=28391620 https://news.ycombinator.com/item?id=28391620