TDD is awesome, but can be scary. Learn how to start practicing it in 5 minutes by fixing bugs, so we can kill two birds with one stone!
Start TDDing in5 minutes
View Slide
About meMatheus Richardmodule Matheusdef self.working_at() ="thoughtbot - Software Engineer"def self.blogging_at() ="https://matheusrich.com"def self.github_profile() ="@MatheusRich"def self.twitter() ="@MatheusRich"def self.other_hobbies() =%w[Gaming Playing\ guitar Skating]def self.studying() =%w[Crystal Rust]end
TDD is awesome!😎
TDD is awesome!But can be scary.😎😰
Oh, no!🐛 You got a bug in production!🐛
💸 The famous Billion Dollar Mistake
Let’s start with a testIt has to reproduce the same error we sawearlier
We run our test and...
💥 BOOM!
Now, make it pass!
🤞 We run our test and...
✔ We’re green!
🤔 We TDDed, so…?
🐛We’ve fixed the bug💥
👍 We’ve added a testconfirming our fix!
TL;DR1. 🐛 Identify the bug;
TL;DR1. 🐛 Identify the bug;2. ❌ Write a test that reproduces the error;
TL;DR1. 🐛 Identify the bug;2. ❌ Write a test that reproduces the error;3. ✨ Fix the bug;
TL;DR1. 🐛 Identify the bug;2. ❌ Write a test that reproduces the error;3. ✨ Fix the bug;4. ✔ Watch the test pass.
That’s it!➜ ~ Question.any?@MatheusRich www.matheusrich.com