Read my book

I wrote books about Webpack and React. Check them out!

Friday, June 5, 2009

Code coverage links

I have pondered for a while now how to implement code coverage functionality for TinyTest. I think I finally found the right way! Initially I thought it might be smart to implement own PHP parser based on PHP's BNF description (formal description of the language!). I did not manage to find such description anywhere. I suppose there must be one somewhere. :)

It might have been too tedious to do it this way anyhow. The next best thing is to have someone other implement the coverage part for you. I decided to look into the sources of existing testing tools providing support for coverage. PHPUnit gave me the needed clue, it uses Xdebug to handle coverage. I suppose this is the way I should handle it too. It is easy to get line coverage this way. Checking out branch coverage might take some extra work but that's alright.

During my research I found some useful sites. In addition I have listed some related material: