Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso...
by samhw on Friday January 07, 2022 @01:17PM
(#29842623)
I think 100% code coverage is folly. Spreading tests so widely near-inevitably means they're also going to be thin. In any codebase I'm working on, I would focus my attention on testing functions which are either (a) crucially important or (b) significantly complex (and I mean real complexity, not just the cyclomatic complexity of the control flow inside the function itself).
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso...
by lumost on Friday January 07, 2022 @01:21PM
(#29842671)
Fully agree, but I never want to see a missed function argument programming error in customer facing code. In python you really do need code coverage to achieve this goal - static languages have some additional flexibility.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso...
by lanstin on Friday January 07, 2022 @02:04PM
(#29843282)
Or a rich suite of linters religiously applied. Never save a file with red lines in flymake or the equivalent. Ed: actually, I am unsure if my current suite would miss required parameters. I tend to have defaults for all but the first parameter or two, so not a big issue for me I guess. I do like a compile time check on stuff tho, one of the reasons I am doing more and more tools in Go.
Even without static typing, argument length verification etc. can be done with a suitable compiler. In python we are left chasing 100% code coverage in unit tests as it's the only way to be certain that the code doesn't include a silly mistake.