際際滷

際際滷Share a Scribd company logo
Testing JavaScript
XP Methodologies
Garrett Smith
Front End Engineer
What is Testing?
 Testing veri鍖es that the system does
what its supposed to
Quality
 Internal Quality - measured by the
programmer
 External Quality - measured by the
customer
Types of Testing
 Unit Testing
 Acceptance Testing
 Internal Quality - is it easy to maintain?
How hard is it to make changes?
 External Quality - does it do what it's
supposed to?
Unit Testing
 A "unit" can be an ADT, an Object, or a
function
Costs of not Testing
 Code debt
 Cant refactor safely
Bene鍖ts
 Tests facilitate change
 Good coverage ensures that all code
paths work
 Tests make the code easier to
understand
 Testability leads to cleaner code;
microformats
Cost of Testing
 Hard work and discipline
 Requires hardcore team commitment
Freedom to Change
Tests facilitate change
OK
Fixing Bugs
Test Case
 Set of independent tests
 http://dhtmlkitchen.com/ape/test/tests/dom/
style-f-test.html
 setUp, tearDown, template
Test Suite
 APE JavaScript Library
 http://dhtmlkitchen.com/ape/test/tests/
suite.html
Tools
 JSUnit
 YUI Test
 JSCoverage
Further Reading
 Agile Software Development: Principles, Patterns and Practices, Robert
C. Martin
 Architecture is a Second Order Effect, http://blog.objectmentor.com/
articles/2007/10/20/architecture-is-a-second-order-effect
 Re: Simples Rules make creating Big Balls of Mud impossible. http://
coding.derkeiler.com/Archive/General/comp.object/2007-01/
msg00241.html
 http://en.wikipedia.org/wiki/Code_coverage
 http://www.objectmentor.com/omSolutions/agile_xp_differences.html
 Extreme programming explained: Embrace Change油By Kent Beck
 Planning Extreme Programming, Beck, Fowler, Kohnke

More Related Content

What's hot (11)

Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assurance
Benjamin Baumann
A Concise QA Process
A Concise QA Process A Concise QA Process
A Concise QA Process
Arslan Ali
Testing
TestingTesting
Testing
Gaurav Nigam
Quality Assurance
Quality AssuranceQuality Assurance
Quality Assurance
Manifest Infotech
Qulaity strategy template
Qulaity strategy templateQulaity strategy template
Qulaity strategy template
Stephenmounsey00
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
Luis Garc鱈a Castro
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil Karade
IndicThreads
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOps
dpaulmerrill
Testing Best Practices
Testing Best PracticesTesting Best Practices
Testing Best Practices
Axway Appcelerator
Tdd
TddTdd
Tdd
Dmitry Savin
System testing
System testingSystem testing
System testing
Sifat Hossain
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assurance
Benjamin Baumann
A Concise QA Process
A Concise QA Process A Concise QA Process
A Concise QA Process
Arslan Ali
Qulaity strategy template
Qulaity strategy templateQulaity strategy template
Qulaity strategy template
Stephenmounsey00
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil Karade
IndicThreads
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOps
dpaulmerrill

Viewers also liked (6)

Adventures In JavaScript Testing
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript Testing
Thomas Fuchs
JSpec - A Javascript Unit Testing Framework
JSpec - A Javascript Unit Testing FrameworkJSpec - A Javascript Unit Testing Framework
JSpec - A Javascript Unit Testing Framework
Lena Herrmann
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
Zero to Testing in JavaScript
Zero to Testing in JavaScriptZero to Testing in JavaScript
Zero to Testing in JavaScript
pamselle
Testing JavaScript Applications
Testing JavaScript ApplicationsTesting JavaScript Applications
Testing JavaScript Applications
The Rolling Scopes
JavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + ChaiJavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + Chai
James Cryer
Adventures In JavaScript Testing
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript Testing
Thomas Fuchs
JSpec - A Javascript Unit Testing Framework
JSpec - A Javascript Unit Testing FrameworkJSpec - A Javascript Unit Testing Framework
JSpec - A Javascript Unit Testing Framework
Lena Herrmann
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
Zero to Testing in JavaScript
Zero to Testing in JavaScriptZero to Testing in JavaScript
Zero to Testing in JavaScript
pamselle
Testing JavaScript Applications
Testing JavaScript ApplicationsTesting JavaScript Applications
Testing JavaScript Applications
The Rolling Scopes
JavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + ChaiJavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + Chai
James Cryer

Similar to Testing JavaScript (20)

An Introduction to Developer Testing
An Introduction to Developer TestingAn Introduction to Developer Testing
An Introduction to Developer Testing
Will Green
Agile testing
Agile testingAgile testing
Agile testing
Madhu Packiam Duraisamy
Unit testing
Unit testing Unit testing
Unit testing
dubbu
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
Amir Assad
Test-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJSTest-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJS
SmartOrg
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
Xavi Hidalgo
Developer Testing
Developer TestingDeveloper Testing
Developer Testing
Chris Wallace
Introduction to test programming
Introduction to test programmingIntroduction to test programming
Introduction to test programming
openfinanceDev
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
Binary Studio
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
Peter Presnell
Test driven development(tdd)
Test driven development(tdd)Test driven development(tdd)
Test driven development(tdd)
Omar Youssef Shiha
05 junit
05 junit05 junit
05 junit
mha4
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
Attila Bert坦k
NET Code Testing
NET Code TestingNET Code Testing
NET Code Testing
Kirill Miroshnichenko
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
Sahar Nofal
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
CodeOps Technologies LLP
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
Test driven development
Test driven developmentTest driven development
Test driven development
Luis Goldster
Test driven development
Test driven developmentTest driven development
Test driven development
Young Alista
An Introduction to Developer Testing
An Introduction to Developer TestingAn Introduction to Developer Testing
An Introduction to Developer Testing
Will Green
Unit testing
Unit testing Unit testing
Unit testing
dubbu
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
Amir Assad
Test-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJSTest-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJS
SmartOrg
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
Xavi Hidalgo
Developer Testing
Developer TestingDeveloper Testing
Developer Testing
Chris Wallace
Introduction to test programming
Introduction to test programmingIntroduction to test programming
Introduction to test programming
openfinanceDev
Binary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code TestingBinary Studio Academy: .NET Code Testing
Binary Studio Academy: .NET Code Testing
Binary Studio
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
Peter Presnell
Test driven development(tdd)
Test driven development(tdd)Test driven development(tdd)
Test driven development(tdd)
Omar Youssef Shiha
05 junit
05 junit05 junit
05 junit
mha4
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
Sahar Nofal
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
CodeOps Technologies LLP
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
Test driven development
Test driven developmentTest driven development
Test driven development
Luis Goldster
Test driven development
Test driven developmentTest driven development
Test driven development
Young Alista

Recently uploaded (20)

Lets Get Slack Certified! - Slack Community
Lets Get Slack Certified! - Slack CommunityLets Get Slack Certified! - Slack Community
Lets Get Slack Certified! - Slack Community
SanjeetMishra29
Cyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptxCyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptx
Ghimire B.R.
The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptxFrom Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
Mohammad Jomaa
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Lorenzo Miniero
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptxBreak Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Mohammad Jomaa
Droidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing HealthcareDroidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing Healthcare
Droidal LLC
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
Security Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk CertificateSecurity Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk Certificate
VICTOR MAESTRE RAMIREZ
Supercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMsSupercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMs
Francesco Corti
Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025
Splunk
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
AI Trends - Mary Meeker
AI Trends - Mary MeekerAI Trends - Mary Meeker
AI Trends - Mary Meeker
Razin Mustafiz
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
Contributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptxContributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptx
Patrick Lumumba
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 ProfessioMaster tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Kari Kakkonen
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
Lets Get Slack Certified! - Slack Community
Lets Get Slack Certified! - Slack CommunityLets Get Slack Certified! - Slack Community
Lets Get Slack Certified! - Slack Community
SanjeetMishra29
Cyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptxCyber Security Legal Framework in Nepal.pptx
Cyber Security Legal Framework in Nepal.pptx
Ghimire B.R.
The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptxFrom Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
From Legacy to Cloud-Native: A Guide to AWS Modernization.pptx
Mohammad Jomaa
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Lorenzo Miniero
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptxBreak Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Break Down of Service Mesh Concepts and Implementation in AWS EKS.pptx
Mohammad Jomaa
Droidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing HealthcareDroidal: AI Agents Revolutionizing Healthcare
Droidal: AI Agents Revolutionizing Healthcare
Droidal LLC
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
Security Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk CertificateSecurity Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk Certificate
VICTOR MAESTRE RAMIREZ
Supercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMsSupercharge Your AI Development with Local LLMs
Supercharge Your AI Development with Local LLMs
Francesco Corti
Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025
Splunk
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
AI Trends - Mary Meeker
AI Trends - Mary MeekerAI Trends - Mary Meeker
AI Trends - Mary Meeker
Razin Mustafiz
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
Contributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptxContributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptx
Patrick Lumumba
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 ProfessioMaster tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Master tester AI toolbox - Kari Kakkonen at Testaus ja AI 2025 Professio
Kari Kakkonen
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah

Testing JavaScript

  • 2. What is Testing? Testing veri鍖es that the system does what its supposed to
  • 3. Quality Internal Quality - measured by the programmer External Quality - measured by the customer
  • 4. Types of Testing Unit Testing Acceptance Testing Internal Quality - is it easy to maintain? How hard is it to make changes? External Quality - does it do what it's supposed to?
  • 5. Unit Testing A "unit" can be an ADT, an Object, or a function
  • 6. Costs of not Testing Code debt Cant refactor safely
  • 7. Bene鍖ts Tests facilitate change Good coverage ensures that all code paths work Tests make the code easier to understand Testability leads to cleaner code; microformats
  • 8. Cost of Testing Hard work and discipline Requires hardcore team commitment
  • 9. Freedom to Change Tests facilitate change OK
  • 11. Test Case Set of independent tests http://dhtmlkitchen.com/ape/test/tests/dom/ style-f-test.html setUp, tearDown, template
  • 12. Test Suite APE JavaScript Library http://dhtmlkitchen.com/ape/test/tests/ suite.html
  • 13. Tools JSUnit YUI Test JSCoverage
  • 14. Further Reading Agile Software Development: Principles, Patterns and Practices, Robert C. Martin Architecture is a Second Order Effect, http://blog.objectmentor.com/ articles/2007/10/20/architecture-is-a-second-order-effect Re: Simples Rules make creating Big Balls of Mud impossible. http:// coding.derkeiler.com/Archive/General/comp.object/2007-01/ msg00241.html http://en.wikipedia.org/wiki/Code_coverage http://www.objectmentor.com/omSolutions/agile_xp_differences.html Extreme programming explained: Embrace Change油By Kent Beck Planning Extreme Programming, Beck, Fowler, Kohnke