Comments by "Edward Cullen" (@edwardcullen1739) on "Why Would Anyone Hate TDD? | Prime Reacts" video.
-
9
-
@sqeaky8190 Here's a thought:
If it can (only) "pass" or "fail", it's a test. Otherwise, it's an evaluation.
If it's a test - binary - then computers can do that. If computers can do it, they can probably do it better (cheaper) than a human. If it's cheaper for a computer, then it should be done by a computer.
If your requirements are expressed correctly, they should be translatable to binary checks (does it do this?), which means they are testable. If it's testable, then is should be done by a computer - automated. Cucumber is a means of automating testing to requirements.
Cucumber didn't "co-opt" BDD, it is a necessary and logical conclusion of BDD. If Cucumber is bad, write a better tool, but don't dismiss the technique underlying it.
(I'm on the fence with Cucumber as a tool; haven't spent enough time exploring alternatives)
7
-
6
-
@samjohns8381 Design is not requirements.
Maybe TDD has evolved since Beck wrote his book? 🤔
The origins and evolution of a technique are not the issue at hand, the applicability to now is.
That said, the corpus of software engineering between the late 90s until the mid 2010s was heavily focused on optimising requirements elicitation, as this was seen as the greatest challenge in practical software delivery.
What you are describing is "how do I deal with a customer who doesn't know what they want?" which is both within the requirements elicitation space and Beck's key interests as an author.
I say again: separate the what your code is trying to achieve from how you are going to achieve it. By definition what is a requirement, how is design.
If you have the what, then your tests should remain consistent (you ARE testing at the interface, right???), which means you're then free to change the how any way you want.
API design is basically a solved problem, so major revisions shouldn't be necessary, if you've put the effort in up front. But designing your APIs right means understanding the problem, which implies having clear requirements... Which returns us to the beginning.
6
-
2
-
@samjohns8381 If you know what the code should do, you can describe the test.
If you don't/can't, your requirements are not described sufficiently, so what you're doing is requirements discovery/elaboration.
What and how are totally different things.
You just don't think of it this way, because you were not trained properly (this isn't a slight, just an autistic statement of fact; very few people are taught properly).
I'm not sure Dave says so explicitly, but to me, this is actually the key benefit of BDD/TDD. Done right, you cannot write any code - waste any time - if you don't have your requirement nailed down.
This doesn't mean full waterfall, it means that you understand what you're trying to achieve with the code you're about to write. It should make you also answer difficult questions ahead of time, such as "how do I handle errors", something in my experience, people tend to leave until it's a problem... But when it's a problem...
I'm a fan of "document first", because this makes you think about how people will use the code. Which should help stop you from writing hard to use APIs.
1
-
1
-
1
-
1