Testing as if you meant it: TDD for Drupalistas

Speakers: 

Test Driven Development is a software development practice "rediscovered" in the 90's and used throughout the software world with success to produce high quality, self-testing, self-documenting code. It has been a core part of the success of agile software delivery for the last 15 years.

But not in Drupal projects.

Being a large, procedural, legacy system, it is often said that practices like TDD are impossible with Drupal and unit tests in general are side stepped in favour of slower, more brittle, web and integration tests.

It is also claimed that this will improve with Drupal 8 but practically nobody is attempting TDD there either. While the formula is simple to learn (Red, Green, Refactor), writing that first test is still incredibly difficult to most, and Drupal does indeed pose some architectural obstacles. Still there is lots of value in knowing what TDD is really all about and the only way is with real examples.

This session will attempt the impossible - use a real Drupal development example to teach developers who have never done TDD what it's all about, with exercises that can be taken back to your teams. While the example will be in the "less testable" Drupal 7, Drupal 8 differences will be mentioned along the way and all techniques and patterns will be applicable to both.

Topics covered along the way:

- Drupal 7 and Drupal 8 differences and practical considerations (getting your tools setup in both versions)
- TDD basics
- A theory of Drupal TDD (situations where it works, areas where it doesn't)
- the ports and adaptors pattern
- how to practice, how to teach

Schedule info
Track: 
Coding and Development
Experience level: 
Intermediate
Drupal Version: 
Drupal 7.x
Status: 
Unprocessed