PHPUnit 3.2.0 RC1

Sebastian Bergmann » 28 October 2007 » in Announcements » 2 Comments

I have just released a first release candidate for PHPUnit 3.2, the next major version of the xUnit testing framework for PHP.

Highlights of this new release include software metrics, project mess detection, copy-and-paste detection, improvements to SeleniumTestCase for better integration with Selenium RC, data providers for test cases, and grouping of tests.

Please have a look at the ChangeLog for more detailed information.
Defined tags for this entry: ,

Proposals for MySQL Conference

Sebastian Bergmann » 25 October 2007 » in MySQL, PHPUnit » 2 Comments

Some of the bloggers on Planet MySQL are sharing their proposals for the upcoming 2008 MySQL Conference & Expo. Hereby, I follow their example and give you mine.

The first proposal I submitted is on PHPUnit and will showcase Michael Lively Jr.'s port of DbUnit:

Testing PHP/MySQL Applications with PHPUnit/DbUnit

In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale Web systems. Critical business logic like this needs to work correctly. But how do you ensure that it does? You test it, of course.

To make code testing viable, good tool support is needed. This is where PHPUnit comes into play. It is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.

This session introduces the audience to PHPUnit's DbUnit extension that makes the writing of tests that interact with databases more convenient and easier.
The scond proposal takes a piece of code for data partitioning that I wrote a long time ago for phpOpenTracker and relates it to MySQL 5.1's native support for this concept:
(Custom) Data Partitioning - Then & Now

Partitioning allows you to distribute portions of individual tables across a filesystem according to rules which you can set largely as needed. In effect, different portions of a table are stored as separate tables in different locations.

Some queries can be greatly optimized in virtue of the fact that data satisfying a given WHERE clause can be stored only on one or more partitions, thereby excluding any remaining partitions from the search.

Starting with version 5.1, MySQL natively supports partitioning. But partioning can even be implemented with older versions using MyISAM Merge Tables and custom application logic. This session will first present a small PHP library that rewrites SQL queries to a merge table to use as few individual tables as possible before it will give an overview of MySQL 5.1's native partioning implementation.
If you are interested in these topics, share your opinion in the comments. Thanks!
Defined tags for this entry: , , , , ,

Profiling and Optimizing PHPUnit

Sebastian Bergmann » 21 October 2007 » in PHPUnit » 5 Comments

Now that collecting code coverage information is not slow anymore (as of Xdebug 2.0.1), PHPUnit's report generation code (PHPUnit_Util_Report_*) has become a bottleneck.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1473.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1475, after I made the report a code coverage report only. The test result aspect of the previous report was not very usefull, made the report generation unneccassary complex and expensive, and should be handled by CruiseControl, for instance, anyways.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1486, after I eliminated the PHPUnit_Util_Array::sortRecursively() method calls.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1488, after I eliminated the PHPUnit_Util_Report_Node_File::tokenToColor() method calls.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1533 with disabled syntax highlighting.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1535 with the new statistics details.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1586 after applying a set of performance patches by Hubert Roksor.

Profiling PHPUnit's Report Generation

The image above shows the profile of PHPUnit's report generation code at revision 1603 after applying another set of performance patches by Hubert Roksor.

MSI NX8800GTS-T2D640E-HD-OC

Sebastian Bergmann » 16 October 2007 » in Computers and Gadgets » 0 Comments



Ever since I upgraded my desktop box's hardware last December I had stability problems when playing games. The first ATI X1950 Pro based graphics card I had simply turned itself off after a couple of minutes. The second ATI X1950 Pro based graphics card was too loud and the third one exhibited the same stability problems but until now I was too lazy to replace it.

Yesterday I finally replaced the Sapphire ATI X1950 Pro Ultimate graphics card with a nVidia GeForce 8800 GTS based graphics card.

Thanks to the new graphics card, my system finally works stable again.
  • 3DMark Vantage Basic: 3.601
  • PCMark Vantage: 3.289
  • 3D Mark 2006 1.1.0: 8.765
Defined tags for this entry: , , , ,

Xdebug Performance Boost

Sebastian Bergmann » 16 October 2007 » in PHPUnit » 4 Comments

Derick recently committed a patch that improves the performance of code coverage data collection in Xdebug.

Xdebug 2.0.0:
  Workflow:
    ezcWorkflowDefinitionStorageXmlTest:    ..............................................
    ezcWorkflowExecutionTest:               .................................................
    ezcWorkflowTest:                        .....................
    ezcWorkflowNodeTest:                    .....................
    ezcWorkflowConditionTest:               .........................
    ezcWorkflowVisitorVisualizationTest:    .................
  WorkflowDatabaseTiein:
    ezcWorkflowDatabaseTieinDefinitionTest: ..............
    ezcWorkflowDatabaseTieinExecutionTest:  ....
  WorkflowEventLogTiein:
    ezcWorkflowEventLogTieinListenerTest:   ......................

Time: 02:15


OK (219 tests)
Xdebug 2.0.1-dev:
  Workflow:
    ezcWorkflowDefinitionStorageXmlTest:    ..............................................
    ezcWorkflowExecutionTest:               .................................................
    ezcWorkflowTest:                        .....................
    ezcWorkflowNodeTest:                    .....................
    ezcWorkflowConditionTest:               .........................
    ezcWorkflowVisitorVisualizationTest:    .................
  WorkflowDatabaseTiein:
    ezcWorkflowDatabaseTieinDefinitionTest: ..............
    ezcWorkflowDatabaseTieinExecutionTest:  ....
  WorkflowEventLogTiein:
    ezcWorkflowEventLogTieinListenerTest:   ......................

Time: 12 seconds


OK (219 tests)
This makes PHPUnit's code coverage functionality so much more practical to use.

Update: Xdebug 2.0.1 has been released.
Defined tags for this entry: , , ,