Tide: Automated Testing for WordPress Plugins and Themes

Yet another way to contribute! Remember this 20-piece WordPress contribution chart with the tester Easter Egg? Even though testing is growing stronger in WordPress core with each release, it’s still mostly manual — usability, visual regression, accessibility, and beta testing with real sites before launch.

Now the tide is turning a bit more toward automation. I’m beyond thrilled to see this!

Tide is a new software test automation project kicking off in WordPress core.

Screen Shot 2018-01-03 at 14.33.19.png
Screenshot of the Tide page on Make WordPress.

Announced at WCUS 2017 Tide is: “A path to better code across the WordPress ecosystem” — tools to run automated tests for all themes and plugins in the WordPress official directories.

From the XWP team announcement:

Tide, a project started here at XWP and supported by GoogleAutomattic, and WP Engineaims to equip WordPress users and developers to make better decisions about the plugins and themes they install and build.

Tide is a service, consisting of an API, Audit Server, and Sync Server, working in tandem to run a series of automated tests against the WordPress.org plugin and theme directories. Through the Tide plugin, the results of these tests are delivered as an aggregated score in the WordPress admin that represents the overall code quality of the plugin or theme. A comprehensive report is generated, equipping developers to better understand how they can increase the quality of their code.

Once up and running these automated tests would update the plugin and theme description with a status and score so everyone knows whether they pass the tests or not, from PHP version compatibility to the quality of the “front-end output.”

The Tide project is now officially moved over to the WordPress project. See the related story on WP Tavern for a longer history. And, if you’re curious like me about the tech “innards” — take a look at the source code on GitHub.

tide-code-on-github.png
Screenshot of the Tide API plugin code on GitHub.

I love the genesis of the name:

…inspired by the proverb ‘A rising tide lifts all boats,’ thinking that if a tool like this could lower the barrier of entry to good quality code for enough developers, it could lift the quality of code across the whole WordPress ecosystem.” Rob Stinson

One key to success: Tide makes it super easy for developers to identify weaknesses in their code — and learn how to fix them. It’s not just about getting a high score or to ranking better against a minimum requirement. It’ll teach us all to improve. I love that.

Review: The Way of the Web Tester

This is a book review of The Way of the Web Tester by Jonathan Rasmusson. Hat tip: Alister Scott.

A beginner’s guide to automated testing, though not specific to the web, despite the title. Covering the quintessential pyramid of UI, integration, and unit tests as well as basic building blocks of HTML, CSS, HTTP and REST APIs, and JavaScript. The book also spends time on best practices for general software programming and testing.

The goal for test automation, according to the author, is to have more time to do the fun things like developing new features, and less time on boring things like fixing bugs. We can’t test everything, yet “with the right 20%, we can sure test a lot.” Agreed. In broad strokes, this book debunks many common misconceptions of automated testing.

Don’t try to automate everything. Instead, automate just enough.

I love the dual audience of testers and developers, and how each chapter addresses the goals for each to learn in the coming text. The chapter ending summaries are handy. The text flows and the examples are easy to follow. Though a quick read, the book ends up covering important topics such as organization, naming, coupling, reusable code, and avoiding flaky tests by making them deterministic.

A few minor nitpicks: I found the metaphor of armor and mobility a tad confusing, and some of the humor seemed off-putting and unnecessary. As a beginner book I didn’t like how it conflated an important concept of CSS selectors and using similar syntax with jQuery to select elements by ID; in my opinion this difference should be understood at a beginner level. The author also doesn’t mention targeting data URIs in HTML attributes for selection, which seems to me to be worth a mention as a useful technique when working without relying on extra IDs or classes everywhere—such as legacy code or HTML output from third-party templates that you don’t control—and is present in popular JavaScript frameworks such as React.

I love the concept of a Developer Productivity team at a software company—at Spotify, Rasmusson describes a squad that went around killing and fixing flaky tests. Making things run better, making everyone happier. I think of Excellence Wranglers at Automattic as having a similar goal in our work as quality advocates.

The Way of the Web Tester does a great job introducing important concepts and covers the basics of automated testing, and I’d recommend it to everyone, even seasoned developers and testers.

 

Pride and Paradev

A book review for Pride and Paradev by Alister Scott.

hero

This is an entertaining and thought-provoking “collection of agile software testing contradictions”—exactly what it says on the tin.

After reading this book, I now identify confidently as a paradev: anyone on a software team that isn’t a specialist. Ever since my start in web development 12 years ago I’ve considered myself a generalist rather than a “pure” developer or designer because I don’t spend all my time building or creating new things. Software testing is an excellent fit for me because I love breaking things, finding details to make existing products better through improved flow and efficiency.

Using a quirky yet concise question-and-answer format, Scott covers such topics as “Are software testers the gatekeepers or guardians of quality?” (Yes, you can be an advocate of quality without being a gatekeeper; it all depends on your attitude, your tone, and how you present your findings.) and “Should acceptance criteria be implicit or explicit?” (Keep acceptance criteria focused on what is required, not what is obvious.) and “Do agile software testers need technical skills?” (Sometimes non-technical testers without the deep skill set see things with better eyes.)

This short and approachable book will make you think critically about software testing. Highly recommended for anyone working with software, not just us breakers.

[Available on Leanpub for iPad/Kindle/PDF.]