We use automated testing not only to allow developers to write code in a way that is tested thoroughly and constantly, but also to ensure that the code we produce does exactly what the business needs.
We favour a behaviour driven approach, which means that code is tested according to its business purpose. On one level, this means that we can easily make wholesale changes to sites, knowing that we haven't inadvertently broken other functionality, as we can use the test suite to ensure regression testing. But that's not all; by testing on the business level you create effective and executable documentation of the code base, making it easier to maintain and expand later.
User stories, or features, are a key part of many agile projects and we use Cucumber to allow us to take requirements from our customers and turn them into working code. Transposing requirements from a large spec document into tests can result in something being lost in the transfer - by taking requirements and using them as the test suite, we can be sure that the software does exactly what it needs to do, and that the code meets the business need.
Browser compatibility is one of the biggest challenges of working on the web, and we are constantly looking for innovative solutions to the problem. Recently, we have invested heavily in ways to automate this testing as well, using solutions such as Selenium to run tests on look and feel using real browsers. We integrate this into our user story testing so that a user story describing the functional aspects of even a complex website can be tested reliably and automatically.
Another favoured practice is Continuous Integration (or CI). When using CI, every commit to the version control system triggers a checkout on a remote server. This will then run the test suite, including any in-browser testing, and report its findings. Keeping the build passing is the team's priority, which means the standard is constantly maintained, whilst metrics on the code can give an intricate view on its quality. For the customer, this means that you can be sure of a constant level of quality and potential to release to the wild.
All images and text © Setfire Media Ltd 2010, unless stated otherwise.