3 ms·
90% of working professionally in Go is contriving test cases to achieve statement coverage over each error return branch, something no one would ever do in a la
by closeparen 1y ago
90% of working professionally in Go is contriving test cases to achieve statement coverage over each error return branch, something no one would ever do in a language with exceptions.
- cedws 1y agoTest coverage as a target metric is stupid.
- deleted 1y ago[deleted]
- MeetingsBrowser 1y agowhy?
- cedws 1y agoGoodhart's law, and because there are code paths not worth testing.
- MeetingsBrowser 1y agoIf its not worth testing delete it. Which target metrics do you consider to be good despite Goodhart's law?
- g7r 1y agoMaybe so. However, it is really really handy when you are assessing the completeness of your tests using code coverage, and can clearly see unhandled negative paths. And then you can decide whether some of them deserve dedicated tests or not.
- ncruces 1y agoIt this really bothers you, convince your team to use courtney and focus on the more relevant error branches: the ones where (1) a novel error value is produced or (2) handled rather than those that simply bubble it up. https://github.com/dave/courtney https://github.com/dave/courtney