Testing in WordPress

Max Kovalenkov

Marshmallow Experiment

Our Hero

Day 0: The Jeopardy

Day 5: "All is Lost" (kind of)

Methodologies...

  • TDD
  • BDD
  • FDD
  • DDD
  • MDD
  • ...
  • ADHD

Why test?

No more "Déjà Vu"s

Design

Document

...

Confidence

"We write tests to enforce decisions."

- Andrew Nacin

"You can't charge your client for mistakes in your old code that just broke."

- Chris Lema

Ok, convinced. But...

When not to test?

  • External dependencies
  • One-off stuff or trivial code
  • Test is way harder to write than code
  • 100% test coverage?

When to test?

  • All the other times!

Acceptance

Functional

Integration

Unit

Catapult

TDD

(test-driven development)

The Epiphany

Day 9: The Tools

Unit tests - not always enough

Codeception

Theme Check plugin

Wraith

Wraith at work

Wraith report

How to start?

CI

(continuous integration)

Travis CI

Day 27: Monday

Day 31: Friday

Day 90: team lead

Thank you!

twitter @m0ntrealist

Made with Slides.com