[xdebug-dev] SoC Xdebug code coverage project update - 20th July 2009

From: Allister Beharry <allister.beharry[@]gmail.com>
Date: Mon, 20 Jul 2009 07:44:13 -0400

This week:
* I added 3 extension constants to control what information is
returned by xdebug_get_code_coverage. By default Xdebug will return a
structure that is compatible with the existing code coverage
structure. Using either XDEBUG_CC_LINE_COVERAGE_EX or
or ORd together returns the additional code coverage data now

*Basic blocks - Xdebug can now return control flow information in the
form of basic blocks. This code was duplicated straight from

The code is available in the Xdebug CVS and I'll also somewhere for a
snapshot for the past week. I'd appreciate it anybody interested could
test it out with their own scripts (counting inside classes isn't
verified to work as yet though.)

I broke up my tasks into a TODO for the project overall and a TODO for
this week:

Project TODOs:
*path coverage research. I have an idea how to go about it but I
promised in my proposal that I would dig into as much existing theory
and code on the subject. There are code coverage tools for C++ and
Java which claim to do path coverage.
*Add compatibility for PHP 4. I'm pretty sure there's code in the new
stuff that will only run on 5.
*coding standards - need a once over through the code to fix coding
standards violations.
*Look for memory leaks
*write tests - I need to verify that the coverage instrumentation is
accurate. I need test scripts covering controw flow structures,
function and class method calls, and exceptions in varying level of
*Update the wiki. I have a ton of stuff I've learned about PHP and
Xdebug that I have to add to the wiki. Xdebug has a lot of code that I
don't think exists as docs (like writing a Zend extension or opcode
handlers .) Plus of course I have to document how my code works and
how to use it
*I'd like to write some code that uses the new code coverage stuff -
this can serve as the best form of documentation. Maybe I can rip
stuff out of PHPUnit and fashion a small code coverage analysis
*make sure I'm using php_error and other php internals functions properly

This week TODOs:
*Fix coding standards
*Get feedback from Derick and Sebastian and make any changes to the
basic blocks presentation. Also try to hunt down some theory and code
on basic blocks and why they're so important in code coverage - I
understand what a basic block is but I haven't seen a practical
example of it used in code coverage
*Complete and test class instrumentation - complete and verify that
instrumenting class instance methods, static methods, construction and
destructors is done correctly.
*Start research on implementing path coverage
*write more tests including class methods and exceptions.
*Add stuff to the wiki - document the different data structures
returned and extension options to use.

Received on Mon Jul 20 2009 - 13:44:16 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST