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

PDF
Test Driven Development Powered by LEGO
PPTX
PPTX
Unit testing for project managers
PDF
Tdd - Test Driven Development
PPTX
Test Driven Development
PDF
Test Driven Development
ODP
Tdd in php a brief example
PDF
How to quickly add a safety net to a legacy codebase
Test Driven Development Powered by LEGO
Unit testing for project managers
Tdd - Test Driven Development
Test Driven Development
Test Driven Development
Tdd in php a brief example
How to quickly add a safety net to a legacy codebase

What's hot (20)

PPT
Code Quality
PPTX
What Is Cucumber?
PDF
Testing in a continuous delivery world - XP Days Ukraine
PPTX
TDD with RSpec
PDF
Working effectively with legacy code chapter1
PDF
TLC2018 Shyam Sunder: Legoizing Testing
PDF
Why and how to keep your code quality
PDF
TDD for Testers Workshop
PPT
Test Driven Development
PPTX
Nascenia: Road to Software Industry
PPTX
Outside-in Testing in Vue with Cypress
PDF
BDD with the Cucumber
PPTX
Code Quality Assurance
PDF
Introduction to TDD and BDD
PPTX
Acceptance Test Driven Development and Robot Framework
KEY
Javascript Tests with Jasmine for Front-end Devs
PPT
What Software Quality Assurance Means to Me
PDF
TDD and Simple Design Workshop - Session 1 - March 2019
PPTX
Clean code - Getting your R&D on board
PPTX
BDD and Behave
Code Quality
What Is Cucumber?
Testing in a continuous delivery world - XP Days Ukraine
TDD with RSpec
Working effectively with legacy code chapter1
TLC2018 Shyam Sunder: Legoizing Testing
Why and how to keep your code quality
TDD for Testers Workshop
Test Driven Development
Nascenia: Road to Software Industry
Outside-in Testing in Vue with Cypress
BDD with the Cucumber
Code Quality Assurance
Introduction to TDD and BDD
Acceptance Test Driven Development and Robot Framework
Javascript Tests with Jasmine for Front-end Devs
What Software Quality Assurance Means to Me
TDD and Simple Design Workshop - Session 1 - March 2019
Clean code - Getting your R&D on board
BDD and Behave
Ad

Viewers also liked (19)

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

Similar to Understanding Why Testing is Importaint (20)

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

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Current and future trends in Computer Vision.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Geodesy 1.pptx...............................................
PPT
Mechanical Engineering MATERIALS Selection
DOCX
573137875-Attendance-Management-System-original
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Construction Project Organization Group 2.pptx
PDF
PPT on Performance Review to get promotions
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Well-logging-methods_new................
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPT
Project quality management in manufacturing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Current and future trends in Computer Vision.pptx
bas. eng. economics group 4 presentation 1.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Geodesy 1.pptx...............................................
Mechanical Engineering MATERIALS Selection
573137875-Attendance-Management-System-original
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Construction Project Organization Group 2.pptx
PPT on Performance Review to get promotions
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Safety Seminar civil to be ensured for safe working.
Well-logging-methods_new................
UNIT 4 Total Quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Project quality management in manufacturing

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_