Behavior Driven Development and WordPress Plugins

In my day-to-day work at the Berkman Center I don’t have the luxury of working primarily in one language or framework – this is a blessing and a curse.  That’s not the point of this post, though.

A specific blessing that fell out of the multi-language, multi-platform monstrosity that is my workload is a love of Cucumber, the excellent Behavior Driven Development testing framework gaining major traction in the ruby community.

BDD is a client-centric “outside in” agile development methodology that emphasizes “Scenarios” that implement valuable business logic. Your scenarios might read something like:

Scenario: Activate the plugin without errors. Given a "Deactivated" plugin in the row with the id "category-subscriptions" And a logged in user of type "administrator" When I visit "/wp-admin/plugins.php" And I click "Activate" within the row with the id "category-subscriptions" Then I should see "Plugin activated"

That is an actual testing scenario that Cucumber can execute and run, using Selenium to drive a browser like Google Chrome or Firefox. Look at it! You can read it! You could probably run this by a client and they’d understand most of it.

The promise of cucumber is that you’ll spend less time working on stuff that doesn’t actually provide specific business value to your clients, and end up with an app that provably does what it says on the can because your testing suite says so.

This entry was posted in Speaker feature. Bookmark the permalink.

Comments are closed.