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

QaFoo.com:
Code Coverage with Behat
April 03, 2013 @ 12:37:30

On the QaFoo blog today there's a post for those using the Behat testing tool showing a way to collect code coverage metrics based on your tests using the PHP_CodeCoverage library and phpcov.

There is generally no point in having code coverage for Behat test cases because of their nature: The purpose of an acceptance test is to assert a certain behavior of an application, not to technically test a piece of code. Therefore, there is no point in checking for uncovered code pieces in order to write a Behat test for it. That said, there is still a scenario where you want to peek at code coverage of Behat tests: When creating them as wide-coverage tests before starting to refactor legacy code. Behat in combination with Mink provides you with a great tool for such tests.

They help you get the tools installed and show the code you'll need to add to the application itself to collect the coverage data as the tests execute. It keys off of a file existing/not existing to know if it should execute the coverage or not. The phpcov tool can then be used to generate the HTML output of the coverage information for easy viewing.

0 comments voice your opinion now!
code coverage testing functional behat tutorial phpcov phpcodecoverage

Link: http://qafoo.com/blog/040_code_coverage_with_behat.html

blog comments powered by Disqus

Similar Posts

PHPBuilder.com: PHP and Adobe Flex

PHP-GTK Community Site: Extending GtkMenu class for Popup menu dialog

PHPBuilder.com: Compose a MVC Paradigm for PHP with Symfony

Jonathan Wage's Blog: Blending the Doctrine ORM and MongoDB ODM

Jeremy Cook: Continuous Deployment with Symfony2, Jenkins and Capifony


Community Events











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


hhvm release package performance opinion hack security database overview facebook application introduction symfony2 unittest framework install podcast language component composer

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