On PHPUnit and Software Metrics
Manuel Pichler's recent blog entry on PHP_Depend prompted me to write about my opinion on the future of software metrics and project mess detection in PHPUnit. When I started to work on these projects, there was no other place for me then to develop them as part of PHPUnit. There was no phpUnderControl yet, and PHPUnit already had some utility classes that provided the neccessary infrastructure to quickly implement software metrics. But the more I thought about it, I realized that these features do not belong into PHPUnit but into a suite of tools that PHPUnit is a well-integrated part of. However, given the fact that PHPUnit's development takes place in the open and people were already eagerly waiting for the software metrics and project mess detection support, I decided -- against my better judgement -- to release the functionality in question as part of PHPUnit 3.2. Now that tools such as PHP_CodeSniffer get the attention they deserve and need and that tools such as phpUnderControl and PHP_Depend are being developed, I think it is time to take the software metrics functionality out of PHPUnit (see changeset 2377). This will not happen over night, though. The features in question will be marked as being deprecated for PHPUnit 3.3 before they will be removed in PHPUnit 3.4. Work has already begun (see changeset 2351) on the required integration between projects such as PHPUnit (which provides Code Coverage information in XML format) and PHP_CodeSniffer (which calculates, for instance, the Cyclomatic Complexity software metrics) so that phpUnderControl process these two inputs in order to calculate the Change Risk Analysis and Predictions (CRAP) index.