Delete all code! 100% testing coverage, the lazy way!
summary
Claims a hack that will delete untested branches to give a codebase 100% coverage; builds a Python tool called magikov (GPL) that performs source-to-source edits via AST manipulation and the Google pasta library. Starts from ~46% coverage, raises it to 86% during development and to 100% after running the tool. Encounters and fixes real problems: side effects in if tests, yield turning functions into generators, and a bug in coverage.py that initially breaks deleted lines.
AI-written summary · about
chapters (10)
- 0:00Intro
- 0:55What is testing coverage
- 2:16Example
- 2:48Source code transformation
- 3:24ASTs
- 4:00Python Standard Library
- 5:03Pasta
- 5:41Magikov
- 7:24Demo
- 10:11Conclusion
related talks
10m99% is not enough - full test coverage and why it's awesome
03mTest coverage
30mAutomating Code Quality
38mMutants to the rescue: How effective are your unit tests?
43mFrom 0% to Cleanly Refactored 100% tested code
26mMashing up py.test, coverage.py and ast.py to take TDD to a new level
36mMutation Testing: Did my test break my code ? 🤔
42mThe state of code coverage for Kotlin
