« Back to blog

Blog: Introduction to Unit Testing with PHPUnit

Graham Weldon

21 April, 2010

I've just come back from a successful SydPHP meeting here in Sydney, Australia. The turnout was great, and the energy in the room was brilliant. It was really nice to see some faces from previous visits, and even more so to see new people joining the ranks.

I gave a very brief introduction to Unit Testing with PHPUnit. You can download the slides a the end of this blog post. The reception was great. There was a mix of people that have used unit tests, and some who have had little exposure, which is expected.

The Myths about Unit Testing seemed to ring true with the bulk of the group tonight. Being able to find time to unit test can seem difficult, but the developers out there can varify that the benefits you reap from having provided unit tests from the get-go far outweigh small time savings from skipping testing. The most agreed point in my facts section was that "Not all functionality can be tested with real applications". I know all too well the issues that can arise from deploying an applciation without having had unit tests to verify the complete functionality of part of an application.

Whether or not the talk was helpful is hard to determine. You can see from the slides below that the content is brief. This presentation was designed to fit into a 30 minute time slot with time for questions and a practical run through. I feel that most attending got a better understanding of unit tests if they had not already been using them, and if I achieved that much, I'm happy to have gone.

Finishing up with an overview of the CakePHP core and testing with SimpleTest was a good way to round out the presentation.

If you made it to the meeting tonight, thanks for coming. If you couldn't make it, I hope to see you next time! Some really interesting people and topics are coming up, and I hope to see you there.

Unit Testing with PHPUnit (Download slides)