SlideShare a Scribd company logo
From good to great!
Functional and
Acceptance Testing
in WordPress
David Aguilera
I co-founded Nelio Software (2013)
You can find me at @davilera
Who I am...
My Work at Nelio
◎ Plugin Development
◉ A/B Testing for WordPress
◉ External Featured Images
◉ Others...
◎ Customer Support
My Work at Nelio
◎ Plugin Development
◉ A/B Testing for WordPress
◉ External Featured Images
◉ Others...
◎ Customer Support
The Problem with A/B Testing
◎ Several Dashboard Screens
◎ Impact on Front-end
◎ Data Synchronization to Cloud
The Problem with A/B Testing
◎ Several Dashboard Screens
◎ Impact on Front-end
◎ Data Synchronization to Cloud
Complex Architecture
How can we make sure it works?
WordPress Plugins and Themes
1
Quality
What Is Quality?
“how good or bad something is”
“a high level of value or excellence”
Merriam Webster Dictionary
What Is Quality?
◎ WordPress Coding Standards
◎ Guidelines
◉ Plugin Handbook
◉ Theme Handbook
◎ Plugin and Theme Reviews
Quality is (also) about
User Experience
Image by Moyan Brenn - http://flickr.com/photos/aigle_dore/
My Experience
(and yours?)
2
Plugin & Theme Development
Development
◎ Functionalities
◎ Write New Code
◎ Try it out
Image by WordPress Barcelona - http://www.wpbarcelona.com
Pre-Release
◎ Check-List
◎ Do things work
as expected?
Image by Crispy - http://flickr.com/photos/37333113@N03/
Release… and
bug!
◎ Unnoticed
◎ Obvious
◎ WSOD
Image by Nokton - http://flickr.com/photos/nokton/
Quality matters!
Especially when it
affects your users
Image by Peter A. Hess - http://flickr.com/photos/peterhess/
There must be a
better way!
and it’s called
Automated
Testing
Image by Mark Strozier - http://flickr.com/photos/r80o/
The First Step Towards Excellence
3
Unit Testing
What is Unit Testing?
“A method for verifying that
individual units of source code
are fit for use”
How does Unit Testing look like?
/**
* Returns whether a telephone number is valid or not.
*
* The telephone number has to be a list of digits. Any
* other char is not accepted.
*/
function validateTelNumber( $num ) {
return preg_match( '/^[0-9]+$/', $num );
}
How does Unit Testing look like?
class TheTest extends PHPUnit_Framework_TestCase {
public function testTelephoneNumber() {
// Arrange
$num = ‘934.123.456’;
// Act
$result = validateTelNumber( $num );
// Assert
$this->assertTrue( $result );
}
How does Unit Testing look like?
david@nelio:~$ phpunit …
Time: 102 ms, Memory: 8.92Mb
There was 1 failure:
1) TheTest::testTelephoneNumber
Failed asserting that false is true.
/home/david/sandbox/tests/TheTest.php:23
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
We’re already using it!
https://make.wordpress.org/core/
handbook/automated-testing/
Really?
But...
It’s focused on individual units
and the internal structure
But...
It’s focused on individual units
and the internal structure
It tells us nothing about:
Do we satisfy our users’
expectations?
Image by Todd Martin - http://flickr.com/photos/tmartin/
How?
Acceptance and Functional Testing
4
The Next Level
“Software delivery
is about writing software
to achieve (business) outcomes
Dann North & Associates
http://dannorth.net/whats-in-a-story/
Quality is about
Achieving These Outcomes
Image by Kieran Clarke - http://flickr.com/photos/goonerpower/
“Acceptance Tests
replicate user’s experience and
are driven by expectation logic
Chris Lema
Behavior-Driven Development
(BDD)
Story - Title
As a [role]
I want [feature]
So that [benefit]
Acceptance Criteria
Scenario - Title
Given [context]
When [event]
Then [outcome]
Dann North & Associates
http://dannorth.net/whats-in-a-story/
BDD starts at the outside by identifying
business outcomes, and then drills down into the
feature set that will achieve those outcomes.
Story - An author (John) publishes a post
As an author (John)
I want to publish a post
So that new content is available in my blog
Example
Scenario 1 - John has a draft post
Given a draft post in the Dashboard
and the post’s author is John
and the post’s title is X
and the post’s content is Y
When John publishes the post
Then the post’s status is no longer Draft
and the Latest Posts page contains X and Y
Example
“Functional Tests
replicate developer’s experience.
Not only we look into expectations,
but also into the implementation
Acceptance and Functional Testing
with Codeception and WebDriver
5
How-To
Codeception
It’s all about
behavior-driven testing.
For each part of application,
- user actions and
- expected results
Codeception (open-source and MIT licensed) - http://codeception.com
Quick Demo
Acceptance Tests in
Codeception
$I = new AcceptanceTester( $scenario )
$I->am( ‘an Author’ );
$I->wantTo( ‘publish a post’ );
$I->lookForwardTo( ‘seeing more content’ );
Acceptance Tests in
Codeception
As an author (John)
I want to publish a post
So that new content is available in my blog
$I = new AcceptanceTester( $scenario )
$I->am( ‘an Author’ );
$I->wantTo( ‘publish a post’ );
$I->lookForwardTo( ‘seeing more content’ );
//...
$I->amOnPage( ‘/wp-admin/edit.php?p=X’ );
$I->click( ‘Publish’, ‘#submitdiv’ );
$I->see( ‘Post published.’ );
$I->amOnPage( ‘/blog’ );
$I->see( ‘The title X’ );
$I->see( ‘First words of the content Y’ );
Acceptance Tests in
Codeception
Codeception Commands
am
wantTo
lookForwardTo
amOnPage
click
fillField
selectOption
submitForm
see
seeLink
seeInTitle
seeInField
…
dontSee
checkOption
uncheckOption
Codeception Commands
You can reproduce
user’s behavior
on a simulated environment
Codeception Commands
You can reproduce
user’s behavior
on a simulated environment
wait… “simulated”?
WebDriver
http://w3c.github.io/webdriver/webdriver-spec.html
The WD API is a platform and
language-neutral interface (...)
that allows programs or scripts
to introspect into, and control
the behaviour of, a web browser.
WebDriver
In other words,
you can start a new instance of
Chrome, Firefox, IE…
and control them from a script.
Pros/Cons
◎ Real Browsers
◎ Real Behavior
◎ JavaScript
◎ Slower
◎ Platforms
WebDriver
New Methods
wait
waitForElementVisible
waitForElementChange
waitForJS
moveMouseOver
pressKey
reloadWindow
◎ User Automated Tests
◎ Developer Automated Tests
So, Codeception will help you
with…
◎ User Automated Tests
◎ Developer Automated Tests
◎ Automate Bug (re)detection
On real or simulated browsers!
So, Codeception will help you
with…
◎ Acceptance Tests are not
the solution to all your problems.
◎ There’s a whole range of tests.
Use the one that
better suits your needs
But...
What I Want You to Remember
6
Summary
Remember
1. Quality matters
2. That means code quality matters
3. But also fulfilling expectations
4. Codeception is a great tool
Remember
1. Quality matters
2. That means code quality matters
3. But also fulfilling expectations
4. Codeception is a great tool
Remember
1. Quality matters
2. That means code quality matters
3. But also fulfilling expectations
4. Codeception is a great tool
Remember
1. Quality matters
2. That means code quality matters
3. But also fulfilling expectations
4. Codeception is a great tool
Thanks!
Always Test Your Work
You can find me at
@davilera
david.aguilera@neliosoftware.com
?
Feedback Link
europe.wordcamp.org/2015/speaker/david-aguilera

More Related Content

PDF
Acceptance & Functional Testing with Codeception - Devspace 2015
PDF
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
PDF
Codeception introduction and use in Yii
PDF
Codeception
PDF
Codeception presentation
PDF
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
PPTX
Codeception
PDF
Codeception: introduction to php testing
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Codeception introduction and use in Yii
Codeception
Codeception presentation
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Codeception
Codeception: introduction to php testing

What's hot (20)

PDF
PHP Unit Testing in Yii
PPTX
Test automation with php codeception
PDF
Testing Web Applications
PDF
Unit-testing and E2E testing in JS
DOCX
Automation Frame works Instruction Sheet
PDF
Testing PHP with Codeception
PDF
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
PPTX
Automated Testing using JavaScript
PPTX
Bdd with Cucumber and Mocha
PPTX
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
PDF
Selenium Clinic Eurostar 2012 WebDriver Tutorial
PDF
Mastering Test Automation: How to Use Selenium Successfully
PDF
Integration testing - A&BP CC
PDF
Lets make a better react form
PPTX
Automated UI testing done right (DDDSydney)
PDF
Enhance react app with patterns - part 1: higher order component
PDF
SpecFlow and some things I've picked up
PDF
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
PPTX
BDD with SpecFlow and Selenium
PDF
Using The Page Object Pattern
PHP Unit Testing in Yii
Test automation with php codeception
Testing Web Applications
Unit-testing and E2E testing in JS
Automation Frame works Instruction Sheet
Testing PHP with Codeception
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Automated Testing using JavaScript
Bdd with Cucumber and Mocha
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Selenium Clinic Eurostar 2012 WebDriver Tutorial
Mastering Test Automation: How to Use Selenium Successfully
Integration testing - A&BP CC
Lets make a better react form
Automated UI testing done right (DDDSydney)
Enhance react app with patterns - part 1: higher order component
SpecFlow and some things I've picked up
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
BDD with SpecFlow and Selenium
Using The Page Object Pattern
Ad

Viewers also liked (10)

PDF
Impact Analysis - LoopConf
PDF
TDD in WordPress
PPT
Cole ready aim fire impact!- status impact analysis - nasa
PDF
Gersetenmaier.william l
PDF
Purpose-Driven Meeting Design and Facilitation for Stakeholder Engagement
PDF
Project Management101
PPTX
Analysis In Agile: It's More than Just User Stories
PPTX
Impact Analysis Template - Enterprise
PDF
Business Impact Analysis - Clause 4 Of BS25999 In Practice
PDF
Building a business impact analysis (bia) process a hands on blueprint
Impact Analysis - LoopConf
TDD in WordPress
Cole ready aim fire impact!- status impact analysis - nasa
Gersetenmaier.william l
Purpose-Driven Meeting Design and Facilitation for Stakeholder Engagement
Project Management101
Analysis In Agile: It's More than Just User Stories
Impact Analysis Template - Enterprise
Business Impact Analysis - Clause 4 Of BS25999 In Practice
Building a business impact analysis (bia) process a hands on blueprint
Ad

Similar to From Good to Great: Functional and Acceptance Testing in WordPress. (20)

PDF
Namshi in 2014: let's rock!
PPTX
BDD / cucumber /Capybara
PDF
Better Testing With PHP Unit
PPT
Testing in AngularJS
PDF
From 0 to 100: How we jump-started our frontend testing
PDF
Behavioral Driven Development
PDF
Behaviour driven infrastructure
PDF
Mykhailo Bodnarchuk "The history of the Codeception project"
PDF
Developer Tests - Things to Know
PPTX
Code ceptioninstallation
PPT
PDF
Plugging into plugins
PDF
Software Testing & PHPSpec
PPT
Pragmatic Parallels: Java and JavaScript
PDF
Unit Testing for Great Justice
PPTX
Cucumber From the Ground Up - Joseph Beale
PDF
WordPress Acceptance Testing, Solved!
ODP
New Ideas for Old Code - Greach
PDF
Selenium rc presentation_20110104
PDF
Selenium RC Presentation 20110104
Namshi in 2014: let's rock!
BDD / cucumber /Capybara
Better Testing With PHP Unit
Testing in AngularJS
From 0 to 100: How we jump-started our frontend testing
Behavioral Driven Development
Behaviour driven infrastructure
Mykhailo Bodnarchuk "The history of the Codeception project"
Developer Tests - Things to Know
Code ceptioninstallation
Plugging into plugins
Software Testing & PHPSpec
Pragmatic Parallels: Java and JavaScript
Unit Testing for Great Justice
Cucumber From the Ground Up - Joseph Beale
WordPress Acceptance Testing, Solved!
New Ideas for Old Code - Greach
Selenium rc presentation_20110104
Selenium RC Presentation 20110104

Recently uploaded (20)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administraation Chapter 3
PPTX
Transform Your Business with a Software ERP System
PDF
Understanding Forklifts - TECH EHS Solution
PDF
medical staffing services at VALiNTRY
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
L1 - Introduction to python Backend.pptx
PPT
Introduction Database Management System for Course Database
Upgrade and Innovation Strategies for SAP ERP Customers
Operating system designcfffgfgggggggvggggggggg
Introduction to Artificial Intelligence
System and Network Administraation Chapter 3
Transform Your Business with a Software ERP System
Understanding Forklifts - TECH EHS Solution
medical staffing services at VALiNTRY
Navsoft: AI-Powered Business Solutions & Custom Software Development
Reimagine Home Health with the Power of Agentic AI​
CHAPTER 2 - PM Management and IT Context
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Digital Systems & Binary Numbers (comprehensive )
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
VVF-Customer-Presentation2025-Ver1.9.pptx
L1 - Introduction to python Backend.pptx
Introduction Database Management System for Course Database

From Good to Great: Functional and Acceptance Testing in WordPress.