News Feed
Jobs Feed
Sections




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

Tobias Schlitt's Blog:
Why code coverage matters
April 12, 2007 @ 11:57:00

In a new post today, Tobias Schlitt reinforces something that several developers don't even seem to bother with - generating and understanding coder coverage reports for their applications.

I'm a fan of PHPUnits code coverage reports. And with this sentence I can see a lot of the developers out there shiver, because they are of the opinion, that code coverage reports for unit tests are nonsense and cannot give you any hint on the quality of a test suite. I see it a bit differently. Surely, a high code coverage rate of a test suite does never indicate, that code is well tested (if you have not written the code and tests yourself). But the other way around works: A small code coverage rate definitly means, that the test suite is not sufficient. But let me dig a bit deeper into code coverage and what it gives you.

Benefits he mentions include:

  • Shows how much of your code is actually touched during execution
  • Shows how well the unit test coverage is
  • Helps you create all needed unit tests for your code (a guide or sorts)
He also mentions code mutation as a method for testing the quality of your test suite. However, it's currently not integrated into PHPUnit.

0 comments voice your opinion now!
codecoverage unittest report phpunit codecoverage unittest report phpunit


blog comments powered by Disqus

Similar Posts

Sameer Borate's Blog: Selenium IDE Tutorial - Part 2

International PHP Magazine: Poll Question: What Is the Main Hindrance for PHP 5 to Get Adopted?

Sebastian Bergmann's Blog: AJAX-Based Test Runner for PHPUnit

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 1

Juan Treminio: Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors


Community Events











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


opinion language framework facebook release security composer package dependency introduction install component unittest series code podcast hack symfony2 application hhvm

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