Retrofitting tests to an existing project

Session Room
Room 208 (Jakala)
Time Slot
Fri 15:20-16:10
Speaker(s)
erikerskine
Session track
Backend development
Experience level
Beginner
Duration
50 min

Do you find yourself working on an existing site, but wishing you had written automated tests earlier? It's not too late.
 

Automated testing is universally seen as a good thing, but often doesn't happen. There's a lot of code out there that works, but that can't be verified.

But it is never too late to start - one test is better than none. At Annertech we undertook some significant refactoring recently, and wanted to safeguard that process as much as possible. During development we put in place some rudimentary scripts to check for regressions. Over time these have evolved, but they are still quite informal, and crucially - they got done.

This talk is aimed at backend developers in a similar situation. We'll cover:

  • overcoming initial hurdles and getting the first test done
  • how do you test a site with real data?
  • how to use PHPUnit to test a fully installed site with content and configuration
  • writing testable code

Prerequisites:

This is primarily for backend developers, so familiarity with PHP and writing bespoke Drupal code is assumed.

You don't need experience with any particular testing framework. In fact, this talk will be most beneficial for those who don't.

Results:

Participants will come away with a means to get started writing tests for existing sites.