News Feed
Sections




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

Jacob Santos' Blog:
What is your C.R.A.P. Index?
August 07, 2007 @ 11:57:00

In relation to a recent announcement from Sebastian Bergmann about the inclusion of Cyclometic Complexity testing in the upcoming PHPUnit release, Jacob Santos has taken a look at its use - find the C.R.A.P. of a process.

The Change Risk Analysis and Predictions (CRAP) index is to give some idea how difficult it would be to maintain the code base. It is not to be used in evaluating how "beautiful" the code is.

He had to modify things slightly in PHPUnit to get it to work with entire files/functions, but it was still simple to use the testing software to create each file's CRAP index. For his examples, he chose the WordPress code and includes the code he used for the tests - two functions: getCCLevel and getCrapIndex. The results of the report are also included.

1 comment voice your opinion now!
phpunit crap index cyclomatic complexity unittest phpunit crap index cyclomatic complexity unittest


blog comments powered by Disqus

Similar Posts

Giorgio Sironi's Blog: PHPUnit and Phing cohabitation

Padraic Brady's Blog: PHP Mutation Testing With MutateMe

Jani Hartikainen's Blog: Unit testing 5: test-driven development

Query7.com: A Look At PHP 5.3 Frameworks - Symfony2

Sebastian Bergmann's Blog: PHPUnit 3.5 Upgrading Woes


Community Events





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


install library api release bugfix laravel podcast tips language introduction interview framework list series voicesoftheelephpant opinion package symfony deployment community

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