1406
Tests are code too (lemmy.world)
submitted 10 months ago by jroid8@lemmy.world to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Alexc@lemmings.world 56 points 10 months ago

This is why you write the test before the code. You write the test to make sure something fails, then you write the code to make it pass. Then you repeat this until all your behaviors are captured in code. It’s called TDD

But, full marks for writing tests in the first place

[-] oce@jlai.lu 73 points 10 months ago

That supposes to have a clear idea of what you're going to code. Otherwise, it's a lot of time wasted to constantly rewrite both the code and tests as you better understand how you're going to solve the task while trying. I guess it works for very narrowed tasks rather than opened problems.

[-] moriquende@lemmy.world 29 points 10 months ago

100%. TDD is just not practicably applicable to a lot of scenarios and I wish evangelists were clearer on that detail.

[-] ChickenLadyLovesLife@lemmy.world 19 points 10 months ago

You could replace "TDD" with pretty much any fixed methodology and be completely accurate.

load more comments (7 replies)
load more comments (7 replies)
this post was submitted on 02 Nov 2023
1406 points (98.5% liked)

Programmer Humor

31990 readers
108 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS