Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Diff-Cover

 Diff-Cover

Diff cover is a tool that gives you a code coverage number on a diff rather than the entire project. The talk walks though how this works and discusses an tool that does the same but with quality tools like pep8

Matt Bachmann

April 10, 2015
Tweet

More Decks by Matt Bachmann

Other Decks in Programming

Transcript

  1. Lets Talk Reality • We are on a deadline ◦

    Covering the entire project may be infeasible • We don’t necessarily understand everything ◦ This can make for weak tests • But… we can at least improve going forward
  2. Diff-Cover • Runs reports on Changes in a branch •

    Verify that any new change is covered by tests • Works with any language that can generate Cobertura XML reports (in theory)
  3. Write More Tests! Bugs are a superstitious and cowardly lot.

    When tested they will show themselves. Developers must fight against chaos. Good tests are a critical tool.
  4. WINNER! • You merge the code • The project is

    better than you found it • Batman is pleased to code that works for once http://dorkhorde.blogspot.com/2010/09/happy-little-batman.html
  5. Diff Quality • Use static analyzers over Changes rather than

    the entire project • Today supports pep8, pyflakes, pylint
  6. More features! • --fail-under option allows you to fail a

    build if the coverage percent or quality percent is not up to snuff ◦ Very nice when integrating into CI • --html-report Make super snazzy reports ◦ Display nicely with the html-publisher jenkins plugin
  7. Acknowledgments • https://github.com/wedaly ◦ Creator of diff-cover • https://github.com/sarina ◦

    Implemented diff-quality • 14 other contributors to date • https://github.com/bachmann1234/diff-cover