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

Lakion Blog:
How we sped up Sylius' Behat suite with Blackfire
Dec 01, 2015 @ 12:08:57

On the Lakion blog there's a recent post sharing how they used the Blackfire.io profiling service to [speed up their application's tests] (Behat)(http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire) and find the "pain points" to fix.

Feedback time is one of the most crucial factors during development and the red - green - refactor cycle. In case of Sylius, the full build used to take two and a half hour, including 55 minutes for only PHP 5.6 jobs. Waiting so long for feedback is not an option for a project of this size and with so many active contributors. As much as I am Xdebug fan, I have never really used it for profiling - the snapshots generation was slowing down the profiled script significantly and resulted in monstrous files, which weren't easy to read.

Half a year after I have first heard of blackfire.io I decided to give it a try. It resulted in a series of pull requests that speeds up Sylius test suites 6 times and reduces memory usage to one tenth.

They go through some of the major bottlenecks that the service helped them locate including:

  • an issue with the login process and their role evaluation handling
  • problems with time spent doing router initialization
  • Doctrine performance issues running it without a class metadata cache

For each item they describe what the service was reporting and how they corrected it in the application. Most of the changes were relatively small, fortunately. They also link to the results from before and after the changes so you can see the difference. As their environment is Symfony-based they end the post with some other helpful Symfony tips to getting the most out of your application and enhancing its performance in a few simple ways.

tagged: blackfireio behat test suite performance improvement profiling

Link: http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire

Dave Marshall:
Probing Test Suite Quality with Mutation Testing
Jan 08, 2015 @ 12:09:42

In this recent post to his site Dave Marshall looks at a method for evaluating the overall quality of your suite of unit tests with help from mutation testing.

100% code coverage should never really be a goal. [...] I feel pursuing 100% coverage in a PHP project is a particularly poor idea as our tooling generally only provides Line Coverage. [...] There are more reasonable coverage metrics to use to measure the quality of a test suite. Sebastian Bergmann and Derick Rethans are working hard on bringing some of these options to us, but for now we're limited to line coverage.

He talks about the difference between line, branch and condition coverage types (with code examples) and which allows for more effective and quality tests to be written. He then talks about the results of an experiment to achieve 100% coverage on the Router component in the Aura project. He found the problem using mutation testing - changing values in the production code to make sure the tests break. He also links over to a new mutation testing tool that's been released to help with this kind of thing, humbug, and some of the results it can report.

Mutation testing is a great thing to have a grasp of in theory, but it's not particularly easy to practice. The tools are very hard to write and then their output is often hard to understand or interpret effectively. I wouldn't recommend practicing with mutation testing on a regular basis, but it's certainly worth considering on the odd occasion.
tagged: test suite quality mutation testing unittest coverage

Link: http://davedevelopment.co.uk/2015/01/07/probing-test-suite-quality-with-mutation-testing.html

Matthew Weier O'Phinney's Blog:
Setting up your Zend_Test test suites
Sep 15, 2008 @ 07:58:11

In a new post to his blog Matthew Weier O'Phinney talks about using the Zend_Test component of the Zend Framework to set up test suites on your application.

Testing and test automation should be easy and the complex approach is overkill for most of our applications. Fortunately, PHPUnit offers some other methods that make doing so relatively simple. The easiest method is to use an XML configuration file.

He includes a basic XML config file for a "My Test Suite" setup defining the application's directory and where to log the end report to. This simple PHPUnit configuration can be used with the "phpunit" command line binary to auto-configure all you'll need for the testing. Matthew also includes the code for a sample TestHelper you can drop right into the app to help set up your environment correctly when testing is needed.

tagged: zendtest zendframework test unittest phpunit suite

Link:

ThinkPHP Blog:
PHProjekt Version 5.2 now available
Dec 21, 2006 @ 09:55:00

As per this post to the ThinkPHP Blog, the latest version of PHPProjekt (5.2) has been made available.

Mayflower announces that Version 5.2 of its free popular open source groupware suite "PHProjekt" is available immediately and ready for download.

Updates in the new version include a refactored user interface, Dojo integration, porting it over to the IBM DB2 database system, an update to the Helpdesk, and automatic email functionality.

Get full information on the PHPProjekt from www.phpprojekt.com.

tagged: phpprojekt release groupware suite phpprojekt release groupware suite

Link:

ThinkPHP Blog:
PHProjekt Version 5.2 now available
Dec 21, 2006 @ 09:55:00

As per this post to the ThinkPHP Blog, the latest version of PHPProjekt (5.2) has been made available.

Mayflower announces that Version 5.2 of its free popular open source groupware suite "PHProjekt" is available immediately and ready for download.

Updates in the new version include a refactored user interface, Dojo integration, porting it over to the IBM DB2 database system, an update to the Helpdesk, and automatic email functionality.

Get full information on the PHPProjekt from www.phpprojekt.com.

tagged: phpprojekt release groupware suite phpprojekt release groupware suite

Link:

ImprovedSource.com:
PHP v5.2 vs PHP v5.1
Nov 14, 2006 @ 13:14:36

As part of a project he was working up, Cory Rauch has created some statistics comparing the performance of the latest PHP 5 series release, PHP 5.2, with the previous version, PHP 5.1.

I can't say the results of the benchmarks are surprising, but it does give a good idea of where, speed-wise, they really improved things in this new release. There are some stats, though, that didn't make that much of a jump. Those seem to be ones dealing with objects and their handling, though - so there's not that much of a jump there anyway.

He tested all sorts of operations, including working with binary data, string and array functionality, looping (for, foreach, etc), and operators. For each statistic, he provides what the test is doing and what the results are. Testing was done with the PHPLens benchmark suite.

tagged: benchmark test php52 php51 phplens suite algorithms benchmark test php52 php51 phplens suite algorithms

Link:

ImprovedSource.com:
PHP v5.2 vs PHP v5.1
Nov 14, 2006 @ 13:14:36

As part of a project he was working up, Cory Rauch has created some statistics comparing the performance of the latest PHP 5 series release, PHP 5.2, with the previous version, PHP 5.1.

I can't say the results of the benchmarks are surprising, but it does give a good idea of where, speed-wise, they really improved things in this new release. There are some stats, though, that didn't make that much of a jump. Those seem to be ones dealing with objects and their handling, though - so there's not that much of a jump there anyway.

He tested all sorts of operations, including working with binary data, string and array functionality, looping (for, foreach, etc), and operators. For each statistic, he provides what the test is doing and what the results are. Testing was done with the PHPLens benchmark suite.

tagged: benchmark test php52 php51 phplens suite algorithms benchmark test php52 php51 phplens suite algorithms

Link:

Sebastian Bergmann's Blog:
Who Uses PHPUnit?
Sep 11, 2006 @ 07:53:41

Sebastian Bergmann asks a simple question in his latest post - "who uses PHPUnit?"

I am putting together a list of projects that use PHPUnit. The purpose of this list is not only to show who uses PHPUnit but also to provide a list of example test suites that are built using PHPUnit.

More specifically, he's looking for projects that use PHPUnit that isn't listed on this page. If you have a project or know of one that's using this popular unit testing suite, post a comment here to let him know.

tagged: phpunit usage project list sample test suite phpunit usage project list sample test suite

Link:

Sebastian Bergmann's Blog:
Who Uses PHPUnit?
Sep 11, 2006 @ 07:53:41

Sebastian Bergmann asks a simple question in his latest post - "who uses PHPUnit?"

I am putting together a list of projects that use PHPUnit. The purpose of this list is not only to show who uses PHPUnit but also to provide a list of example test suites that are built using PHPUnit.

More specifically, he's looking for projects that use PHPUnit that isn't listed on this page. If you have a project or know of one that's using this popular unit testing suite, post a comment here to let him know.

tagged: phpunit usage project list sample test suite phpunit usage project list sample test suite

Link:

Sjon.Blog:
Protecting your property (PHP Encryption)
Dec 30, 2005 @ 07:15:19

There's always been several PHP developers out there looking to protect the source that they so lovingly crafted. They look for alternatives to keeping it safe, but sometimes it's just not enough. In this new post on the Sjon.Blog today, he mentions some of the frustrations he's had already with exectly this.

Zend almost convinced me that their Safeguard Suite really secured your PHP scripts. Ofcourse I know that scripts need to be interpreted and executed and are therefore never 100% safe; but I expected some form of obfuscation and rewriting to prevent this. This doesn't seem to be the case though. I have had a look at PHP Obfuscator/Obscurer, but a good illustration of the quality of that script can be illustrated with a simple, readable example.

Also, obfuscating React took me almost an hour; which isn’t that strange when you have had a look at the sourcecode.

As far as I've heard/seen so far, there's not really a good solution to this dilema. Sure, some are better than others, but there's still a hole there that is just waiting to be filled with an application anyone can use...

tagged: script encryption obfuscator React Zend Safeguard Suite script encryption obfuscator React Zend Safeguard Suite

Link: