News Feed
Jobs Feed
Sections




News Archive
feed this:

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

The PHP.cc Blog:
PHPUnit 4.0 Code Coverage Improvements
March 10, 2014 @ 10:47:41

The latest version of the popular PHP unit testing tool PHPUnit has officially been released (version 4.0.0) and comes with some nice improvements. In this post to the PHPcc blog Sebastian Bergmann talks about enhancements in one area - code coverage reporting.

One of the highlights of PHPUnit 4.0, which was released last week, is an improvement of the @covers annotation and the addition of the @uses annotation for better code coverage analysis.

He includes a few simple code snippets showing you how the "@covers" annotation has been working and how it can be used in both strict and non-strict modes. He also introduces the "@uses" annotation to define which objects the test is using and how the two interact. He finishes off the post with a mention of the "--strict-coverage" command line flag (or the more general "--strict").

0 comments voice your opinion now!
code coverage improvements phpunit unittest

Link: http://thephp.cc/viewpoints/blog/2014/03/phpunit-4-0-code-coverage-improvements

VG Tech:
Generating Code Coverage of Behat Tests
January 22, 2014 @ 10:52:57

On the VGTech blog today Christer Edvartsen looks at a method of generating the code coverage of Behat tests using a special bit of code and the $_SERVER superglobal to detect what parts of the code is being executed.

Yes, I know, it sounds silly, but bear with me. The nature of acceptance tests is not really to tests units of code, but to assure that the behavior of your application meets a certain set of criteria (Behat Scenarios). When your applications grow over time, code coverage can be a nice tool to help you pinpoint where you need to add more tests. In a perfect world tests are added while implementing new features so that your applications are always fully tested, but that isn't always as easy as it sounds.

The first chunk of code is something that would go in the router of your application, capturing the "collect coverage" and "enable coverage" input variables. The other part of the code creates a unique ID in the set up and uses it in a call (via Guzzle) to the server to start the tracking. In the tear down method, it sends the call to get the coverage results and process them through the PHP_CodeCoverage tool from Sebastian Bergmann.

0 comments voice your opinion now!
code coverage behat test tutorial functional

Link: http://tech.vg.no/2014/01/21/generating-code-coverage-of-behat-tests

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 5
December 24, 2013 @ 13:09:05

The Dutch Web Alliance has posted the fifth part (of seven) of their series looking at configuring the PHPStorm IDE to remotely debug and run your unit tests. In this article they focus in on getting coverage information from the tests and generating the reports.

They walk you through all of the terminology and configuration you'll need to get things working. They include an example of a Closer coverage configuration file (XML) to push the results out where PHPStorm can grab them. They show show the result (screenshot) of the coverage results being shown inside the IDE.

This is part five of the series, so if you'd like to get caught up check out the full table of contents for links to all of the posts so far.

0 comments voice your opinion now!
remote debug unittest code coverage clover report series tutorial

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-5-2/

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

DevHell Podcast:
Episode 3 Beatings Will Continue Until Test Coverage Improves
January 10, 2012 @ 13:58:03

The latest episode of the DevHell podcast has been posted - Episode 3, "Beatings Will Continue Until Test Coverage Improves".

Fresh off our holiday break, we're back with our longest show yet. We talk about Chris' new book The Grumpy Programmer's Guide To Building Testable PHP Applications, including his experiences self-publishing with Leanpub. Chris also explains how he fears no precipitation on his excursions to the Codemash conference in Ohio. Then Ed talks about the thought process that lead to his latest shit-stirring blog post "The MicroPHP Manifesto." Ed may or may not begin crying openly. Finally, we discuss when it might be necessary to trash your existing application and rewrite it.

You can listen to this latest episode either via the in-page player or by downloading the mp3 directly.

0 comments voice your opinion now!
podcast devhell unittest coverage chrishartjes edfinkler


Volker Dusch's Blog:
Textual code coverage information for PHPUnit
November 25, 2011 @ 16:11:41

In a new post to his blog Volker Dusch points out a new feature in a recent release of PHPUnit, the popular unit testing framework for PHP - textual code coverage details.

Three weeks ago PHPUnit 3.6 was released and it has a little new feature you might have missed until now. PHPUnit can now show you code coverage information on the command line.

Options for the report output include: colorizing, writing the output to a file, including a project summary, namespace separation and package (using the @package phpdoc tag) information. He includes a use case he's found for it - small projects where you can cover the whole codebase quickly (with a "watch" command example filtering based on a certain class).

0 comments voice your opinion now!
textual code coverage report phpunit tutorial feature summary


DevShed:
Using Conditional Statements with the Xdebug Extension
March 04, 2009 @ 12:08:43

DevShed continues their series looking at the XDebug extension for PHP with this fifth part looking a bit more at the code coverage functions it comes with.

In this fifth part of a series on using the Xdebug extension to help debug your PHP programs, we'll take a closer look at the xdebug_start_code_coverage() and xdebug_get_code_coverage() functions. Specifically, we'll see how we can extend their usage when working with conditional statements. As always, we'll complement theory with a number of hands-on examples.

They start with a review of the previous tutorial (that started the look at code coverage) and continue on to show how to extend a code coverage class to debug some conditionals and return the results in a simple echoed output.

0 comments voice your opinion now!
conditional statement xdebug tutorial coverage


PHP.net:
TestFest 2008 wrap-up
July 31, 2008 @ 09:32:45

PHP.net has posted a wrapup of this year's TestFest and the great progress that was made to bring the language development up to the next level.

Overall 158 tests have been submitted as part of TestFest 2008 since the launch of the TestFest submission site by 30 different people from people all over the world. Actually this is not counting the various submissions by existing core developers, who also took this opportunity to add some more tests. This has actually increased total test coverage by about 10%.

It also mentions Felix De Vliegher who, because of his large volume of tests (and quality of them), was granted commit rights into the PHP repository to add his in himself. The list of elePHPant winners is included as well. You can also still submit tests through the TestFest submission site (just not for any of the rewards).

0 comments voice your opinion now!
testfest2008 wrapup test coverage phpt elephpant


Community News:
php|tek 2008 Coverage
May 21, 2008 @ 13:45:41

Rather than having a lots of different blog posts scattered all over covering this year's php|tek conference in Chicago, I figured that pulling them all together here would work best. So, without further ado - the coverage from php|tek 2008:

Check out more live from the conference on the php|tek Live page on the php|architect website.

0 comments voice your opinion now!
phptek2008 coverage conference live photo twitter


Antony Dovgal's Blog:
PHP test coverage exceeded 55%
May 21, 2008 @ 08:47:44

As Antony Dovgal points out in a new blog post today, the latest reports on PHP's code coverage have jumped up over the 50% mark (to 56.3% at the time of this post).

It took us about 2 years to get the last 5% and I believe most of the kudos should go to IBM people, who continue to contribute lots of new tests. I hope that the Testfest will help us to speed up this process.

There are still a lot of items in the red that could use some tests, so if you're looking to help out write up some tests or check your area for a TestFest event to get some help.

0 comments voice your opinion now!
test coverage codecoverage over half



Community Events











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


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

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