Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScriptTesting
Search
Luca Grulla
April 23, 2012
1.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScriptTesting
Delivered at XP2010
Luca Grulla
April 23, 2012
More Decks by Luca Grulla
See All by Luca Grulla
Il grande bluff delle stime
lucagrulla
0
360
Building a Firehose with NodeJS
lucagrulla
1
150
Featured
See All Featured
Navigating Team Friction
lara
192
16k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Test your architecture with Archunit
thirion
2
2.4k
Navigating Weather and Climate Data
rabernat
0
550
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Odyssey Design
rkendrick25
PRO
2
870
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Fireside Chat
paigeccino
43
4.1k
Mobile First: as difficult as doing things right
swwweet
225
10k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
730
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
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