SlideShare a Scribd company logo
1 of 43
Download to read offline
Productive JavaScript workflow




         Krzysztof Szafranek
Happy beginnings
Happy beginnings
11 years later...
2 years
> 80 000 lines of JavaScript
4 major redesigns
15 front-end developers
Do you test every change in each browser?
          Before each commit?




       ×                        ×
Are you sure you didn’t break
any page in the application?
Do you know if you didn’t
break somebody else’s code?
You don’t know
How to stay sane while
working on a large JS project?




          Krzysztof Szafranek
Part I

e basics
jslint will hurt your feelings
                       Early
Unit testing
“But we don’t have time to
       write tests!”
“My manager didn’t want unit
          tests”
How do you know your code
works, when you don’t have a
         test for it?
How do you know your code
still works aer each commit,
when you don’t have a test for
              it?
You don’t know
Added bonus:

Refactorings are a breeze
Refactoring
without tests
Which framework?
DOH           Jasmine       RhinoUnit
JSUnit        screw-unit    JasUnit
QUnit         Test.Simple   FireUnit
Crosscheck    Test.More     Js-test-driver
J3Unit        TestCase      Sinon.js
JSNUnit       TestIt        SOAtest
YUITest       jsUnitTest    Vows
JSSpec        JSTest        Nodeunit
UnitTesting   JSTest.NET    Tyrtle
JSpec         jsUnity
Doesn’t matter
 (As long as you use it)
(And is easy to automate)
JS Test Driver
How about testing layouts?
Part II

Putting it all together
Running tests in every
 browser takes time

People make mistakes
Automation to the rescue!
Continuous Integration is a soware development practice
where members of a team integrate their work frequently . . .
leading to multiple integrations per day. Each integration is
verified by an automated build (including test) to detect
integration errors as quickly as possible.


Martin Fowler
CI for front-end
          push



jslint              deploy




           tests
Early bug detection
Early fixes
No more FTP uploads
Application is always shippable
Warning!
Part III

Humans are useful, too
Pair programming
Best debugging tool ever
Code reviews
.. soware testing alone has limited effectiveness – the average
defect detection rate is only 25 percent for unit testing, 35
percent for function testing, and 45 percent for integration
testing. In contrast, the average effectiveness of design and
code inspections are 55 and 60 percent.


Steve McConnell
Code Complete
A little help from the process

  Not     Checked    Code    Design    QA
Started     Out     Review   Review   Review

                    Are
                    there
                    unit
                    tests?
Before we part
1. Use jslint and unit tests to get feedback early

2. Use CI to have shippable soware all the time

3. Don’t be afraid of your peers (and ducks)
Links

http://www.jslint.com/
http://code.google.com/p/js-test-driver/
http://jenkins-ci.org/
http://sinonjs.org/
krzysztof@szafranek.net


                 Photo credits:

 SpoiltCat, RemixDave, activeside, kate.gardiner, Jiheffe

More Related Content

What's hot

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
 
Software engineering
Software engineeringSoftware engineering
Software engineering
bartlowe
 
Using Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health NewUsing Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health New
bartlowe
 

What's hot (20)

Winning the battle against Automated testing
Winning the battle against Automated testingWinning the battle against Automated testing
Winning the battle against Automated testing
 
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
 
Continuous delivery
Continuous deliveryContinuous delivery
Continuous delivery
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Using Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health NewUsing Continuous Integration To Ensure Project Health New
Using Continuous Integration To Ensure Project Health New
 
My journey as a developer
My journey as a developerMy journey as a developer
My journey as a developer
 
Putting the pro in programmer
Putting the pro in programmerPutting the pro in programmer
Putting the pro in programmer
 
Move test planning before implementation
Move test planning before implementationMove test planning before implementation
Move test planning before implementation
 
Static analysis is most efficient when being used regularly. We'll tell you w...
Static analysis is most efficient when being used regularly. We'll tell you w...Static analysis is most efficient when being used regularly. We'll tell you w...
Static analysis is most efficient when being used regularly. We'll tell you w...
 
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
 
Jeremias Rößler
Jeremias RößlerJeremias Rößler
Jeremias Rößler
 
7 testing principles
7 testing principles7 testing principles
7 testing principles
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
 
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
 
Shifted development cycle
Shifted development cycleShifted development cycle
Shifted development cycle
 
Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...
 
Continuous Integration for Beginners
Continuous Integration for BeginnersContinuous Integration for Beginners
Continuous Integration for Beginners
 
Justin Ison
Justin IsonJustin Ison
Justin Ison
 
Adventures in continuous delivery
Adventures in continuous deliveryAdventures in continuous delivery
Adventures in continuous delivery
 
PSPDFKit on Android
PSPDFKit on AndroidPSPDFKit on Android
PSPDFKit on Android
 

Similar to Productive JavaScript Workflow

Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
BestBrains
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
Nelson Melina
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Anna Russo
 

Similar to Productive JavaScript Workflow (20)

TDD Workshop UTN 2012
TDD Workshop UTN 2012TDD Workshop UTN 2012
TDD Workshop UTN 2012
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016
 
Unit Testing & Test Driven Development
Unit Testing & Test Driven DevelopmentUnit Testing & Test Driven Development
Unit Testing & Test Driven Development
 
Why test with flex unit
Why test with flex unitWhy test with flex unit
Why test with flex unit
 
Tdd - introduction
Tdd - introductionTdd - introduction
Tdd - introduction
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
 
Continuous integration (eng)
Continuous integration (eng)Continuous integration (eng)
Continuous integration (eng)
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
TDD super mondays-june-2014
TDD super mondays-june-2014TDD super mondays-june-2014
TDD super mondays-june-2014
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
 
Ui qa tools
Ui qa toolsUi qa tools
Ui qa tools
 
Put "fast" back in "fast feedback"
Put "fast" back in "fast feedback"Put "fast" back in "fast feedback"
Put "fast" back in "fast feedback"
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for DistroDevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
 

More from Krzysztof Szafranek

More from Krzysztof Szafranek (10)

Mobile Game Development
Mobile Game DevelopmentMobile Game Development
Mobile Game Development
 
ESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. NowESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. Now
 
Getting the Most out of Your Tools
Getting the Most out of Your ToolsGetting the Most out of Your Tools
Getting the Most out of Your Tools
 
What Lies Ahead for HTML5
What Lies Ahead for HTML5What Lies Ahead for HTML5
What Lies Ahead for HTML5
 
Confessions of the Traitor: How Objective C Made Me a Better JavaScript Progr...
Confessions of the Traitor: How Objective C Made Me a Better JavaScript Progr...Confessions of the Traitor: How Objective C Made Me a Better JavaScript Progr...
Confessions of the Traitor: How Objective C Made Me a Better JavaScript Progr...
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Practical Guide to Unit Testing
Practical Guide to Unit TestingPractical Guide to Unit Testing
Practical Guide to Unit Testing
 
Box2Dweb
Box2DwebBox2Dweb
Box2Dweb
 
Radiant CMS - smart simplicity
Radiant CMS - smart simplicityRadiant CMS - smart simplicity
Radiant CMS - smart simplicity
 
Ruby, Amazon Web Services and You
Ruby, Amazon Web Services and YouRuby, Amazon Web Services and You
Ruby, Amazon Web Services and You
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Productive JavaScript Workflow