SlideShare a Scribd company logo
How Important is
Testing.
How Testing makes writing code even more easier!
Understanding BDD and TDD
• Test Driven Development in simple form is :
Write your tests.
Watch them fail.
Make them pass.
Refactor.
Repeat.
BDD – Behavior Driven
Development
• BDD – Behavior Driven Development on the other hand is a
little more complex. It is more of a team work.
• It is more of how a desired behavior should be specified.
• In this concept, Business Analysts and Developers should
specify behaviors in terms of “User Stories”.
• Involving the stake holders in the implementation process
through outside-in Software Development.
• Now we have our own “Jasmine” which helps us test our
JavaScript code in a more TDD way of style.
• For more information on BDD learn here (Wiki is the
best!)http://en.wikipedia.org/wiki/Behavior-
driven_development
Real Code! Wohoo….
• If you're all into Rspec, you’ll see Jasmine Framework very
similar.
describe('JavaScript addition operator', function () {
it('adds two numbers together', function () { expect(1 +
2).toEqual(3);
}); });
• “Describe” and “it” functions – Take two parameters a string
and a function.
• Inside “it” block – Write setup code you need for your test.
• Ready to write the actual test – Start with the “expect”
function.
Setting up Jasmine
So why the Test??
• Unit tests and test-driven development (TDD) have so many
hidden and personal benefits as well as the obvious ones, you
just can't really explain to somebody until they're doing it
themselves.
• Unit tests allows you to make big changes to code quickly.
• You know it works now for sure (because you’ve run the
tests!)
• When you follow TDD no code is considered as
bad/buggy/annoying.
• Unit test helps you to understand the design of the code that
you’re working on.
• “One test is worth a thousand expert opinions”. Imagine you
writing the test and saying with confidence (that damn thing
works!)
• Good unit tests can help document and define what
something is supposed to do
• Unit tests help with code re-use. Migrate both your
code and your tests to your new project. Tweak the code till
the tests run again.
• Writing unit tests can consume a lot of time in the beginning
but it’s so much worth it.
Sold!
You know it’s good for you, then why not start testing your code.
• Good unit tests can help document and define what
something is supposed to do
• Unit tests help with code re-use. Migrate both your
code and your tests to your new project. Tweak the code till
the tests run again.
• Writing unit tests can consume a lot of time in the beginning
but it’s so much worth it.
Sold!
You know it’s good for you, then why not start testing your code.
Resources!
• BDD Wiki
• TDD Wiki
• https://github.com/jasmine/jasmine/wiki
• Rspec Rails
• http://agiledata.org/essays/tdd.html
• http://c2.com/cgi/wiki?TestDrivenDevelopment
Books:
• http://www.amazon.com/Test-Driven-Development-By-
Example/dp/0321146530
• http://www.amazon.com/dp/0596006896/?tag=stackoverfl08
-20
• http://www.growing-object-oriented-software.com/
Have fun testing! 
Follow me on Twitter: @SanaNasar_

More Related Content

What's hot

Code Quality
Code QualityCode Quality
Code Quality
François Camus
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
QATestLab
 
Testing in a continuous delivery world - XP Days Ukraine
Testing in a continuous delivery world  - XP Days UkraineTesting in a continuous delivery world  - XP Days Ukraine
Testing in a continuous delivery world - XP Days Ukraine
Wouter Lagerweij
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
Rachid Calazans
 
Working effectively with legacy code chapter1
Working effectively with legacy code chapter1Working effectively with legacy code chapter1
Working effectively with legacy code chapter1Hiroaki NAKADA
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing Testing
Anna Royzman
 
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
Krešimir Antolić
 
TDD for Testers Workshop
TDD for Testers WorkshopTDD for Testers Workshop
TDD for Testers Workshop
Sarah Usher
 
Nascenia: Road to Software Industry
Nascenia: Road to Software IndustryNascenia: Road to Software Industry
Nascenia: Road to Software Industry
Nascenia IT
 
Outside-in Testing in Vue with Cypress
Outside-in Testing in Vue with CypressOutside-in Testing in Vue with Cypress
Outside-in Testing in Vue with Cypress
Josh Justice
 
BDD with the Cucumber
BDD with the CucumberBDD with the Cucumber
BDD with the Cucumber
Mücahit Kurt
 
Code Quality Assurance
Code Quality AssuranceCode Quality Assurance
Code Quality Assurance
Bart Blommaerts
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
Luis García Castro
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
Steve Zhang
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 
What Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeWhat Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeRobert Stackhouse
 
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
Paulo Clavijo
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
Ruth Sperer
 
BDD and Behave
BDD and BehaveBDD and Behave
BDD and Behave
Adam Englander
 

What's hot (20)

Code Quality
Code QualityCode Quality
Code Quality
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 
Testing in a continuous delivery world - XP Days Ukraine
Testing in a continuous delivery world  - XP Days UkraineTesting in a continuous delivery world  - XP Days Ukraine
Testing in a continuous delivery world - XP Days Ukraine
 
TDD with RSpec
TDD with RSpecTDD with RSpec
TDD with RSpec
 
Working effectively with legacy code chapter1
Working effectively with legacy code chapter1Working effectively with legacy code chapter1
Working effectively with legacy code chapter1
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing Testing
 
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
 
TDD for Testers Workshop
TDD for Testers WorkshopTDD for Testers Workshop
TDD for Testers Workshop
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Nascenia: Road to Software Industry
Nascenia: Road to Software IndustryNascenia: Road to Software Industry
Nascenia: Road to Software Industry
 
Outside-in Testing in Vue with Cypress
Outside-in Testing in Vue with CypressOutside-in Testing in Vue with Cypress
Outside-in Testing in Vue with Cypress
 
BDD with the Cucumber
BDD with the CucumberBDD with the Cucumber
BDD with the Cucumber
 
Code Quality Assurance
Code Quality AssuranceCode Quality Assurance
Code Quality Assurance
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
 
What Software Quality Assurance Means to Me
What Software Quality Assurance Means to MeWhat Software Quality Assurance Means to Me
What Software Quality Assurance Means to Me
 
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
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
 
BDD and Behave
BDD and BehaveBDD and Behave
BDD and Behave
 

Viewers also liked

Male Dream Codec Illustration
Male Dream Codec IllustrationMale Dream Codec Illustration
Male Dream Codec Illustration
Eli Bishop
 
4345 libro-derecho-probatorio-4
4345 libro-derecho-probatorio-44345 libro-derecho-probatorio-4
4345 libro-derecho-probatorio-4
Alejandra Herrera
 
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
Van Der Häägen Brazil
 
BRQ Framework 5-8-13 FINAL (1)
BRQ Framework 5-8-13  FINAL (1)BRQ Framework 5-8-13  FINAL (1)
BRQ Framework 5-8-13 FINAL (1)Kyle D. Gearhart
 
Analisis estadístico de los accidentes y enfermedades ocupacionales
Analisis estadístico de los accidentes y enfermedades ocupacionalesAnalisis estadístico de los accidentes y enfermedades ocupacionales
Analisis estadístico de los accidentes y enfermedades ocupacionales
Jenni1117
 
2016輕鬆開發自有網路地圖工作坊 進階班 0701
2016輕鬆開發自有網路地圖工作坊 進階班 07012016輕鬆開發自有網路地圖工作坊 進階班 0701
2016輕鬆開發自有網路地圖工作坊 進階班 0701
family
 
Liderazgo etico
Liderazgo eticoLiderazgo etico
Liderazgo etico
faustinopadron19
 
Novo simulado 2
Novo simulado 2Novo simulado 2
Novo simulado 2
Aires Jones
 
International Journal of Agriculture
International Journal of AgricultureInternational Journal of Agriculture
Why Are Less Women in Computer Science - Data Science Project
Why Are Less Women in Computer Science - Data Science ProjectWhy Are Less Women in Computer Science - Data Science Project
Why Are Less Women in Computer Science - Data Science Project
Sana Nasar
 
Estudo do texto. Interpretação e compreensão de texto.
Estudo do texto. Interpretação e compreensão de texto.Estudo do texto. Interpretação e compreensão de texto.
Estudo do texto. Interpretação e compreensão de texto.
Aires Jones
 
Exercícios sobre espécies e gêneros literários
Exercícios sobre espécies e gêneros literáriosExercícios sobre espécies e gêneros literários
Exercícios sobre espécies e gêneros literáriosma.no.el.ne.ves
 
Liderazgo Etico
Liderazgo EticoLiderazgo Etico
Liderazgo EticoJavier Lau
 
Estrutura de palavras
Estrutura de palavrasEstrutura de palavras
Estrutura de palavras
Walace Cestari
 

Viewers also liked (19)

Rpp bahasa indonesiaberkaraktersmpkelasixsms1bagus
Rpp bahasa indonesiaberkaraktersmpkelasixsms1bagusRpp bahasa indonesiaberkaraktersmpkelasixsms1bagus
Rpp bahasa indonesiaberkaraktersmpkelasixsms1bagus
 
Magazines
MagazinesMagazines
Magazines
 
Louis Armstrong
Louis ArmstrongLouis Armstrong
Louis Armstrong
 
Male Dream Codec Illustration
Male Dream Codec IllustrationMale Dream Codec Illustration
Male Dream Codec Illustration
 
4345 libro-derecho-probatorio-4
4345 libro-derecho-probatorio-44345 libro-derecho-probatorio-4
4345 libro-derecho-probatorio-4
 
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
Estatura baixa; reverter crescendo estatural, fatores genéticos de cresciment...
 
BRQ Framework 5-8-13 FINAL (1)
BRQ Framework 5-8-13  FINAL (1)BRQ Framework 5-8-13  FINAL (1)
BRQ Framework 5-8-13 FINAL (1)
 
Scoreboard Projects
Scoreboard ProjectsScoreboard Projects
Scoreboard Projects
 
Analisis estadístico de los accidentes y enfermedades ocupacionales
Analisis estadístico de los accidentes y enfermedades ocupacionalesAnalisis estadístico de los accidentes y enfermedades ocupacionales
Analisis estadístico de los accidentes y enfermedades ocupacionales
 
.
..
.
 
2016輕鬆開發自有網路地圖工作坊 進階班 0701
2016輕鬆開發自有網路地圖工作坊 進階班 07012016輕鬆開發自有網路地圖工作坊 進階班 0701
2016輕鬆開發自有網路地圖工作坊 進階班 0701
 
Liderazgo etico
Liderazgo eticoLiderazgo etico
Liderazgo etico
 
Novo simulado 2
Novo simulado 2Novo simulado 2
Novo simulado 2
 
International Journal of Agriculture
International Journal of AgricultureInternational Journal of Agriculture
International Journal of Agriculture
 
Why Are Less Women in Computer Science - Data Science Project
Why Are Less Women in Computer Science - Data Science ProjectWhy Are Less Women in Computer Science - Data Science Project
Why Are Less Women in Computer Science - Data Science Project
 
Estudo do texto. Interpretação e compreensão de texto.
Estudo do texto. Interpretação e compreensão de texto.Estudo do texto. Interpretação e compreensão de texto.
Estudo do texto. Interpretação e compreensão de texto.
 
Exercícios sobre espécies e gêneros literários
Exercícios sobre espécies e gêneros literáriosExercícios sobre espécies e gêneros literários
Exercícios sobre espécies e gêneros literários
 
Liderazgo Etico
Liderazgo EticoLiderazgo Etico
Liderazgo Etico
 
Estrutura de palavras
Estrutura de palavrasEstrutura de palavras
Estrutura de palavras
 

Similar to Understanding Why Testing is Importaint

Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Jason Tice
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
MohamedSubhiBouchi
 
TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)
Nacho Cougil
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
Atish Narlawar
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
Nacho Cougil
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
Danny Preussler
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference CardSeapine Software
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
temebele
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
AmalEldhose2
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
Nacho Cougil
 
Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD
Gervais Johnson, Advisor
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
satejsahu
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
Pablo Villar
 
TDD and BDD in Sky Deutschland
TDD and BDD in Sky DeutschlandTDD and BDD in Sky Deutschland
TDD and BDD in Sky Deutschland
Murphy Meng
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
Xebia India
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
Mike Harris
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech Week
Nacho Cougil
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
ssusercaf6c1
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
Nacho Cougil
 

Similar to Understanding Why Testing is Importaint (20)

Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)TDD - Seriously, try it - Codemotion (May '24)
TDD - Seriously, try it - Codemotion (May '24)
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference Card
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 
TDD and BDD in Sky Deutschland
TDD and BDD in Sky DeutschlandTDD and BDD in Sky Deutschland
TDD and BDD in Sky Deutschland
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech Week
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
 

Recently uploaded

CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 

Recently uploaded (20)

CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 

Understanding Why Testing is Importaint

  • 1. How Important is Testing. How Testing makes writing code even more easier!
  • 2. Understanding BDD and TDD • Test Driven Development in simple form is : Write your tests. Watch them fail. Make them pass. Refactor. Repeat.
  • 3. BDD – Behavior Driven Development • BDD – Behavior Driven Development on the other hand is a little more complex. It is more of a team work. • It is more of how a desired behavior should be specified. • In this concept, Business Analysts and Developers should specify behaviors in terms of “User Stories”. • Involving the stake holders in the implementation process through outside-in Software Development. • Now we have our own “Jasmine” which helps us test our JavaScript code in a more TDD way of style. • For more information on BDD learn here (Wiki is the best!)http://en.wikipedia.org/wiki/Behavior- driven_development
  • 4. Real Code! Wohoo…. • If you're all into Rspec, you’ll see Jasmine Framework very similar. describe('JavaScript addition operator', function () { it('adds two numbers together', function () { expect(1 + 2).toEqual(3); }); }); • “Describe” and “it” functions – Take two parameters a string and a function. • Inside “it” block – Write setup code you need for your test. • Ready to write the actual test – Start with the “expect” function.
  • 6. So why the Test?? • Unit tests and test-driven development (TDD) have so many hidden and personal benefits as well as the obvious ones, you just can't really explain to somebody until they're doing it themselves. • Unit tests allows you to make big changes to code quickly. • You know it works now for sure (because you’ve run the tests!) • When you follow TDD no code is considered as bad/buggy/annoying. • Unit test helps you to understand the design of the code that you’re working on.
  • 7. • “One test is worth a thousand expert opinions”. Imagine you writing the test and saying with confidence (that damn thing works!)
  • 8. • Good unit tests can help document and define what something is supposed to do • Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. • Writing unit tests can consume a lot of time in the beginning but it’s so much worth it. Sold! You know it’s good for you, then why not start testing your code.
  • 9. • Good unit tests can help document and define what something is supposed to do • Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. • Writing unit tests can consume a lot of time in the beginning but it’s so much worth it. Sold! You know it’s good for you, then why not start testing your code.
  • 10. Resources! • BDD Wiki • TDD Wiki • https://github.com/jasmine/jasmine/wiki • Rspec Rails • http://agiledata.org/essays/tdd.html • http://c2.com/cgi/wiki?TestDrivenDevelopment Books: • http://www.amazon.com/Test-Driven-Development-By- Example/dp/0321146530 • http://www.amazon.com/dp/0596006896/?tag=stackoverfl08 -20 • http://www.growing-object-oriented-software.com/
  • 11. Have fun testing!  Follow me on Twitter: @SanaNasar_