News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sebastian Bergmann's Blog:
CRAP in PHPUnit 3.5
January 12, 2010 @ 11:14:03

As Sebastian Bergmann mentions in his latest post, he's changed up how the code coverage functionality is handled in PHPUnit so that he can add something new - CRAP.

PHP_CodeCoverage is a component that provides collection, processing, and rendering functionality for PHP code coverage information. [...] Having all code that deals with code coverage in a separate component allows for easier development and better testing. The first result of these improved development conditions is a small new feature that I recently implemented, the support for the CRAP metric.

Your code's CRAP (Change Risk Analysis and Predictions) scoring combines the idea of cyclomatic complexity and code coverage statistics to try to guess at how difficult any given piece of code would be to maintain. You can see an example here - the lower the number the better.

0 comments voice your opinion now!
crap cyclomatic complexity codecoverage phpunit unittest


blog comments powered by Disqus

Similar Posts

Karl Katzke's Blog: PHP: Symfony vs. Zend

DevHell Podcast: Episode 3: Beatings Will Continue Until Test Coverage Improves

NetTuts.com: Hands-On Unit Testing With PHPUnit (Screencast)

Padraic Brady's Blog: Unit Testing: Multiple Assertions And Lazy/Shallow Testing Are Evil

Chris Hartjes' Blog: Metatesting: Extending Your Testing Tools


Community Events

Don't see your event here?
Let us know!


framework opinion laravel language feature unittest interview release development wordpress podcast introduction threedevsandamaybe community library extension laravel5 api voicesoftheelephpant series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework