PHPUnit Status Update

Sebastian Bergmann » 23 June 2007 » in PHPUnit » 1 Comment

PHPUnit

The last weeks have been busy, but now I want to take the time to finally give you an update on the status of PHPUnit.

The development of PHPUnit 3.1 is progressing nicely, about the only thing missing is finishing the documentation for all the new features. Speaking of features, let's take a look at what PHPUnit 3.1 has in store:

  • Improvements to Mock Objects include the ability to mock classes and methods that do not exist as well as mocking static methods. And mocked methods can raise exceptions now.
  • PHPUnit's Selenium RC extension no longer uses the Testing_Selenium PEAR package but its own implementation of the Selenium RC client/server protocol. Among other benefits, this allows for the collection of code coverage data for Selenium tests.
  • PHPUnit can now write test result and code coverage data to a test database. Several ideas for future features depend on this data.
  • New template methods, PHPUnit_Framework_TestCase::sharedAssertions(), PHPUnit_Framework_TestSuite::setUp(), PHPUnit_Framework_TestSuite::tearDown(), and PHPUnit_Extensions_SeleniumTestCase::defaultAssertions(), ease the development of test cases.
  • And lots of smaller improvements all over the place.

The development of two major features is being done in separate branches:

I hope to release PHPUnit 3.1 well before the end of next month. Then I can finally start working on PHPUnit 4 :-)

Defined tags for this entry: , , ,

Even More Work on Reporting in PHPUnit 3

Sebastian Bergmann » 14 June 2006 » in New Features » 3 Comments

When I moved to Norway just over a month ago, the Code Coverage Reporting of PHPUnit 3 needed almost six hours to run the test suite and generate a Code Coverage report for the eZ components.

Then Derick Rethans committed a patch to Xdebug that introduced "a cache that prevents the code coverage functionality from running a ''which code is executable'' check on every function call, even if they were executed multiple times". This patch reduced the time spent on running the tests dramatically. It now took only two hours to run the test suite and generate the report.

Over the past couple of days, Michael Lively Jr., Jan Kneschke, and myself used Xdebug's profiling functionality to locate "hot spots" in PHPUnit 3's report generator. After optimizing most of these hot spots (I am not proud of all of these patches), the initial six hours have been reduced to eight minutes.

Wow.

I am also working on a "logger" that writes all information that is gathered during the execution of a test suite to an SQLite database. Think of this feature as the basis for a tool like CruiseControl. A web application queries this database and would allow, among other things, the analysis of differences between test runs: Which commit (by which developer :-) made a test fail? Which commit incurred a performance penalty?

The possibilities are virtually endless ;-)

More Work on Reporting in PHPUnit 3

Sebastian Bergmann » 11 May 2006 » in New Features » 1 Comment

Michael Lively Jr. sent me a patch last night that implements most of the bits and pieces that were still missing from the new reporting functionality in PHPUnit 3.



The screenshot above shows the summary page for PHPUnit's own test suite. The screenshot below shows a more detailed view.



The screenshot below shows the test results for the ExceptionTestCaseTest test case. Notice the graphical representation of the test case structure.



The screenshot below shows the code coverage for the PHPUnit2_Framework_Assert class.



When you compare the current version of the reporting to the original version you will notice that I changed the color scheme. It now uses colors from the Tango Palette.

Update: I released a third alpha-quality version of PHPUnit 3 that now contains the new reporting functionality.
Defined tags for this entry: , , , , ,