Beruflich Dokumente
Kultur Dokumente
And
Does it still work after I committed new code?
Agile approach
Write a unit test!
● Executable specification
● Automatic evaluation
● A simple test environment
● Instant feedback
● Used as regression test
Detect problems in the earliest possible stage
● Defacto standard for unit testing of PHP
applications
● Member of the xUnit family
● Inspired by tools like Junit, TestNG, Junitour,
JExample etc.
● Latest stable version 3.4.0 (released 16
September 2009)
Things to keep in mind...
Unit tests should run in less than 1 ms
Software testing categories
● Skeleton generation
● Integration of Selennium
PHP Unit and code coverage analyses
PHP Unit and code coverage analyses
● PHP
● Javascript
● CSS
To detect violations of defined coding standards
with as main goal to ensure code remains clean
and consistent.
Following coding standards are default available:
MySource, PHPCS, Zend, PEAR and Squiz
An example run
Other available tools
Acknowledgement Links
● Part of this presentation was inspired ● PHPUnit - http://www.phpunit.de
by “The State of QA Tools for PHP” ● PHP Code sniffer -
from Sabastian Bergmann
http://pear.php.net/package/PHP_CodeSniffer/
About me and this presentation ● PHP copy/paste detector -
● Personal blog can be found on http://github.com/sebastianbergmann/phpcpd/
http://www.jfoobar.org ● Cruisecontrol -
● Slides will be uploaded to http://cruisecontrol.sourceforge.net/
http://slideshare.net/willebil ● PHP Under control - http://phpundercontrol.org/
● Follow me on twitter: ● Bamboo -
http://twitter.com/willebil
http://www.atlassian.com/software/bamboo/
● PHP lines of code -
http://github.com/sebastianbergmann/phploc