We recently conducted a survey asking you how we can make the WooCommerce platform better for developers. One of the insights we discovered from the results of that survey is that a majority of respondents feel there could be more information about testing the extensions they build for WooCommerce. We’re excited to share that we are working on something that can help change that.
The teams within Automattic who maintain WooCommerce are collaborating on an authoritative guide that covers all things related to testing in WooCommerce. The guide will be similar to the updated Extension Developer Guide that we recently rolled out, with one small difference: we plan to publish sections as they’re completed instead of publishing the entire guide at once.
The long-term goal is for these published guides to be living documents that we continually curate as the platform evolves, so we’re going to iterate and improve sections as we collect feedback from developers on what is most helpful and what we could make better.
With that in mind, we’d like to start collecting feedback today. We’re hard at work writing some initial sections, but we’d love to hear from you to make sure we’re focused on impactful topics. Here’s a sneak peek at the outline we’re using to put together each section.
Testing extensions and maintaining quality code: our working outline
- A brief explanation of this guide and what it aims to provide to readers.
The Value of Automated Testing
- Automated testing is an accepted best practice in software development, but its usefulness is often taken as self-evident — making it harder for individual developers to really understand and feel the value. This section will show when testing provides benefits and what those benefits are, backed by research.
- We’re drawing inspiration from the WordPress testing docs in an effort to align with the broader community and ecosystem, but we’re also tailoring this guidance to WooCommerce’s goal of providing a high-quality merchant experience.
Types of testing
- Smoke testing
- End-to-End Testing
- Unit testing
- API testing
- Performance testing
- Manual testing
- Visual Regression Testing
Test runners, frameworks, and libraries
Linting and consistency tools
- PHP Codesniffer
- Query Monitor
- Debug Bar
- Enabling WP DEBUG logging
- Mail Poet Email Logging plugin
- WordPress and WooCommerce Beta Tester Plugins
- REST API clients
- React Developer Tools
Setting up a testing environment for an extension
Best practices for writing and running tests
- What are critical flows?
- Identifying an extension’s critical flows
- Testing critical flows
- Maintaining critical flows over time
- Setting up PHPUnit
End to End Testing
- Using the WooCommerce E2E-boilerplate project
- Setting up WooCommerce E2E tools
Setting up Linting
- Setting up PHP Codesniffer and WooCommerce Sniffs
Is there something we missed? What about topics you think we should cover more thoroughly? Is there a particular tool or concept that you’d like to see included in this testing guide? Drop us a line in the comments below or reach out to us in the WooCommerce Community Slack. We look forward to hearing from you.
2 replies on “Coming Soon: WooCommerce Testing Guide”
I think this is a great initiative.
Please think about cases when you have to test that your plugin supports some other Woo plugin. I.e. plugin X works with plugin Y and with WooCommerce Subscriptions.
LikeLiked by 4 people
[…] on the lookout for a dedicated developer guide on testing and quality for all the things you’re building with WooCommerce. We’re publishing it incrementally […]