DEV Community

Cover image for You don't know TDD... yet
Willian Corrêa
Willian Corrêa

Posted on

You don't know TDD... yet

Test-driven development (TDD) has been a cornerstone of software engineering for years, yet its core principles are often misunderstood or misapplied. This article aims to shed light on these overlooked aspects, elevating your understanding of TDD regardless of your experience level. While the title may come across as provocative, it’s inspired by Kyle Simpson’s seminal book series, ‘You Don’t Know JS Yet.’ The goal here is not to question your expertise, but to challenge conventional wisdom and enrich your perspective on TDD.

As a Software Engineer and Consultant with 23+ years of experience, I’ve been fortunate to guide engineering teams toward high performance. One commonality I’ve noticed is how TDD is frequently both praised and criticized, sometimes for the wrong reasons. The discourse tends to focus on surface-level practices, leaving the deeper, more meaningful aspects of TDD unexplored. This article won’t serve as an introductory guide to TDD or delve into its origins. Instead, it aims to expose and clarify the misconceptions and lesser-known facets that could make or break your experience with TDD.

By examining these misconceptions and the rationale behind them, this piece will help you avoid pitfalls that even seasoned engineers sometimes fall into. We’ll go beyond the basic “red-green-refactor” cycle and discuss what often gets overlooked: the discipline, the commitment, and the philosophical underpinnings that make TDD a compelling practice for teams striving for excellence. Whether you’re a beginner seeking clarity or an expert looking to refine your understanding, this article will offer valuable insights to enhance your TDD practice.

Common Misconceptions about TDD

Before diving into the nitty-gritty, it’s important to clarify that misconceptions about TDD are not exclusive to newcomers. Even seasoned professionals can fall into certain traps. The following list identifies some of the most prevalent misunderstandings that I’ve observed across a range of engineering teams.

  • Over indexing on Writing Tests First
  • Not having a test list to determine what tests to write, ordered by simplicity
  • Using versioning (git) against the principles of working software
  • Not knowing when to stop
  • Thinking Test Driven Development is about quality when in fact it’s about design
  • Believing TDD is for backend only and does not apply to frontend

By examining and addressing these common misconceptions, we can develop a more informed and effective approach to TDD. Knowledge is power, and understanding where you might go astray can help you fully harness the benefits of this methodology.

Full article: https://medium.com/@wgcorrea/you-dont-know-test-driven-development-yet-e0787273db6c

Top comments (0)