Robert Balousek, Matt Erkkila, Ian Eure, Bill Shupp, Jeremy McCarthy and Brian O'Neill »
10 April 2009 »
in Enterprise Case Studies »
This is an abstract for a chapter from a book on Quality Assurance in PHP Projects.
Digg's development philosophy has changed dramatically in the last year in an attempt to move towards a more agile and iterative approach. A large part of these sweeping changes is moving toward a test-driven development methodology with a minimum of 80% code coverage.
Integrating unit testing into coding practices is a daunting task at first glance. It requires adjusting how developers work in almost every respect, but it can also greatly assist in debugging and validating your code. We wanted to get this right the first time, so we decided to hire an outside contractor to help us formulate a plan of attack. Once we decided upon a course of action, it took only a week for the contractor and two developers to build a test harness and small suite of tests for our core classes, we even found a handful of bugs along the way. Next, we worked to instruct the remaining developers at Digg of best practices for writing unit tests.
Although in one week we went from having only a handful of previously written tests to having a framework to build unit tests much more easily, our work was far from complete. Even our QA team has dramatically changed how they operate to take advantage of the benefits unit testing offers.
Our case study will discuss in depth benefits and drawbacks of adopting test-driven development, cover the gamut of unit testing from simple assertions to mocking complex objects, and dissect the continuing challenges we face.
Robert Balousek, Matt Erkkila, Ian Eure, Bill Shupp, Jeremy McCarthy and Brian O'Neill all contributed to the case study and are employees of Digg.
Christiane Philipps and Max Horváth »
03 April 2009 »
in Enterprise Case Studies »
This is an abstract for a chapter from a book on Quality Assurance in PHP Projects.
A well established practice in web application development is testing a web-based GUI as a whole in order to ensure its functionality.
At studiVZ, we have to test three different platforms in two languages. There are many platform-specific differences, in both wording and functionality. The scenario is even further complicated by the use of AJAX functionality in some features. With a release cycle of 14 days, this is indeed a challenge for a small quality assurance team.
In addition to Unit Tests, Acceptance Tests are the main part of our automated testing strategy. There are thousands of acceptance tests that have been written since the rewrite of the platform in early 2008. Because of our special requirements (tests have to work for three platforms) we decided not to use one of these capture-and-replay web testing softwares but to write our tests by hand. We chose Selenium RC and the Selenium RC extension for PHPUnit that allows to write and execute acceptance tests in a unit test style.
But writing acceptance tests is a rocky road to success. The main problem with acceptance tests is their fragility: they will break when the code changes. Another challenge is keeping the tests maintainable, foremost readable. This was the motivation to create a domain-specific language for PHP that allows us to write tests in the language of our business rather than in Selenium's language.
We want to share our insight into the specific challenges of acceptance testing and how to handle them. Furthermore we will talk about our experiences and learning curve with a DSL-based framework for Selenium tests.
Christiane Philipps is the Team Lead Quality Assurance and Max Horváth is the Team Lead Mobile Development at studiVZ Ltd.
Lars Jankowfsky »
13 March 2009 »
in Enterprise Case Studies »
This is an abstract for a chapter from a book on Quality Assurance in PHP Projects.
swoodoo, the Germany-based flight search engine, has gone through a wild evolution. In 2003 it started out as a peer-to-peer network with ActiveX browser plugins written in C++ to query cheap flights. It went through a Java-centric solution using various techniques for screenscraping data from airline websites and finally has evolved into a robust architecture where Java and MySQL are used in the backend and PHP plays a major role in all frontend-related tasks as well as in data gathering from airlines.
Besides technology, the software architecture has also changed immensely: from distributed objects to a "big ball of mud" and finally into a Service-Oriented Architecture (SOA) with clearly defined interfaces between separate services. In order to have a better control of swoodoo evolution, project management was switched to Extreme Programming (XP) in the beginning of 2007. At the same time we introduced unit testing using JUnit and PHPUnit as well as PHP-driven Selenium acceptance testing. Initially we made heavy use of Selenium but recently we have reduced the amount of Selenium tests - a tradeoff we had to make because of the nature of our SOA-based architecture.
In this case study we want to show the evolution of our agile management techniques, testing environment, tools and approaches we use and why we decided to change in case we did.
Lars Jankowfsky is the CTO of Germany-based swoodoo AG.