SlideShare a Scribd company logo
JavaScript Unit Testing
          Hanoi PHP Day 2010
                     @hoatle
JavaScript Unit Testing Framework

Presenter: Hoat Le Van (aka hoatle)
»   eXo Social Team Leader
»   Hanoi PHP Day:
     >
         2008: attendee
     >
         2009: Advanced JavaScript Techniques
     >
         2010: JavaScript Unit Testing Framework
»   Work mostly with Java but have much interest in JavaScript
»   Twitter: @hoatle




                                                2
Agenda

»   JavaScript
»   Unit Testing
»   JavaScript Unit Testing Frameworks
»   Fun time for coding




                                         3
JavaScript
What is JavaScript?

»   An implementation of the ECMAScript language standard
»   The King of client-side scripting for web
»   A prototype-based object-oriented scripting language
»   “The world's most misunderstood programming language” (Douglas Crockford)
    ∀
        The Name
    ∀
        Bad books
    ∀
        Amateurs
    ∀
        Object Oriented?




                                            5
Unit Testing
What is Unit Testing?

»   Units of source code are tested
»   Written and run by developers to ensure that code meets its design and behaves
    as intended and expected
»   Commonly automated
»   Extreme Programming uses the creation of unit tests for test-driven
    development




                                          7
Samples (Java - JUnit)




                         8
Samples (Java - JUnit)




                         9
Samples (JavaScript - QUnit)




                       10
Samples (JavaScript - QUnit)




                       11
Test Driven Development (TDD)

»   Writes a failing automated test case that defines a desired improvement or new
    function
»   Implements code to pass that test
»   Finally refactors




                                          12
Test Driven Development (TDD)




                                (wikipedia)

                     13
Unit Testing Benefits

»   To isolate each part of the program and show that the individual parts are
    correct
»   Facilitates change
»   Documentation
»   Design




                                           14
JavaScript Unit Testing Frameworks
JavaScript Unit Testing Frameworks




                      16
Fun time for JavaScript Unit Testing
             and Q&A?

More Related Content

Viewers also liked (6)

PPT
Community garden reporters-book[1]
guest4d351d
 
PDF
Šťastný jako zaměstnanec - respekt.cz
Innovation Tank
 
PPT
kiem tien online
hazzaz
 
PDF
Automotive Industry
Gabriel Amorocho
 
PPTX
trung oss magento overview
hazzaz
 
PPT
Prostor pro setkávání, inovace a rozvoj podnikání
Innovation Tank
 
Community garden reporters-book[1]
guest4d351d
 
Šťastný jako zaměstnanec - respekt.cz
Innovation Tank
 
kiem tien online
hazzaz
 
Automotive Industry
Gabriel Amorocho
 
trung oss magento overview
hazzaz
 
Prostor pro setkávání, inovace a rozvoj podnikání
Innovation Tank
 

Similar to java script unit testing framework (20)

PPT
Javascript unit testing framework
Võ Duy Tuấn
 
PDF
Unit testing (eng)
Anatoliy Okhotnikov
 
ODP
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
PDF
Best practices for JavaScript RIAs
Carlos Ble
 
PDF
Unit testing and scaffolding
Valerio Maggio
 
PDF
Test driven development
Dennis Ahaus
 
PDF
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
 
PDF
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
PPTX
JavaScript Unit Testing
L&T Technology Services Limited
 
PPTX
Test driven development
Luis Goldster
 
PPTX
Test driven development
Young Alista
 
PPTX
Test driven development
Tony Nguyen
 
PPTX
Test driven development
Fraboni Ec
 
PPTX
Test driven development
James Wong
 
PPTX
Test driven development
Harry Potter
 
PPTX
TDD - Agile
harinderpisces
 
KEY
Test Driven Development - For Girl Geeks Night Sydney
Jo Cranford
 
PDF
Agile Testing 20021015
Raghu Karnati
 
PPTX
Understanding TDD - theory, practice, techniques and tips.
Malinda Kapuruge
 
PPT
Pragmatic Parallels: Java and JavaScript
davejohnson
 
Javascript unit testing framework
Võ Duy Tuấn
 
Unit testing (eng)
Anatoliy Okhotnikov
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
Best practices for JavaScript RIAs
Carlos Ble
 
Unit testing and scaffolding
Valerio Maggio
 
Test driven development
Dennis Ahaus
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Anup Singh
 
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
JavaScript Unit Testing
L&T Technology Services Limited
 
Test driven development
Luis Goldster
 
Test driven development
Young Alista
 
Test driven development
Tony Nguyen
 
Test driven development
Fraboni Ec
 
Test driven development
James Wong
 
Test driven development
Harry Potter
 
TDD - Agile
harinderpisces
 
Test Driven Development - For Girl Geeks Night Sydney
Jo Cranford
 
Agile Testing 20021015
Raghu Karnati
 
Understanding TDD - theory, practice, techniques and tips.
Malinda Kapuruge
 
Pragmatic Parallels: Java and JavaScript
davejohnson
 
Ad

More from hazzaz (20)

PPS
Coffee1
hazzaz
 
PPS
Suy ngam
hazzaz
 
PPT
Tu dong dat hang tu he thong ban le lon nhat trung quoc
hazzaz
 
PPT
how startups can benefit from launch community
hazzaz
 
PPT
social network game
hazzaz
 
PDF
su dung drupal xay dung mang xa hoi
hazzaz
 
PPT
html5 css3 the future of web technology
hazzaz
 
PPT
build your own php extension
hazzaz
 
PDF
web optimization
hazzaz
 
PDF
speed up ntvv2 by php ext module
hazzaz
 
PDF
zingmepracticeforbuildingscalablewebsitewithphp
hazzaz
 
PPT
mysql optimization
hazzaz
 
PPT
EAV in Magento
hazzaz
 
PPT
Albus
hazzaz
 
PPT
css_trends
hazzaz
 
PPT
Cloud
hazzaz
 
PPT
Phan mem tu do nguon mo
hazzaz
 
PPT
Zing
hazzaz
 
ODP
redis
hazzaz
 
PPT
Howtobuildyourownframework
hazzaz
 
Coffee1
hazzaz
 
Suy ngam
hazzaz
 
Tu dong dat hang tu he thong ban le lon nhat trung quoc
hazzaz
 
how startups can benefit from launch community
hazzaz
 
social network game
hazzaz
 
su dung drupal xay dung mang xa hoi
hazzaz
 
html5 css3 the future of web technology
hazzaz
 
build your own php extension
hazzaz
 
web optimization
hazzaz
 
speed up ntvv2 by php ext module
hazzaz
 
zingmepracticeforbuildingscalablewebsitewithphp
hazzaz
 
mysql optimization
hazzaz
 
EAV in Magento
hazzaz
 
Albus
hazzaz
 
css_trends
hazzaz
 
Cloud
hazzaz
 
Phan mem tu do nguon mo
hazzaz
 
Zing
hazzaz
 
redis
hazzaz
 
Howtobuildyourownframework
hazzaz
 
Ad

Recently uploaded (20)

PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
Next level data operations using Power Automate magic
Andries den Haan
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 

java script unit testing framework

  • 1. JavaScript Unit Testing Hanoi PHP Day 2010 @hoatle
  • 2. JavaScript Unit Testing Framework Presenter: Hoat Le Van (aka hoatle) » eXo Social Team Leader » Hanoi PHP Day: > 2008: attendee > 2009: Advanced JavaScript Techniques > 2010: JavaScript Unit Testing Framework » Work mostly with Java but have much interest in JavaScript » Twitter: @hoatle 2
  • 3. Agenda » JavaScript » Unit Testing » JavaScript Unit Testing Frameworks » Fun time for coding 3
  • 5. What is JavaScript? » An implementation of the ECMAScript language standard » The King of client-side scripting for web » A prototype-based object-oriented scripting language » “The world's most misunderstood programming language” (Douglas Crockford) ∀ The Name ∀ Bad books ∀ Amateurs ∀ Object Oriented? 5
  • 7. What is Unit Testing? » Units of source code are tested » Written and run by developers to ensure that code meets its design and behaves as intended and expected » Commonly automated » Extreme Programming uses the creation of unit tests for test-driven development 7
  • 8. Samples (Java - JUnit) 8
  • 9. Samples (Java - JUnit) 9
  • 12. Test Driven Development (TDD) » Writes a failing automated test case that defines a desired improvement or new function » Implements code to pass that test » Finally refactors 12
  • 13. Test Driven Development (TDD) (wikipedia) 13
  • 14. Unit Testing Benefits » To isolate each part of the program and show that the individual parts are correct » Facilitates change » Documentation » Design 14
  • 16. JavaScript Unit Testing Frameworks 16
  • 17. Fun time for JavaScript Unit Testing and Q&A?