 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
QaFoo.com: Code Coverage with Behat
by Chris Cornutt 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.
voice your opinion now!
code coverage testing functional behat tutorial phpcov phpcodecoverage
Volker Dusch's Blog: Textual code coverage information for PHPUnit
by Chris Cornutt 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).
voice your opinion now!
textual code coverage report phpunit tutorial feature summary
PHP.net: TestFest 2008 wrap-up
by Chris Cornutt 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).
voice your opinion now!
testfest2008 wrapup test coverage phpt elephpant
Community News: php|tek 2008 Coverage
by Chris Cornutt 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:
- Ivo Jansch: Day -1, Day 0, Day 1, Day 2, Day 3 (and wrapup)
- Eli White: Heading to php|tek
- Greg Beaver: phar is near at php|tek
- Ivo Jansch's coverage of the Zend/Microsoft issue during Joe Stagner's keynote
- Brian DeShong's slides - The Grown-Up Company's Guide to Development and Robust Batch Processing with PHP
- Maggie Nelson slides - Keeping You DB and PHP in Sync, Angering the Database Gods
- Sebastian Bergmann's slides - Type-Safe Objects in PHP, Understanding the PHP Object Model, Quality Assurance in PHP Projects
- a wrapup of the conference from Ben Ramsey
- Matthew Turland's look back at the conferece
- Gennady Feldman's wrapup
- Maggie Nelson's slides for Angering the Database Gods
- a heads-up from Marco Tabini to look in the near future for some incriminating video of some php|architect staff in KISS outfits
- Jeff Moore's wrapup of this year's conference and links to his slides - Exceptional PHP and Coding for Success: Writing Software You'll Be Able To Understand Next Month
- Another recap by Andrew Culver
- slides from Greg Beaver - PEAR, Phar and Smart PHP
- slides from Ed Finkler's talks - Building Desktop RIAs with PHP, HTML & Javascript in AIR, Securing the PHP Environment with PHPSecinfo
- an overview from Christopher Jones
Check out more live from the conference on the php|tek Live page on the php|architect website.
voice your opinion now!
phptek2008 coverage conference live photo twitter
Stoyan Stefanov's Blog: www vs no-www and cookies
by Chris Cornutt May 14, 2008 @ 11:18:39
Stoyan Stefanov has come up against one of the frustrations of web development involving cookies - problems caused by the switch from a "www." in the host to none. He's come up with a test to show you how cookies are set and where you can access them from.
One of the implications of following the rule is related to the whole www vs no-www question. Basically you should always use www if you're planning to use any other sub-domains and you want them cookie-free. This is because you have no way to set a cookie only to the top-level domain.
His code sets cookies for the ".phpied.com", "phpied.com" and "www.phpied.com" domains. Since the domains without the "www" offer a bit broader range of possible matches, he recommends that if you're ever going to use any kind of subdomain, you'll want to use the more broad cookie to cover it.
voice your opinion now!
cookie hostname test board coverage
Debuggable Blog: Code Coverage Analysis soon in CakePHP - Test How Well You Test
by Chris Cornutt May 01, 2008 @ 11:19:54
In a new post to the Debuggable blog, Tim Koschutzki talks some about the work he's been doing on the code coverage analysis for the upcoming CakePHP release:
There are several different kinds of criteria to code coverage. The two most important ones are line coverage (or statement coverage as wikipedia puts it) and path coverage. [...] So how is it going to work? Pretty simple actually. Whenever you run a CakePHP test case Cake assembles information in the background about which lines of your subject-under-test are called.
He includes a few screenshots of the code coverage being run and the end result of the runner with the percent covered.
voice your opinion now!
coverage cakephp framework test unittest
|
Community Events
Don't see your event here? Let us know!
|