SlideShare una empresa de Scribd logo
1 de 71
Descargar para leer sin conexión
Maintaining Your Tests
At Scale
@trentmwillis
ln -s linkedin microsoft
Things that have happened
in recently
📢🎵
😡🎵
😡🎵 for 😃
What is Scale?
4000+ Tests
1000+ Acceptance Tests
Dozens of commits
per day
Why is maintaining
tests at Scale hard?
Why is maintaining
tests at Scale difficult?

And how do we make
it not difficult?
Flakiness
(a.k.a. non-atomic, inter-dependent tests)
Common Causes
Common Causes
Not cleaning up async handlers
Previous tests modifying shared state
Environmental differences (looking at you
Phantom)
moduleForAcceptance(‘Some module’);
// passes fine
moduleForComponent(‘modified-by-initializer’);
// passes fine since acceptance test ran
// initializers
// moduleForAcceptance(‘Some module’);
// deleted due to feature removal
moduleForComponent(‘modified-by-initializer’);
// FAILS! No acceptance test to
// run initializers
Flakiness
(a.k.a. non-atomic, inter-dependent tests)
Randomization!
(chaos is good)
“[Reordering] can also lead to random
errors, in case your testsuite has non-
atomic tests, where the order is important.
You should fix those issues, instead of
disabling reordering!”
- QUnit documentation on config.reorder
QUnit.config.seed = ‘any string’;
QUnit.config.seed = true;
/tests?seed=1337
/tests?seed
ember install ember-exam
ember exam --random=<seed>
Slowness
(a.k.a. an excuse to slack off)
var numTests = 1000;
var timePerTest = 2;
var timePerMinute = 60;

var testTime= numTests * timePerTest;

console.log(testTime / timePerMinute);
30 minutes!
Slowness
(a.k.a. an excuse to slack off)
Parallelization!
(of all the things)
Testem has supported parallelization for a
long time
{
“parallel”: “4”
}
Testem has supported parallelization for a
long time
Testem has supported parallelization for a
long time but it had limitations
{
“test_page”: [
“/tests/index.html?filter=acceptance”,
“/tests/index.html?filter=integration”,
“/tests/index.html?filter=unit”
]
}
ember exam --split=<num> --parallel
ok 1 PhantomJS 1.9 - Exam Partition #1 - some test
ok 2 PhantomJS 1.9 - Exam Partition #3 - some other other test
ok 3 PhantomJS 1.9 - Exam Partition #2 - some other test
{
“parallel”: “-1”
}
ember build
ember exam
--path dist
--split 20
--parallel
--random
Tracking Features
(a.k.a. did you add tests?)
Things We Should Stop Saying
Things We Should Stop Saying
“Tests will be in the next PR”
“I tested it manually”
“This is a blocker,

so tests will have to come later”
TDD
Write tests before implementing
import { skip } from ‘qunit’;
skip(‘Upcoming feature’);
Tracking Features
(a.k.a. did you add tests?)
Todo Lists
(ya, old school)
Feature: Awesome Feature
TestCase: Should Do Awesome Thing
TestCase: Should Do Less Awesome Thing
QUnit.todo();
Disclaimer: Not Ready Yet
(we have a todo for todo)
Disclaimer: Not Ready Yet
(we have a todo for todo)
PR: jquery/qunit#1006
import { module, test, todo } from ‘qunit’;
module(‘Awesome Feature’);
test(‘awesome thing’, function(assert) {
assert.ok(true, “I’m ready!”);
});
todo(‘less awesome thing’, function(assert) {
assert.ok(false, “I’m NOT ready yet!”);
});
testem/custom-reporter.js
testem/custom-reporter.js
Finding Things
(a.k.a, “I think I scrolled past it…”)
Cmd + Shift + F
Cmd + Shift + F + Hope For The Best
Finding Things
(a.k.a, “I think I scrolled past it…”)
Organization!
(conventions 😉)
<test-type> | <type> | <path>
Integration | Component | awesome-sauce
integration/component/awesome-sauce
Flakiness
Slowness
Tracking Features
Finding Things
Randomization
Parallelization
Todo Lists
Organization
One Final Thing
(we need you!)
Accessibility
Accessibility
ember-a11y-testing
Questions?

Más contenido relacionado

La actualidad más candente

GeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testingGeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testing
Jakub Marchwicki
 
Unit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming RubyUnit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming Ruby
lvrubygroup
 

La actualidad más candente (20)

Django Testing
Django TestingDjango Testing
Django Testing
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJS
 
Jasmine framework
Jasmine frameworkJasmine framework
Jasmine framework
 
prohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracle
prohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracleprohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracle
prohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracle
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011
 
GeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testingGeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testing
 
Unit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming RubyUnit testing Ch. 13 of Programming Ruby
Unit testing Ch. 13 of Programming Ruby
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 Proxy
 
Selenium with protractor
Selenium with protractorSelenium with protractor
Selenium with protractor
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
 
The sweet smell of jasmine for testing JavaScript
The sweet smell of jasmine for testing JavaScriptThe sweet smell of jasmine for testing JavaScript
The sweet smell of jasmine for testing JavaScript
 
Testing sync engine
Testing sync engineTesting sync engine
Testing sync engine
 
Testing your code
Testing your codeTesting your code
Testing your code
 
Rtt preso
Rtt presoRtt preso
Rtt preso
 
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWJest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRW
 
Gestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactoryGestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactory
 
Ui Testing with Ghost Inspector
Ui Testing with Ghost InspectorUi Testing with Ghost Inspector
Ui Testing with Ghost Inspector
 

Similar a Maintaining Your Tests At Scale

谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability
drewz lin
 

Similar a Maintaining Your Tests At Scale (20)

Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock Framework
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
 
Describe's Full of It's
Describe's Full of It'sDescribe's Full of It's
Describe's Full of It's
 
Token Testing Slides
Token  Testing SlidesToken  Testing Slides
Token Testing Slides
 
Heavenly hell – automated tests at scale wojciech seliga
Heavenly hell – automated tests at scale   wojciech seligaHeavenly hell – automated tests at scale   wojciech seliga
Heavenly hell – automated tests at scale wojciech seliga
 
Good Practices On Test Automation
Good Practices On Test AutomationGood Practices On Test Automation
Good Practices On Test Automation
 
Escaping Automated Test Hell - One Year Later
Escaping Automated Test Hell - One Year LaterEscaping Automated Test Hell - One Year Later
Escaping Automated Test Hell - One Year Later
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
Automate test, tools, advantages, and disadvantages
Automate test, tools, advantages,  and disadvantagesAutomate test, tools, advantages,  and disadvantages
Automate test, tools, advantages, and disadvantages
 
Testing – With Mock Objects
Testing – With Mock ObjectsTesting – With Mock Objects
Testing – With Mock Objects
 
Unit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and HowsUnit Testing - The Whys, Whens and Hows
Unit Testing - The Whys, Whens and Hows
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
E2E testing con nightwatch.js - Drupalcamp Spain 2018
E2E testing con nightwatch.js  - Drupalcamp Spain 2018E2E testing con nightwatch.js  - Drupalcamp Spain 2018
E2E testing con nightwatch.js - Drupalcamp Spain 2018
 
Unit tests in node.js
Unit tests in node.jsUnit tests in node.js
Unit tests in node.js
 
Angular Unit Testing from the Trenches
Angular Unit Testing from the TrenchesAngular Unit Testing from the Trenches
Angular Unit Testing from the Trenches
 
谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018Das Frontend richtig Testen – mit Jest @Developer Week 2018
Das Frontend richtig Testen – mit Jest @Developer Week 2018
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Maintaining Your Tests At Scale