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
Slide 7
Slide 7 text
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)
Slide 8
Slide 8 text
So we write our new feature
Slide 9
Slide 9 text
Coverage has improved
Very easy to stop here and say things are better.
Slide 10
Slide 10 text
Running Diff-Cover
Slide 11
Slide 11 text
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.
Slide 12
Slide 12 text
Run it again!
Slide 13
Slide 13 text
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
Slide 14
Slide 14 text
Diff Quality
● Use static analyzers over Changes rather than the
entire project
● Today supports pep8, pyflakes, pylint
Slide 15
Slide 15 text
No content
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
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
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
No content
Slide 20
Slide 20 text
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