2. Thanks you for joining us!
First tests fest?
First test (I won’t tell your boss)?
Welcome to the TestFest 2009!
3. PHP needs YOU
You need PHP too
a broken PHP is useless
A new Phpet is waiting for you!
What should I bother?
4. Improve code coverage
Fantastic opportunity to be part of PHP
Network to learn and work together
What is this about?
5. Single test in a single .phpt file
Small set of similar tests in a .phpt file
Each test are run by calling a new php
instance
Test isolation
Custom configuration
Support of segfaults and other fatal errors
PHPT
6. (n)make test
make test
TESTS=/home/joe/php/ext/reflection/tests
make test
TESTS=/home/joe/php/ext/a/tests/b.phpt
Testing PHP, everything (or less)
7. A bug
bug12345.phpt (bug.php.net/12345)
Features
<functionname>_basic.phpt
Errors
<functionname>_error.phpt
General
extname<test nr>.phpt
Naming convention
17. Keep it smalll and beautiful
Test one feature per phpt
Avoid large output
What is a good test?
18. If a large output is necessary
Numerate or name each line
Easier to analyze
Easier to debug
What is a good test?
19. PHP GCOV - Test and Code Coverage Analysis
http://gcov.php.net/
PHP WIKI - How to look at the test coverage for an extension
http://wiki.php.net/qa/testcoverage
PHP QA - Writing Tests
http://qa.php.net/write-test.php
Lessons Learned from PHPT
Writinghttp://wiki.php.net/qa/phptlessonslearned
PHP CVS - README.TESTING
http://cvs.php.net/viewvc.cgi/php-src/README.TESTING
Resources