Inspired by a workshop with
Globalpark this week, a few ideas about testing: A few years back, everything was PHP and generated HTML with one or the other template engine. The challenge in automated testing was mainly to get a good code coverage over your PHP code, then everything was fine. Since the integration of different data sources and business logic was all done in PHP, good code coverage with unit tests would give you a quite good application quality. Our latest applications all have 50+ percent of the over all lines of code written in Javascript. Due to the new cool technologies around Ajax, Mashups and the like, integration of different data sources is transferred into the browser more and more. At the same time, the user interface explodes in terms of interaction complexity. These points introduce a big challenge to our QA department: PHP Unit tests dont do it anymore. Even if the PHP Code works perfect, that does not automatically give you a perfect application. Each service you implemented in PHP might work perfectly for itself but they might not play together. Since they never meet in PHP-land, their integration cannot be covered in PHP unit tests. It will only come up in the browser. Of course in the browser you also have an OO architecture (using
javascriptMVC,
openAjax hub etc.) but since this is asynchronous and event driven, it is not too easy to test the interaction of all components. Even if you have
JSUnit or the like in place, a good coverage is not easy to achieve. The only thing that helps according to our experience is front-end testing. We do most of it manually still, though we have a
selenium based infrastructure at hand. Of course our idea is to automate as much as possibe but keeping 600+ selenium tests up to date with your application is actually more effort that doing regression tests manually every now and then. Therefore we implement _some_ tests in selenium that we run every night on different browsers to see if the application works in general. But the tests before release are from my current understanding better done manually.