際際滷

際際滷Share a Scribd company logo
Maintaining JS Code Quality
http://kechggeography.blogspot.鍖/2012/02/crack-in-wall-my-journey-from-charity.html
Q: What is your test
coverage?
A: That is only a small part of
what we do!
The main purpose for
testing is to give courage
to refactor code.
Where do we get
the courage from?
A Bag of Tricks
QUnit
Selenium
JUnit
JS Error
Reporter
JS Error logging
Server HTTP logs
Code reviews
Testing lunches
Get Satisfaction
Mixpanel
Google Analytics
Customer emails
Usertesting.com
Test outsourcing
JSLint
Blanket.js
Bug tracker
Bug 鍖x day
Unit Tests
Service Tests
UI Tests
Service Tests
Unit Tests
Backend
Frontend
Based on The Test Pyramid by Mike Cohn
Reporting JS Errors in
Selenium Tests
protected void get( String address ) {
油油油 List<JavaScriptError> jsErrors =
油油油油 JavaScriptError.readErrors(driver);
油油油油油油油
油油油 assertTrue( "JsErrors on page" +
油油油油油油油 jsErrors.toString(),
jsErrors.isEmpty() );
油油油 m_driver.get( address );
}
Logging Javascript Errors
from Production
var maxErrors = 5, curErrors = 0;
var origOnErr = window.onerror;
油
window.onerror = function() {
油油油 if(origOnErr)
origOnErr.call(null, arguments);
油油油
油油油 curErrors += 1;
油油油 if(curErrors>=maxErrors) return;
油
油油油 $.ajax({
油油油油油油油 url: BASE_URL+'/reportJsErrors',
油油油油油油油 data: { error: arguments },
油油油油油油油 dataType: 'jsonp'
油油油 });
};
Compare that
CSS styles match
function cssStylesMatch($elem1,$elem2) {
油油油 return serializeDomToHtml($elem1)===
油油油油油油油油油油 serializeDomToHtml($elem2);
}
People dont make bugs,
bad processes do.
Testing can be fun.
Be creative!

More Related Content

Similar to Maintaining Quality (HelsinkiJS, Nov 2013) (20)

PDF
Managing and evolving JavaScript Code
Jean Carlo Emer
PDF
Productive JavaScript Workflow
Krzysztof Szafranek
PDF
Adventures In JavaScript Testing
Thomas Fuchs
PDF
Thomas Fuchs Presentation
RubyOnRails_dude
PPTX
MidwestJS Zero to Testing
pamselle
PDF
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
PPTX
Java script unit testing
Mats Bryntse
PPTX
Zero to Testing in JavaScript
pamselle
PDF
Testing JavaScript Applications
The Rolling Scopes
PDF
JAVASCRIPT Test Driven Development & Jasmine
Anup Singh
PDF
Intro to JavaScript Testing
Ran Mizrahi
PPTX
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
knowdiff
PPTX
Testing Ext JS and Sencha Touch
Mats Bryntse
PDF
The DOM is a Mess @ Yahoo
jeresig
PDF
Your Tests are Lying to You - Improving your Testing by Testing What Really M...
Brian Childress
PDF
Five steps towards your testing dream
Lisa Gagarina
PDF
Why Your Selenium Tests are so Dang Brittle, and What to Do About It
Jay Aho
PDF
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Dinis Cruz
PDF
Refactoring JavaScript turning bad code into good code First Edition Burchard
simbajdzikie4
PDF
Testing for software engineers
Mohammed Ashour
Managing and evolving JavaScript Code
Jean Carlo Emer
Productive JavaScript Workflow
Krzysztof Szafranek
Adventures In JavaScript Testing
Thomas Fuchs
Thomas Fuchs Presentation
RubyOnRails_dude
MidwestJS Zero to Testing
pamselle
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
Java script unit testing
Mats Bryntse
Zero to Testing in JavaScript
pamselle
Testing JavaScript Applications
The Rolling Scopes
JAVASCRIPT Test Driven Development & Jasmine
Anup Singh
Intro to JavaScript Testing
Ran Mizrahi
Amin Milani Fard: Directed Model Inference for Testing and Analysis of Web Ap...
knowdiff
Testing Ext JS and Sencha Touch
Mats Bryntse
The DOM is a Mess @ Yahoo
jeresig
Your Tests are Lying to You - Improving your Testing by Testing What Really M...
Brian Childress
Five steps towards your testing dream
Lisa Gagarina
Why Your Selenium Tests are so Dang Brittle, and What to Do About It
Jay Aho
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Dinis Cruz
Refactoring JavaScript turning bad code into good code First Edition Burchard
simbajdzikie4
Testing for software engineers
Mohammed Ashour

Recently uploaded (20)

PPTX
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
PPTX
arctitecture application system design os dsa
za241967
PDF
Which Hiring Management Tools Offer the Best ROI?
HireME
PDF
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
PPTX
Agentforce TDX 2025 Hackathon Achievement
GetOnCRM Solutions
PPTX
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
PPTX
For my supp to finally picking supp that work
necas19388
PDF
Code Once; Run Everywhere - A Beginners Journey with React Native
Hasitha Walpola
PDF
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
DOCX
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
PPTX
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
PPTX
Introduction to web development | MERN Stack
JosephLiyon
PPTX
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
PPTX
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
PPTX
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
arctitecture application system design os dsa
za241967
Which Hiring Management Tools Offer the Best ROI?
HireME
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
Agentforce TDX 2025 Hackathon Achievement
GetOnCRM Solutions
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
For my supp to finally picking supp that work
necas19388
Code Once; Run Everywhere - A Beginners Journey with React Native
Hasitha Walpola
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
Introduction to web development | MERN Stack
JosephLiyon
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
Wondershare Filmora Crack 14.5.18 + Key Full Download [Latest 2025]
HyperPc soft
Building scalbale cloud native apps with .NET 8
GillesMathieu10
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
Ad

Maintaining Quality (HelsinkiJS, Nov 2013)

  • 1. Maintaining JS Code Quality http://kechggeography.blogspot.鍖/2012/02/crack-in-wall-my-journey-from-charity.html
  • 2. Q: What is your test coverage? A: That is only a small part of what we do!
  • 3. The main purpose for testing is to give courage to refactor code.
  • 4. Where do we get the courage from?
  • 5. A Bag of Tricks QUnit Selenium JUnit JS Error Reporter JS Error logging Server HTTP logs Code reviews Testing lunches Get Satisfaction Mixpanel Google Analytics Customer emails Usertesting.com Test outsourcing JSLint Blanket.js Bug tracker Bug 鍖x day
  • 6. Unit Tests Service Tests UI Tests Service Tests Unit Tests Backend Frontend Based on The Test Pyramid by Mike Cohn
  • 7. Reporting JS Errors in Selenium Tests
  • 8. protected void get( String address ) { 油油油 List<JavaScriptError> jsErrors = 油油油油 JavaScriptError.readErrors(driver); 油油油油油油油 油油油 assertTrue( "JsErrors on page" + 油油油油油油油 jsErrors.toString(), jsErrors.isEmpty() ); 油油油 m_driver.get( address ); }
  • 10. var maxErrors = 5, curErrors = 0; var origOnErr = window.onerror; 油 window.onerror = function() { 油油油 if(origOnErr) origOnErr.call(null, arguments); 油油油 油油油 curErrors += 1; 油油油 if(curErrors>=maxErrors) return; 油 油油油 $.ajax({ 油油油油油油油 url: BASE_URL+'/reportJsErrors', 油油油油油油油 data: { error: arguments }, 油油油油油油油 dataType: 'jsonp' 油油油 }); };
  • 12. function cssStylesMatch($elem1,$elem2) { 油油油 return serializeDomToHtml($elem1)=== 油油油油油油油油油油 serializeDomToHtml($elem2); }
  • 13. People dont make bugs, bad processes do.
  • 14. Testing can be fun. Be creative!