Save 37% off PRO during our Black Friday Sale! »

Start TDDing in 5 minutes

Start TDDing in 5 minutes

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!

37fe41bfaedec54a55f9bbbc67e1f006?s=128

Matheus Richard

October 19, 2021
Tweet

Transcript

  1. Start TDDing in 5 minutes

  2. About me Matheus Richard module Matheus def 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
  3. TDD is awesome! 😎

  4. TDD is awesome! But can be scary. 😎 😰

  5. Oh, no! 🐛 You got a bug in production! 🐛

  6. 💸 The famous Billion Dollar Mistake

  7. None
  8. Let’s start with a test It has to reproduce the

    same error we saw earlier
  9. None
  10. We run our test and...

  11. 💥 BOOM!

  12. Now, make it pass!

  13. None
  14. 🤞 We run our test and...

  15. ✔ We’re green!

  16. 🤔 We TDDed, so…?

  17. 🐛 We’ve fixed the bug 💥

  18. 👍 We’ve added a test confirming our fix!

  19. TL;DR 1. 🐛 Identify the bug;

  20. TL;DR 1. 🐛 Identify the bug; 2. ❌ Write a

    test that reproduces the error;
  21. TL;DR 1. 🐛 Identify the bug; 2. ❌ Write a

    test that reproduces the error; 3. ✨ Fix the bug;
  22. TL;DR 1. 🐛 Identify the bug; 2. ❌ Write a

    test that reproduces the error; 3. ✨ Fix the bug; 4. ✔ Watch the test pass.
  23. That’s it! ➜ ~ Question.any? @MatheusRich www.matheusrich.com