SlideShare ist ein Scribd-Unternehmen logo
1 von 22
UNIT TESTING?
 FOR THE REST OF US




                  VLAD ILIESCU
                     MAXCODE
             26 NOVEMBER 2011
INTRO
                 SIMPLE DEMO


      UNIT TESTING?
GUIDELINES
                 ADVANCED DEMO

  JAVASCRIPT
               JAVASCRIPT DEMO
UNIT TESTING?
WHY?
HOW?
NO, REALLY – HOW?
QUESTIONS?
GUIDELINES
A TEST SHOULD BE
            FAST
A TEST SHOULD BE
    INDEPENDENT
A TEST SHOULD BE
        ISOLATED
A TEST SHOULD BE
SELF-DESCRIPTIVE
HOW DO I WRITE
TESTABLE CODE?
QUESTIONS?
WHY
JAVASCRIPT?
BECAUSE OF
SPIDER-MAN
HOW?
NO, REALLY - HOW?
QUESTIONS?
HTTP://MSDN.MICROSOFT.COM/EN-US/LIBRARY/MS243147.ASPX

      HTTP://MSDN.MICROSOFT.COM/EN-US/LIBRARY/MS182530.ASPX

                               HTTP://DOCS.JQUERY.COM/QUNIT

                             HTTPS://GITHUB.COM/JQUERY/QUNIT

      HTTP://MSDN.MICROSOFT.COM/EN-US/SCRIPTJUNKIE/GG749824

                                HTTP://HTML5BOILERPLATE.COM

HTTP://GOOGLETESTING.BLOGSPOT.COM/2008/07/HOW-TO-WRITE-3V1L-
                                     UNTESTABLE-CODE.HTML
COOL KIDS FILL THE
 EVALUATION FORM
THANKS FOR LISTENING!



                   VLAD ILIESCU
                 VLADILIESCU.RO

Weitere ähnliche Inhalte

Was ist angesagt?

Why do we need two eyes? - JsConfEu October 2011
Why do we need two eyes? - JsConfEu October 2011Why do we need two eyes? - JsConfEu October 2011
Why do we need two eyes? - JsConfEu October 2011michalbu
 
Looking for a place to hang my helmet
Looking for a place to hang my helmetLooking for a place to hang my helmet
Looking for a place to hang my helmetBrad Frost
 
A New Hope – the web strikes back
A New Hope – the web strikes backA New Hope – the web strikes back
A New Hope – the web strikes backChristian Heilmann
 
Testing and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsTesting and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsOtto Kekäläinen
 
Banner ads
Banner adsBanner ads
Banner adspeevanee
 
Langkah meletakkan bahan slideshare di widget embed website FROG
Langkah meletakkan bahan slideshare di widget embed website FROGLangkah meletakkan bahan slideshare di widget embed website FROG
Langkah meletakkan bahan slideshare di widget embed website FROGMohd Khairudin Che Ismail
 

Was ist angesagt? (7)

2016 java8-cert-intro
2016 java8-cert-intro2016 java8-cert-intro
2016 java8-cert-intro
 
Why do we need two eyes? - JsConfEu October 2011
Why do we need two eyes? - JsConfEu October 2011Why do we need two eyes? - JsConfEu October 2011
Why do we need two eyes? - JsConfEu October 2011
 
Looking for a place to hang my helmet
Looking for a place to hang my helmetLooking for a place to hang my helmet
Looking for a place to hang my helmet
 
A New Hope – the web strikes back
A New Hope – the web strikes backA New Hope – the web strikes back
A New Hope – the web strikes back
 
Testing and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsTesting and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressions
 
Banner ads
Banner adsBanner ads
Banner ads
 
Langkah meletakkan bahan slideshare di widget embed website FROG
Langkah meletakkan bahan slideshare di widget embed website FROGLangkah meletakkan bahan slideshare di widget embed website FROG
Langkah meletakkan bahan slideshare di widget embed website FROG
 

Andere mochten auch

Ionut hrubaru, bogdan lazarescu sql server high availability
Ionut hrubaru, bogdan lazarescu   sql server high availabilityIonut hrubaru, bogdan lazarescu   sql server high availability
Ionut hrubaru, bogdan lazarescu sql server high availabilityCodecamp Romania
 
Codecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web socketsCodecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web socketsCodecamp Romania
 
Iasi code camp 12 october 2013 shadow dom - mihai bîrsan
Iasi code camp 12 october 2013   shadow dom - mihai bîrsanIasi code camp 12 october 2013   shadow dom - mihai bîrsan
Iasi code camp 12 october 2013 shadow dom - mihai bîrsanCodecamp Romania
 
Sorin Damian - Using and Abusing Dependency Injection Containers
Sorin Damian - Using and Abusing Dependency Injection ContainersSorin Damian - Using and Abusing Dependency Injection Containers
Sorin Damian - Using and Abusing Dependency Injection ContainersCodecamp Romania
 
Iasi code camp 12 october 2013 scrumban - flavia jalaboi-dan nicola
Iasi code camp 12 october 2013   scrumban - flavia jalaboi-dan nicolaIasi code camp 12 october 2013   scrumban - flavia jalaboi-dan nicola
Iasi code camp 12 october 2013 scrumban - flavia jalaboi-dan nicolaCodecamp Romania
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2dCodecamp Romania
 
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messagesSînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messagesCodecamp Romania
 

Andere mochten auch (8)

Ionut hrubaru, bogdan lazarescu sql server high availability
Ionut hrubaru, bogdan lazarescu   sql server high availabilityIonut hrubaru, bogdan lazarescu   sql server high availability
Ionut hrubaru, bogdan lazarescu sql server high availability
 
Codecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web socketsCodecamp iasi-26 nov 2011-web sockets
Codecamp iasi-26 nov 2011-web sockets
 
Scale net apps in aws
Scale net apps in awsScale net apps in aws
Scale net apps in aws
 
Iasi code camp 12 october 2013 shadow dom - mihai bîrsan
Iasi code camp 12 october 2013   shadow dom - mihai bîrsanIasi code camp 12 october 2013   shadow dom - mihai bîrsan
Iasi code camp 12 october 2013 shadow dom - mihai bîrsan
 
Sorin Damian - Using and Abusing Dependency Injection Containers
Sorin Damian - Using and Abusing Dependency Injection ContainersSorin Damian - Using and Abusing Dependency Injection Containers
Sorin Damian - Using and Abusing Dependency Injection Containers
 
Iasi code camp 12 october 2013 scrumban - flavia jalaboi-dan nicola
Iasi code camp 12 october 2013   scrumban - flavia jalaboi-dan nicolaIasi code camp 12 october 2013   scrumban - flavia jalaboi-dan nicola
Iasi code camp 12 october 2013 scrumban - flavia jalaboi-dan nicola
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messagesSînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
 

Ähnlich wie Codecamp iasi-26 nov 2011-unit-testing-for-the-rest-of-us

Helen Zhukova "JS static typing. What and why."
Helen Zhukova "JS static typing. What and why."Helen Zhukova "JS static typing. What and why."
Helen Zhukova "JS static typing. What and why."OdessaJS Conf
 
Designers Make It Go to Eleven!
Designers Make It Go to Eleven!Designers Make It Go to Eleven!
Designers Make It Go to Eleven!Idan Gazit
 
Stripes RJUG March 2012
Stripes RJUG March 2012Stripes RJUG March 2012
Stripes RJUG March 2012timstone
 
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBDavid Wesst
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianRay Ploski
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeKonrad Malawski
 
JavaScript For People Who Don't Code
JavaScript For People Who Don't CodeJavaScript For People Who Don't Code
JavaScript For People Who Don't CodeChristopher Schmitt
 
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...Marco Cedaro
 
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...Marco Cedaro
 
Алексей Демедецкий | Unit testing in swift
Алексей Демедецкий | Unit testing in swiftАлексей Демедецкий | Unit testing in swift
Алексей Демедецкий | Unit testing in swiftFwdays
 
Joys and Pains of Node.js in the Enterprise
Joys and Pains of Node.js in the EnterpriseJoys and Pains of Node.js in the Enterprise
Joys and Pains of Node.js in the EnterpriseMarc Fasel
 
Web Systems Architecture by Moshe Kaplan
Web Systems Architecture by Moshe KaplanWeb Systems Architecture by Moshe Kaplan
Web Systems Architecture by Moshe KaplanMoshe Kaplan
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.John Dalziel
 
Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Fwdays
 
JavaScript Crash Course | Edureka
JavaScript Crash Course | EdurekaJavaScript Crash Course | Edureka
JavaScript Crash Course | EdurekaEdureka!
 
Rubbing the Sankara Stones the wrong way - From the Front 2014
Rubbing the Sankara Stones the wrong way - From the Front 2014Rubbing the Sankara Stones the wrong way - From the Front 2014
Rubbing the Sankara Stones the wrong way - From the Front 2014Christian Heilmann
 

Ähnlich wie Codecamp iasi-26 nov 2011-unit-testing-for-the-rest-of-us (20)

Helen Zhukova "JS static typing. What and why."
Helen Zhukova "JS static typing. What and why."Helen Zhukova "JS static typing. What and why."
Helen Zhukova "JS static typing. What and why."
 
Designers Make It Go to Eleven!
Designers Make It Go to Eleven!Designers Make It Go to Eleven!
Designers Make It Go to Eleven!
 
Stripes RJUG March 2012
Stripes RJUG March 2012Stripes RJUG March 2012
Stripes RJUG March 2012
 
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
 
4-identifying-problems.pdf
4-identifying-problems.pdf4-identifying-problems.pdf
4-identifying-problems.pdf
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to come
 
Api pain points
Api pain pointsApi pain points
Api pain points
 
JavaScript For People Who Don't Code
JavaScript For People Who Don't CodeJavaScript For People Who Don't Code
JavaScript For People Who Don't Code
 
Api pain points
Api pain pointsApi pain points
Api pain points
 
Prototyping: Helping to take away the suck
Prototyping: Helping to take away the suckPrototyping: Helping to take away the suck
Prototyping: Helping to take away the suck
 
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
 
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
 
Алексей Демедецкий | Unit testing in swift
Алексей Демедецкий | Unit testing in swiftАлексей Демедецкий | Unit testing in swift
Алексей Демедецкий | Unit testing in swift
 
Joys and Pains of Node.js in the Enterprise
Joys and Pains of Node.js in the EnterpriseJoys and Pains of Node.js in the Enterprise
Joys and Pains of Node.js in the Enterprise
 
Web Systems Architecture by Moshe Kaplan
Web Systems Architecture by Moshe KaplanWeb Systems Architecture by Moshe Kaplan
Web Systems Architecture by Moshe Kaplan
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.
 
Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"Stefan Judis "Did we(b development) lose the right direction?"
Stefan Judis "Did we(b development) lose the right direction?"
 
JavaScript Crash Course | Edureka
JavaScript Crash Course | EdurekaJavaScript Crash Course | Edureka
JavaScript Crash Course | Edureka
 
Rubbing the Sankara Stones the wrong way - From the Front 2014
Rubbing the Sankara Stones the wrong way - From the Front 2014Rubbing the Sankara Stones the wrong way - From the Front 2014
Rubbing the Sankara Stones the wrong way - From the Front 2014
 

Mehr von Codecamp Romania

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experienceCodecamp Romania
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-packCodecamp Romania
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pegaCodecamp Romania
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseCodecamp Romania
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10 Codecamp Romania
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous deliveryCodecamp Romania
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdomCodecamp Romania
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...Codecamp Romania
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowCodecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing careerCodecamp Romania
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkitCodecamp Romania
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forwardCodecamp Romania
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp Romania
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...Codecamp Romania
 

Mehr von Codecamp Romania (20)

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experience
 
Cloud powered search
Cloud powered searchCloud powered search
Cloud powered search
 
Ccp
CcpCcp
Ccp
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-pack
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pega
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabase
 
Agility and life
Agility and lifeAgility and life
Agility and life
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous delivery
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdom
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflow
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing career
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forward
 
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1Codecamp2015 pimp yourpipeline-saade-jens-1.1
Codecamp2015 pimp yourpipeline-saade-jens-1.1
 
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
Code camp iasi   silviu niculita - machine learning for mere mortals with azu...Code camp iasi   silviu niculita - machine learning for mere mortals with azu...
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
 

Kürzlich hochgeladen

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 2024Rafal Los
 
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...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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 productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Kürzlich hochgeladen (20)

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
 
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...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 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?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Codecamp iasi-26 nov 2011-unit-testing-for-the-rest-of-us

Hinweis der Redaktion

  1. AGENDAIntroducere (why/how)Demo simplu (OPTIONAL)GuidelinesDemo avansat (IOC)Introtestare in JavascriptDemo Javascript
  2. Unit testing-ul se refera la testarea automata (prin cod) a unorbucati de cod.Existamaimultetipuri de teste in afara de unit tests: integration tests (testeazafelul in care lucreazaimpreunamaimulte module ale aplicatiei), performance tests (cat de repederuleazaanumitebucati de cod), load tests (cat de bine functioneazaaplicatiaatuncicandcrestenivelul de incarcare al acesteia). Prin unit test intelegem un test care testeaza o unitate, ceamai mica bucata de funtionalitatepe care o putemtesta. De obiceiastainseamna o clasa - in mod ideal artrebuisaputemsatestamfiecareclasa in mod izolat, fara a ne atinge de dependinteleeiexterne.
  3. Asigura o plasa de siguranta in cazul schimbarilor (detaliat cazul refactoring-ului proposal-urilor).Documenteaza codul - examinand un unit test, putem vedea cum se foloseste codul pe care acesta il testeaza.Design - daca o metoda e greu de testat, poate indica o problema cu design-ul acesteia. Poate metoda incearca sa faca prea mult, poate ar trebui extrase dependintele externe, etc.Cum testele sunt rulate de calculator, ele se executa mult mai repede si pot fi rulate in mod repetat - devine mult mai usor sa prindem erorile introduse.
  4. Setup, Run, AssertUn test consta din acesti 3 pasi. Initial definimpreconditiile (setup), apoirulamcodulpe care vremsailtestam (run), dupa care verificamexactitatearezultatelor (assert).
  5. demo
  6. Un test ar trebui sa ruleze repede pentru ca se va executa de multe ori. daca testele nu sunt rapide, echipa nu o sa le ruleze.
  7. Rezultateleunui test nu artrebuisadepinda de cealteteste s-au rulatinainteaacestuia. Inclusivvariabilelepartajate de maimultetesteartrebuiinitializate de fiecare data, pentru a se evitarezultateneasteptate.
  8. Un test nu artrebuisadepinda de fisiereexterne, baze de date, servere de email, data siora, web service-uri, etc.El artrebuisatestezelogica. Dependinteleexterneartrebuisa fie simulate.Un test poatesatesteze in mod explicit interactiunea cu fisiereexterne, baze de date, servere de email, web service-uri, etc. Dar atuncidevine o altacategorie de test, e integration test.
  9. Numelemetodelortrebuiesadescrieclarce se testeaza.Cand un test pica, trebuiesa fie usor de intelesce nu functioneaza.Casaintelegcetesteaza testAssignMembership1(), testAssignMembership2() artrebuisainspectezcodullor.
  10. In primul rand nu testez tot, doar codul care contine logica si pe care ma astept sa il modific in viitor.Single Responsibility Principle si Dependency Injection O clasaartrebuisafaca un singurlucru. Logicaaditionala o scoatem in afara, in dependinte, pe care le injectam.In felulasta, un test poatetesta un singurlucru, iardependintele pot fi simulate prin mocks si stubs Stubs - clase helper scrise de noi care implementeazainterfetelefolosite de codultestatsi care nu facnimic, Mocks - clase care implementeazainterfetelefolosite de codultestat, dar care continsilogica de testare a comportamentului - ex, de cateori s-a apelat o anumitametoda, ordinealor de apel, etc. Personal, prefer stubs pentrucaaltfeltestelestiupreamultedesprecodultestatsidevinastfelfoarte fragile (la oricemodificare in codultestat, eleriscasa crape).
  11. Folosim din ce in cemaimult javascript in aplicatiilenoastre, siimplementam din ce in cemaimultalogica in el. In plus limbajul nu e precompilat, decinicimacar nu stimsigurca tot codulscrisvaputea fi executat cu succes.Asadar,risculintroducerii de eroricrestedestul de mult. Daca am testamacarzonelemai intensive din punct de vedere al logicii, am reduce o parte din problemeleacestea.
  12. With great power comes great responsibilit
  13. QUnitestelibrariafolosita de proiectul jQuery pentru a isitestacodul. Este unul din celemaipopulare framework-uri de testare javascript. Are un apidestul de simplusiusor de folosit. Nu se integreaza implicit cu aplicatiiconsola, darofera un mod standard de prezentare a rezultatelor.
  14. demo