SlideShare una empresa de Scribd logo
1 de 22
So who wants to hear
another testing talk?
Ok so who is developing
TDD or test first?
DOM code?
Hi I am Phil, and I'm a
Developer...
@sideshowcoder (github) @ischi (twitter)
working for Cospired
Javascript frontend
testing
from failure to good to great
TDD for DOM is hard
right?
Either they are slow
TDD fast feedback loop with capybara
anyone?
Or they can't test what I
need!
function addFive(x) { return x + 5 }
... is not what I do day to day
They are hard to setup
1 hour project 2 hour setup?
What about CI integration?
But I want to testdrive my
code!
because my code is better when I do
Ok so lets see is it really
so hard?
lets walk through a simple example
DEMO
https://github.com/sideshowcoder/frontend-
tdd-with-jasmine
Yeah I know just some
jQuery...
but I hope it shows some principles
Breaking code up by
responsibility
Small modules enable reuse
*do one thing and do it well!*
Be aware of your
dependencies
On which parts of the DOM do I rely on?
Which other plugins do I need?
Changes are easier
Everything has it's place
And I got some
confidence that it does
what it says it does*
*different from 'it does what I want it to do'
but it's a start!
Tests can be integrated in
CI
rake jasmine:ci
They can be run
headlessly
phantom-jasmine, jasmine-guard, jasmine-
headless-webkit
So yes it is possible to
TDD frontend code
IMHO
Questions?
And thank you all for listening!

Más contenido relacionado

La actualidad más candente

Coding Dojo: Mars Rover (2014)
Coding Dojo: Mars Rover (2014)Coding Dojo: Mars Rover (2014)
Coding Dojo: Mars Rover (2014)
Peter Kofler
 

La actualidad más candente (20)

TDD python ne-april-2014
TDD python ne-april-2014TDD python ne-april-2014
TDD python ne-april-2014
 
Coding Dojo In 5 minutes
Coding Dojo In 5 minutesCoding Dojo In 5 minutes
Coding Dojo In 5 minutes
 
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
JDD2014: Continuous delivery: capitalizing high quality automated tests - Szc...
 
Test Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y GomegaTest Driven Development en Go con Ginkgo y Gomega
Test Driven Development en Go con Ginkgo y Gomega
 
Javascript test automation demo
Javascript test automation demoJavascript test automation demo
Javascript test automation demo
 
TDD, Refactoring - Workshop
TDD, Refactoring - WorkshopTDD, Refactoring - Workshop
TDD, Refactoring - Workshop
 
TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018TDD and Simple Design Workshop - Session 1 - November 2018
TDD and Simple Design Workshop - Session 1 - November 2018
 
Tdd presentation
Tdd presentationTdd presentation
Tdd presentation
 
5 books for absolute programming beginners
5 books for absolute programming beginners5 books for absolute programming beginners
5 books for absolute programming beginners
 
Code Dojo
Code DojoCode Dojo
Code Dojo
 
Application Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience CourseApplication Development Using Java - DIYComputerScience Course
Application Development Using Java - DIYComputerScience Course
 
Extjs Howto
Extjs HowtoExtjs Howto
Extjs Howto
 
Coding Dojo: Mars Rover (2014)
Coding Dojo: Mars Rover (2014)Coding Dojo: Mars Rover (2014)
Coding Dojo: Mars Rover (2014)
 
SpecBDD in PHP
SpecBDD in PHPSpecBDD in PHP
SpecBDD in PHP
 
SLOID Share
SLOID ShareSLOID Share
SLOID Share
 
TDC2016POA | Trilha DevOps - DevOps Anti-Patterns
TDC2016POA | Trilha DevOps - DevOps Anti-PatternsTDC2016POA | Trilha DevOps - DevOps Anti-Patterns
TDC2016POA | Trilha DevOps - DevOps Anti-Patterns
 
Why and how to keep your code quality
Why and how to keep your code quality Why and how to keep your code quality
Why and how to keep your code quality
 
Is your code ready for testing?
Is your code ready for testing?Is your code ready for testing?
Is your code ready for testing?
 
DevOps Anti-Patterns
DevOps Anti-PatternsDevOps Anti-Patterns
DevOps Anti-Patterns
 
GDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran CanariaGDCR15 in Las Palmas, Gran Canaria
GDCR15 in Las Palmas, Gran Canaria
 

Destacado

English language arts_5_2010[1]
English language arts_5_2010[1]English language arts_5_2010[1]
English language arts_5_2010[1]
Susan Robertson
 
Comonarranimageneslde
ComonarranimagenesldeComonarranimageneslde
Comonarranimageneslde
Herbert Salas
 
ACT Assessment Workshop Prompts
ACT Assessment Workshop PromptsACT Assessment Workshop Prompts
ACT Assessment Workshop Prompts
cwozniak
 
08 06-12 espavilaem
08 06-12 espavilaem08 06-12 espavilaem
08 06-12 espavilaem
byspooker
 
Elementsprinciples 091210004439-phpapp01
Elementsprinciples 091210004439-phpapp01Elementsprinciples 091210004439-phpapp01
Elementsprinciples 091210004439-phpapp01
anjoronjust
 
Historia de la tecnologia
Historia de la tecnologiaHistoria de la tecnologia
Historia de la tecnologia
omar yesid
 
Community police
Community policeCommunity police
Community police
Kazi Iqbal
 
Ibahrine Chapter 9 Culture And Advertising Appeals
Ibahrine Chapter 9 Culture And Advertising AppealsIbahrine Chapter 9 Culture And Advertising Appeals
Ibahrine Chapter 9 Culture And Advertising Appeals
ibahrine
 

Destacado (20)

93 percent-bing-for-internet-marketing-services
93 percent-bing-for-internet-marketing-services93 percent-bing-for-internet-marketing-services
93 percent-bing-for-internet-marketing-services
 
Load balancing in Content Delivery Networks in Novel Distributed Equilibrium
Load balancing in Content Delivery Networks in Novel Distributed EquilibriumLoad balancing in Content Delivery Networks in Novel Distributed Equilibrium
Load balancing in Content Delivery Networks in Novel Distributed Equilibrium
 
Bilaga 1 3 Adhdkvinnor
Bilaga 1 3 AdhdkvinnorBilaga 1 3 Adhdkvinnor
Bilaga 1 3 Adhdkvinnor
 
English language arts_5_2010[1]
English language arts_5_2010[1]English language arts_5_2010[1]
English language arts_5_2010[1]
 
Comonarranimageneslde
ComonarranimagenesldeComonarranimageneslde
Comonarranimageneslde
 
Sonido Digital 2
Sonido Digital 2Sonido Digital 2
Sonido Digital 2
 
ACT Assessment Workshop Prompts
ACT Assessment Workshop PromptsACT Assessment Workshop Prompts
ACT Assessment Workshop Prompts
 
08 06-12 espavilaem
08 06-12 espavilaem08 06-12 espavilaem
08 06-12 espavilaem
 
Manualdeadiestramientocanino
ManualdeadiestramientocaninoManualdeadiestramientocanino
Manualdeadiestramientocanino
 
La historia 10ºb
La historia 10ºbLa historia 10ºb
La historia 10ºb
 
Lucy meade
Lucy meadeLucy meade
Lucy meade
 
BGL 2007-08_low
BGL 2007-08_lowBGL 2007-08_low
BGL 2007-08_low
 
Elementsprinciples 091210004439-phpapp01
Elementsprinciples 091210004439-phpapp01Elementsprinciples 091210004439-phpapp01
Elementsprinciples 091210004439-phpapp01
 
2011 review
2011 review2011 review
2011 review
 
Seguridade i vanete
Seguridade i vaneteSeguridade i vanete
Seguridade i vanete
 
North America Green City Index
North America Green City IndexNorth America Green City Index
North America Green City Index
 
Historia de la tecnologia
Historia de la tecnologiaHistoria de la tecnologia
Historia de la tecnologia
 
Business Ethics and Corporate Governance - White Paper
Business Ethics and Corporate Governance - White PaperBusiness Ethics and Corporate Governance - White Paper
Business Ethics and Corporate Governance - White Paper
 
Community police
Community policeCommunity police
Community police
 
Ibahrine Chapter 9 Culture And Advertising Appeals
Ibahrine Chapter 9 Culture And Advertising AppealsIbahrine Chapter 9 Culture And Advertising Appeals
Ibahrine Chapter 9 Culture And Advertising Appeals
 

Similar a JavaScript frontend testing from failure to good to great

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
bhochhi
 

Similar a JavaScript frontend testing from failure to good to great (20)

Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed Shreef
 
TDD - Unit testing done right and programmer happiness
TDD - Unit testing done right and programmer happinessTDD - Unit testing done right and programmer happiness
TDD - Unit testing done right and programmer happiness
 
« Training Within Software » using Dojo and Mob Programming by Bernard Notari...
« Training Within Software » using Dojo and Mob Programming by Bernard Notari...« Training Within Software » using Dojo and Mob Programming by Bernard Notari...
« Training Within Software » using Dojo and Mob Programming by Bernard Notari...
 
TDD Walkthrough - Encryption
TDD Walkthrough - EncryptionTDD Walkthrough - Encryption
TDD Walkthrough - Encryption
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1 Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
 
Monolith vs Microservices vs Teams
Monolith vs Microservices vs TeamsMonolith vs Microservices vs Teams
Monolith vs Microservices vs Teams
 
Tomáš Strejček - Velikost týmu vs. monolith a mikroservicy (11. sraz přátel ...
Tomáš Strejček - Velikost týmu vs. monolith a mikroservicy  (11. sraz přátel ...Tomáš Strejček - Velikost týmu vs. monolith a mikroservicy  (11. sraz přátel ...
Tomáš Strejček - Velikost týmu vs. monolith a mikroservicy (11. sraz přátel ...
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)Tdd is not about testing (C++ version)
Tdd is not about testing (C++ version)
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Java Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDDJava Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDD
 
The rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in TurinThe rocket internet experience @ PHP.TO.START 2013 in Turin
The rocket internet experience @ PHP.TO.START 2013 in Turin
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
TDD - do increasing and save...
TDD - do increasing and save...TDD - do increasing and save...
TDD - do increasing and save...
 
TDD Walkthrough - The Time in Words
TDD Walkthrough -  The Time in WordsTDD Walkthrough -  The Time in Words
TDD Walkthrough - The Time in Words
 
Cheap ci for javascript devs
Cheap ci for javascript devsCheap ci for javascript devs
Cheap ci for javascript devs
 

Más de Philipp Fehre

Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
Philipp Fehre
 

Más de Philipp Fehre (18)

node.js and native code extensions by example
node.js and native code extensions by examplenode.js and native code extensions by example
node.js and native code extensions by example
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a database
 
Couchbase Mobile on Android
Couchbase Mobile on AndroidCouchbase Mobile on Android
Couchbase Mobile on Android
 
From 0 to syncing
From 0 to syncingFrom 0 to syncing
From 0 to syncing
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
 
You got schema in my json
You got schema in my jsonYou got schema in my json
You got schema in my json
 
What is new in Riak 2.0
What is new in Riak 2.0What is new in Riak 2.0
What is new in Riak 2.0
 
Ember background basics
Ember background basicsEmber background basics
Ember background basics
 
Ember learn from Riak Control
Ember learn from Riak ControlEmber learn from Riak Control
Ember learn from Riak Control
 
Testing tdd dom
Testing tdd domTesting tdd dom
Testing tdd dom
 
Something about node basics
Something about node basicsSomething about node basics
Something about node basics
 
A little more advanced node
A little more advanced nodeA little more advanced node
A little more advanced node
 
Something about node in the realworld
Something about node in the realworldSomething about node in the realworld
Something about node in the realworld
 
Riak Intro at Munich Node.js
Riak Intro at Munich Node.jsRiak Intro at Munich Node.js
Riak Intro at Munich Node.js
 
PUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY RiakPUT Knowledge BUCKET Brain KEY Riak
PUT Knowledge BUCKET Brain KEY Riak
 
Campfire bot lightning talk
Campfire bot lightning talkCampfire bot lightning talk
Campfire bot lightning talk
 
Lighting fast rails with zeus
Lighting fast rails with zeusLighting fast rails with zeus
Lighting fast rails with zeus
 
Network with node
Network with nodeNetwork with node
Network with node
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

JavaScript frontend testing from failure to good to great