Code Coverage Dashboard

Sebastian Bergmann » 03 April 2010 » in Announcements » 2 Comments

Almost a year ago I started to factor out all the code that deals with code coverage in PHPUnit and put it into a separate component. The name of this component is PHP_CodeCoverage.

PHP_CodeCoverage is a library that provides collection, processing, and rendering functionality for PHP code coverage information. Its architecture has support for multiple backends for collecting code coverage information (currently only support for Xdebug is implemented) and for reporting code coverage information (for instance using Clover XML or as an HTML report).

As mentioned earlier, the HTML report that is generated by PHP_CodeCoverage shows the CRAP Index software metric for each function or method. Today I built on this earlier development and added a "dashboard view" to the HTML report that shows the following software metrics:

  • Class Coverage Distribution: This is a bar chart that shows how many classes have 0%, ..., 100% code coverage
  • Class Complexity: This is a scatter chart that shows the coverage (X axis) and the complexity (Y axis) of the classes
  • Top Project Risks: This is list of the classes with the highest CRAP Index
  • Least Tested Methods: This is the list of the least tested methods

You can see an example of the dashboard view below:

PHP_CodeCoverage Dashboard View
Defined tags for this entry: , ,

Trackback specific URI for this entry

2 Comments to "Code Coverage Dashboard"

Display comments as (Linear | Threaded)
  1. Cédric
    06/04/2010 at 15:56 Permalink
    I am very interested in this dashboard, since I have just showed code coverage and others automated cool piece of information to my colleagues, and they fond of them!
    Do you know when this dashboard will by available?

    Thanks
    Cédric

    Reply

  2. Johann
    03/05/2010 at 14:20 Permalink
    This looks amazing. I'm with Cedric and would also like to know when this might come out. I've been using code coverage tools for C++ and Java for ages and some of them have really nice reports (like Bullseye).

    If I can show similar metrics in such a nice format to the suits for our PHP projects, you can bet they'd love it.

    Reply

1 Trackback to "Code Coverage Dashboard"

  1. Sebastian Bergmann 23/07/2010 at 14:13
    When you look at the list of changes for PHPUnit 3.5, you will see that many of them deal with refactoring to components. Here is an overview of these new components: PHP_CodeCoverageThe collection, processing, and rendering of code coverage information

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Submitted comments will be subject to moderation before being displayed.