Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-first programming is not TDD #1011

Open
chillenzer opened this issue Sep 15, 2022 · 0 comments
Open

Test-first programming is not TDD #1011

chillenzer opened this issue Sep 15, 2022 · 0 comments

Comments

@chillenzer
Copy link

Hi everybody,

I was just reading through Episode 10 and I think that it is really great that "Defensive Programming" and the idea of "Test-first Programming" are taught as one of the first things to new programmers. I also think that the content of the lesson is very much appropriate for the novice programmer targeted.

What I wanted to point out here is about terminology, concretely that what is described under "Test-driven Development" is NOT TDD. While TDD happens to also have a (single!) test before the first functional code, TDD is very much about the incremental design of the unit under testing and heavily relies on the Test-driven development cycle with refactoring on the go as a fundamental principle. It is quite the opposite of (citing the current lesson material here)

  1. Write a short function for each test.
  2. Write a range_overlap function that should pass those tests.
  3. ...

because you should never attempt to "write [...] each test" before writing any functionality itself (when practising TDD). Instead you would ideally write the simplest possible (failing) test, the simplest code to make it pass and then refactor (and that over and over again).

Again, I think that the content is fine. So, I propose to just replace all appearances of "TDD" with something like "Test-first programming" (and then polish it off again to sound nice with the new wording, of course). I will happily provide more concrete suggestions or a pull request for this transformation, if you agree. Alternatively, I could also write something up about actual TDD but from my perspective that is beyond the scope of the material.

Best,
Julian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant