How to get "100% test coverage"? Short answer: Hire Unicorns as testers.
Slightly less flippant answer: "100% test coverage" is a mythical beast. It assumes that you can test your program on all possible inputs in all possible states and that you can anticipate all of these ahead of time. Answer with a practical starting point: One thing you can do is ensure that your test suite exercises every line of code in your program. Ned Batchelder has written coverage.py http://nedbatchelder.com/code/coverage/. Not an answer but a reminder: Regression testing is your friend. Anytime you fix a bug in your code consider adding a unit test for that bug. There may be underlying problems in your code/data structures that remain after the "fix". Blunt answer: How much test coverage can you afford? There are cost/benefit tradeoffs. Even Boeing and NASA have to draw the line somewhere. On Fri, Jan 4, 2013 at 7:15 PM, Mike Orr <[email protected]> wrote: > The Python projects I'm involved in are starting to push more for > "100% test coverage", so how does one do coverage? Would anyone care > to give a talk on this? It could maybe get into wider testing issues > too, which we haven't covered for a year or so (except the bit in > Itamar's talk yesterday). There's always the evolving state of > Unittest vs Nose vs py.test to discuss. > > -- > Mike Orr <[email protected]> > -- Some radio waves were modulated in the creation of this email.
