Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JavaScriptTesting
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Luca Grulla
April 23, 2012
1
1.2k
JavaScriptTesting
Delivered at XP2010
Luca Grulla
April 23, 2012
Tweet
Share
More Decks by Luca Grulla
See All by Luca Grulla
Il grande bluff delle stime
lucagrulla
0
350
Building a Firehose with NodeJS
lucagrulla
1
140
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
[SF Ruby Conf 2025] Rails X
palkan
1
740
First, design no harm
axbom
PRO
2
1.1k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
56
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Bash Introduction
62gerente
615
210k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Making Projects Easy
brettharned
120
6.6k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Chasing Engaging Ingredients in Design
codingconduct
0
110
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Transcript
The secret art of Agile Javascrip3ng Brian Blignaut Luca Grulla Trondheim, 4/6/10 ‐ XP2010
Our background Large public facing websites Significant javascript codebase with complex DOM interacKon Heavy use of Ajax Large amount of business logic Long life expectancy
Disclaimer This presentaKon is technology agnosKc Each tool used is replaceable It is not about how to use jQuery
Technology Stack • JQuery • JSTestDriver • Ewloe • JavascriptLint
It used to be so simple…
Rich clients
We want unit tests
Scenario Login form Need to validate user credenKals Need to execute a server call via ajax POST Based on the result we need to show a welcome or an error message
None
None
None
None
So what is wrong with this code ?
None
We want to test it!
Domain abstrac3on
Abstrac3on around integra3on points
HTTP DOM PresentaKon Logic Business Logic
None
None
None
None
None
None
None
None
Live Demo ‐ Shopping Cart
Our approach Javascript is a first class language create abstracKons: business logic presentaKon logic integraKons …but not limited to a specific paVern !! Keep your presentaKon logic class as skinny as possible in order to express intents Favour interacKon tests over integraKon tests
Tools Considera3ons ….whatever you like but has to be pluggable in your ConKnuous IntegraKon !!
Ques3ons ?
Thank You ! Brian Blignaut
[email protected]
Luca Grulla
[email protected]
hVp://www.lucagrulla.it
References Live demo starKng point code hVp://github.com/gurrie/norway Live demo refactored code hVp://github.com/gurrie/norway/tree/completedSoluKon Ewloe hVp://github.com/gurrie/ewloe