Table of Contents

PHP TestFest 2010

This page contains out-dated material and is archived here for informational purposes. For recent information, see the main PHP TestFest page.

What is TestFest?

TestFest is an annual PHP community campaign designed to increase the test coverage of the PHP language. During this four month event, PHP User Groups and individuals are encouraged to organize and execute local meet-ups for the purpose of writing new PHPTs (PHP Tests) to cover currently untested functionality of the PHP language.

When will it be held?

TestFest 2010 will be held from May 1st, 2010 to August 31st, 2010. This does not mean you can't hold a local event prior to or after the official dates, in fact we really hope individuals and groups will continue to write test well after the event has ended. But from an organization standpoint, we needed to set a start and end date for the official campaign.

Where will it be held?

While TestFest is a world wide effort, the actual events are scheduled, organized and executed locally by User Groups and individuals in cities around the world. If you are looking for a local event to attend, check out the “Is There An Event Planned For My City?” section. If you wish to organize and run an event in your local city, please refer to the “How Do I Organize An Event In My City?” section.

How Do I Organize An Event In My City?

All TestFest events are organized and run by volunteers from cities around the world. If there isn't already an event being organized in your area, and you've got a little extra time on your hands, we'd love for you to organize and run an event of your own.

The actual organization and execution of each event is pretty informal. If you have a nearby PHP User Group, we ask that coordinate with the local group when planning the event. Other than that, the following is a short list of recommended procedures for your event.

  1. Find a suitable location for hosting your event. Local universities and corporations often have conference/meetings rooms which can be used during off-hours and weekends. Finding a location that will also provide Internet access is generally recommended, but not always possible.
  2. Once you've found a suitable location and established a date and time which the facility will be made available to you, post the event details in the “Is There An Event Planned For My City?” section of this page. If you don't have edit privileges on the Wiki, email the event details to the QA mailing list.
  3. Request an SVN repository and administrator account for your group. All tests produced by your group will be committed to your own SVN repository. QA moderators will review all your tests. If any problems are discovered they will fix them or contact you with recommended procedures for fixing them yourself. Once approved by a moderator, the tests will be committed into the PHP source tree.
  4. Prepare a short presentation on writing PHPTs which we recommended you start your event off with. There are links to several tutorials and presentations in the Resource section of this page.
  5. Have fun!

What Do I Need to Write PHPTs?

In most cases, you can use any text editor or IDE you like. PHPTs don't require any special software for their creation, so the same tools you use in your everyday work to write PHP applications, are the same tools you can use for writing PHPTs.

What Do I Need to Run PHPTs?

It's recommended that you run newly written PHPTs using test binaries built from the latest SVN checkouts or snapshots of the three main PHP branches: 5.2, 5.3 and Trunk. While it is possible to run PHPTs using pre-packaged PHP release binaries (avoiding the complication of compiling your own test binary of PHP), you may find that your test passes using the pre-packaged release binaries, but fails against the latest SVN revision or snapshot. In these cases, you or someone else will then be required to fix the test before committing it to the PHP SVN repository. So whenever possible, please build your test binary based on the latest SVN checkout or snapshot.

How Can I Build a PHP Testing Environment?

You will find either shells scripts for automatically downloading and building test PHP binaries using the latest snapshots (for Mac OS X and Ubuntu) or instructions for downloading and installing the latest automated builds (in the case of Windows).

How Do I Write PHPTs?

PHPTs are fairly simple to write. For the most part, they are little more than PHP code written to exercise a particular feature or function of the PHP language along with the expected output from the PHP statements.

To learn how to write and run PHPTs, please watch these screencasts. (Coming Soon). Also review Creating new test files on the PHP QA website.

For a detailed explanation of every aspect of PHPTs, please refer to PHPT - Test File Layout, also on the PHP QA website.

What Should I Write PHPTs For?

For beginner test writers, it's recommended that you start your search with native function and/or extensions that you are very familiar with. Once you've decided on what native function and/or extension you want to write tests for, you have the following two ways to find untested use cases.

  1. You can search through the Tested PHP Functions and Methods page which lists the current tested status for all functions in PHP. Next to each function name is a link to view all the tests currently written for that function. By examining all the tests currently written for a function, you can find use cases which aren't already tested.
  2. If you are familiar with C, you can view the GCOV report for the function/Class you wish to write tests for and find untested blocks of the C code which implement that function/Class. This method is only recommended for those who are familiar with C.

How Do I Submit PHPTs?

Each local event organizer can create SVN accounts for their local event. Ask your local organizer to create an SVN account for you. You will then be able to submit your PHPTs to the TestFest SVN repository.

PHP TestFest 2010 Repository

If you show an aptitude for test writing and continue writing test after TestFest is over, you may be granted SVN access to the main PHP repository.

Is There An Event Planned For My City?

Below is a list of local events scheduled in cities around the world. Included with each event you'll find dates, locations, and organizer contact information.

Resources - QA

PHP QA - Homepage

PHP WIKI - QA

PHP WIKI - TestFest

Resources - Test Writing

PHP QA - Writing Tests

PHP QA - Details of PHPT format

PHP QA - EXPECTF substitution options

PHP QA - Auto-generating test cases.

PHP WIKI - Writing Tests

PHP WIKI - Lessons Learned from PHPT Writing

PHP WIKI - PHPT roundup talk.

PHP TestFest Slides

PHP TestFest - Cologne

Writing PHPT tests on your mac.

Zoes 2008 Testfest Talk

PHP WIKI - Crediting test authors.

PHP SVN - README.TESTING

PHP SVN - README.TESTING2

PHP WIKI - What to do with your test when you have written it.

Testing in the PHP World

PHP WIKI - Suggestions and checklist.

PHP Testfest - SVN Reporting: 64-bit PPC Linux

PHP Testfest - SVN Reporting: 32-bit Linux

Resources - Code Coverage

PHP GCOV - Test and Code Coverage Analysis

PHP QA - Tested PHP Functions and Methods

PHP WIKI - More information on what to test

PHP WIKI - How to look at the test coverage for an extension

Resources - Source Code Access

PHP Source Code Snapshots

PHP SVN

TODO List

Tasks still remaining to be complete. If no name follows a test, this task not only needs to be complete, but needs someone to take responsibility of it.