SlideShare a Scribd company logo
TDD with Ruby
Ismael G Marín C
@igmarin
Comunidades
• Elixir Bajío (Facebook)
• Bajio on Rails (Facebook)
What is the primary goal of TDD?
• One view is the goal of TDD is
specification and not validation
In other words, it’s one way to think
through your requirements or design
before your write your functional code
(implying that TDD is both an important
agile requirements and agile design
–Ron Jeffries
“the goal of TDD is to
write clean code that
works.”
TDD Cycle
• Add a test
• Run all the test and see if the new test fails
• Write the code
• Run test
• Refactor code
• Repeat
Write a
failing test
Make the
test pass
Refactor
red - green - refactor
TDD with Ruby
Two levels of TDD
• Acceptance TDD (ATDD). With ATDD you write a single
acceptance test, or behavioral specification depending on
your preferred terminology, and then just enough production
functionality/code to fulfill that test.
• Developer TDD. With developer TDD you write a single
developer test, sometimes inaccurately referred to as a unit
test, and then just enough production code to fulfill that test.
TDD with Ruby
TDD with Ruby

More Related Content

PDF
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
PDF
Pragmatic Introduction to PHP Unit Testing (2015)
PPTX
PDF
Test-Driven Development Reference Card
PPTX
Tdd and bdd
PPT
Code review
PDF
TDD and Getting Paid
PDF
Designing Test Cases for the Gilded Rose Kata v2 (2015)
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
Pragmatic Introduction to PHP Unit Testing (2015)
Test-Driven Development Reference Card
Tdd and bdd
Code review
TDD and Getting Paid
Designing Test Cases for the Gilded Rose Kata v2 (2015)

What's hot (20)

PPTX
Test Driven Development
PDF
Introduction to TDD (Test Driven development) - Ahmed Shreef
PDF
Agile Programming Systems # TDD intro
PDF
Code Review
PDF
TDD vs. ATDD - What, Why, Which, When & Where
PDF
Test Driven Development Powered by LEGO
PDF
Deliberate Practice, New Learning Styles (2015)
ODP
Beyond Unit Testing
PPTX
Agile and ATDD the perfect couple
PPT
Test Driven Development Part 1
PPTX
Pair programming and introduction to TDD
ODP
Documenting Code - Patterns and Anti-patterns - NLPW 2016
PPTX
Git branching policy and review comment's prefix
ODP
Documenting code yapceu2016
PPT
TDD (Test Driven Design)
KEY
TDD refresher
PPTX
Behaviour Driven Development with SpecFlow
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
PDF
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
PDF
Writing Tests with the Unity Test Framework
Test Driven Development
Introduction to TDD (Test Driven development) - Ahmed Shreef
Agile Programming Systems # TDD intro
Code Review
TDD vs. ATDD - What, Why, Which, When & Where
Test Driven Development Powered by LEGO
Deliberate Practice, New Learning Styles (2015)
Beyond Unit Testing
Agile and ATDD the perfect couple
Test Driven Development Part 1
Pair programming and introduction to TDD
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Git branching policy and review comment's prefix
Documenting code yapceu2016
TDD (Test Driven Design)
TDD refresher
Behaviour Driven Development with SpecFlow
Test Driven Development (TDD) Preso 360|Flex 2010
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Writing Tests with the Unity Test Framework
Ad

Similar to TDD with Ruby (20)

PDF
Inside Behavior Driven Development
PPTX
Android tdd
PDF
Tdd red-green-refactor
PPTX
{10.0} Test Driven Development.pptx
PDF
Tdd practices
PPT
Test Driven Development
PDF
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
KEY
Javascript Tests with Jasmine for Front-end Devs
PPTX
Test Driven Development with Laravel
PDF
Spec(ing) Out Your Workflow with SpecFlow
DOCX
Tdd blog
PDF
Test Driven Development
PDF
TDD CrashCourse Part2: TDD
PDF
Don't let your tests slow you down
PPTX
TDD in Agile
PDF
Kata Your Way to SW Craftsmanship
PDF
Test first!
PDF
Test-driven development with Node.js
PPTX
Acceptance Test Driven Development and Robot Framework
PPTX
Test Driven Development
Inside Behavior Driven Development
Android tdd
Tdd red-green-refactor
{10.0} Test Driven Development.pptx
Tdd practices
Test Driven Development
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Javascript Tests with Jasmine for Front-end Devs
Test Driven Development with Laravel
Spec(ing) Out Your Workflow with SpecFlow
Tdd blog
Test Driven Development
TDD CrashCourse Part2: TDD
Don't let your tests slow you down
TDD in Agile
Kata Your Way to SW Craftsmanship
Test first!
Test-driven development with Node.js
Acceptance Test Driven Development and Robot Framework
Test Driven Development
Ad

More from Ismael G Marín C (7)

PDF
PDF
Rails Engine Español
PDF
Panel Magmaconf
PDF
Rails engines
PDF
Bootcamp Irapuato Welcome
PDF
Rubymotion primeros pasos
KEY
Presentacion minitest
Rails Engine Español
Panel Magmaconf
Rails engines
Bootcamp Irapuato Welcome
Rubymotion primeros pasos
Presentacion minitest

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
composite construction of structures.pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
DOCX
573137875-Attendance-Management-System-original
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Lecture Notes Electrical Wiring System Components
PDF
PPT on Performance Review to get promotions
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Construction Project Organization Group 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
composite construction of structures.pdf
Mechanical Engineering MATERIALS Selection
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
573137875-Attendance-Management-System-original
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
CH1 Production IntroductoryConcepts.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
R24 SURVEYING LAB MANUAL for civil enggi
Lecture Notes Electrical Wiring System Components
PPT on Performance Review to get promotions
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
additive manufacturing of ss316l using mig welding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
OOP with Java - Java Introduction (Basics)
Construction Project Organization Group 2.pptx

TDD with Ruby

  • 1. TDD with Ruby Ismael G Marín C @igmarin
  • 2. Comunidades • Elixir Bajío (Facebook) • Bajio on Rails (Facebook)
  • 3. What is the primary goal of TDD? • One view is the goal of TDD is specification and not validation In other words, it’s one way to think through your requirements or design before your write your functional code (implying that TDD is both an important agile requirements and agile design
  • 4. –Ron Jeffries “the goal of TDD is to write clean code that works.”
  • 5. TDD Cycle • Add a test • Run all the test and see if the new test fails • Write the code • Run test • Refactor code • Repeat
  • 6. Write a failing test Make the test pass Refactor red - green - refactor
  • 8. Two levels of TDD • Acceptance TDD (ATDD). With ATDD you write a single acceptance test, or behavioral specification depending on your preferred terminology, and then just enough production functionality/code to fulfill that test. • Developer TDD. With developer TDD you write a single developer test, sometimes inaccurately referred to as a unit test, and then just enough production code to fulfill that test.