filmov
tv
TDD vs BDD. The giants of test go head-to-head (2)

Показать описание
This time, we'll be focusing on Code Coverage, Maintainability and Portability. And crowning a winner. Will it be TDD or BDD?
= = = = = = = = = = = =
New for 2024: my best-ever training:
"How Your Agile Teams Can Achieve Predictability and Productivity WITHOUT Burnout"
= = = = = = = = = = = =
It's time to bring the TDD vs BDD battle to a bruising conclusion. Which will emerge victorious?
Will Test Driven Development be pinned to ropes? Or will Behavior Driven Development be out for the count?
ROUNDS:
- 2:18 - Round 5: Code Coverage
- 2:54 - Round 6: Maintainability
- 4:07 - Round 7: Portability
PREVIOUS EPISODE:
-------------------
63. TDD vs BDD. The giants of test go head-to-head (2)
# #DevelopmentThatPays
Previously... TDD and BDD went head to head. Round 1 [Focus] was a narrow win for BDD. Round 2 [Writer/Reader] was a decisive win for BDD. But then the tide turned: Round 3 [Speed] went to TDD. And Round 4 [Specificity] went the same way. That's two rounds a piece. But this bout is far from over. Go live ------- Welcome to Development That Pays. I'm Gary Straughan. And welcome back to second and final part of our TDD vs BDD battle. Before we get back to the fight, there's the small matter of the question I left you with last time. Here's a quick reminder: "You're responsible for a major system. It has excellent test coverage, with a full complement of Unit Tests and Behavioural Tests. A major deadline is looming and you're gearing up for the release. Vexingly, there's one failing test. And the Development Team say they won't be able to fix it in time for the planned release Question 1: Do you go ahead and release to live Question 2: Does your answer to question 1 depend on the TYPE of test that is failing." So what do you think. Would you release Alistair, you were clear... "If there is a failing test then the system is not production ready. I would argue that it (almost) never depends." Although you did go on to say that might be mitigating circumstances, such as the value of the new features in the release outweighing negative impact of a bug. Andrew, you were more bullish. And I liked that you expected the Product Owner to be part of the Go / No Go decision My answer Well, I'm not a brave man, so I probably wouldn't... But let's dig just a little bit deeper. If all of the Unit Tests are passing, and one Behavioural Tests is failing This is bad news. A failing Behavioural Test means that the "contract" has been broken. That's a clear DON'T RELEASE situation in my book. The other case - all the Behavioural Tests passing and one Unit Test failing - is more nuanced. If all the behavioural test are passing, then the contract is intact. Everything that the system promises to do, it does. Whatever is failing is having no impact* on the external functionality. One possibility is that application code covered by the failing test doesn't do anything. So the question becomes: "Why NOT go live " Did you spot the asterisks These arguments only hold water ONLY if the level of code coverage is very high. Which brings us right back to our bout. Round 5: Code Coverage. -------- A high level of code coverage is a good thing. The higher the level, the better you sleep at night. But 100% code coverage is rare and difficult - especially where unit tests are concerned. Levels of 70% and 80% would be considered by many to be good. For BDD, the picture is rosier - the code coverage percentages tend to be higher. For a microservice with a well-defined API, there's no reason NOT to have 100% code coverage. Round 6: Maintainability -------- The only constant is change. So a good question to ask is what will cause the tests to change. Any change to the functionality of the code is going to require the unit tests to change. And by the way, if the functionality Is to change, then the tests change first. A change is still development, and the development is still test driven! What about on the BDD side Not all functional changes impact the external behaviour. Going back to the cash machine example for a moment: I could exchange the card transport mechanism for another model. I could exchange the screen for one with better resolution. I could upgrade the keyboard None of these substitutions would require a change to this Behavioural Test. For the sake of fairness, I should say that the the inverse situation is possible: If new and di
= = = = = = = = = = = =
New for 2024: my best-ever training:
"How Your Agile Teams Can Achieve Predictability and Productivity WITHOUT Burnout"
= = = = = = = = = = = =
It's time to bring the TDD vs BDD battle to a bruising conclusion. Which will emerge victorious?
Will Test Driven Development be pinned to ropes? Or will Behavior Driven Development be out for the count?
ROUNDS:
- 2:18 - Round 5: Code Coverage
- 2:54 - Round 6: Maintainability
- 4:07 - Round 7: Portability
PREVIOUS EPISODE:
-------------------
63. TDD vs BDD. The giants of test go head-to-head (2)
# #DevelopmentThatPays
Previously... TDD and BDD went head to head. Round 1 [Focus] was a narrow win for BDD. Round 2 [Writer/Reader] was a decisive win for BDD. But then the tide turned: Round 3 [Speed] went to TDD. And Round 4 [Specificity] went the same way. That's two rounds a piece. But this bout is far from over. Go live ------- Welcome to Development That Pays. I'm Gary Straughan. And welcome back to second and final part of our TDD vs BDD battle. Before we get back to the fight, there's the small matter of the question I left you with last time. Here's a quick reminder: "You're responsible for a major system. It has excellent test coverage, with a full complement of Unit Tests and Behavioural Tests. A major deadline is looming and you're gearing up for the release. Vexingly, there's one failing test. And the Development Team say they won't be able to fix it in time for the planned release Question 1: Do you go ahead and release to live Question 2: Does your answer to question 1 depend on the TYPE of test that is failing." So what do you think. Would you release Alistair, you were clear... "If there is a failing test then the system is not production ready. I would argue that it (almost) never depends." Although you did go on to say that might be mitigating circumstances, such as the value of the new features in the release outweighing negative impact of a bug. Andrew, you were more bullish. And I liked that you expected the Product Owner to be part of the Go / No Go decision My answer Well, I'm not a brave man, so I probably wouldn't... But let's dig just a little bit deeper. If all of the Unit Tests are passing, and one Behavioural Tests is failing This is bad news. A failing Behavioural Test means that the "contract" has been broken. That's a clear DON'T RELEASE situation in my book. The other case - all the Behavioural Tests passing and one Unit Test failing - is more nuanced. If all the behavioural test are passing, then the contract is intact. Everything that the system promises to do, it does. Whatever is failing is having no impact* on the external functionality. One possibility is that application code covered by the failing test doesn't do anything. So the question becomes: "Why NOT go live " Did you spot the asterisks These arguments only hold water ONLY if the level of code coverage is very high. Which brings us right back to our bout. Round 5: Code Coverage. -------- A high level of code coverage is a good thing. The higher the level, the better you sleep at night. But 100% code coverage is rare and difficult - especially where unit tests are concerned. Levels of 70% and 80% would be considered by many to be good. For BDD, the picture is rosier - the code coverage percentages tend to be higher. For a microservice with a well-defined API, there's no reason NOT to have 100% code coverage. Round 6: Maintainability -------- The only constant is change. So a good question to ask is what will cause the tests to change. Any change to the functionality of the code is going to require the unit tests to change. And by the way, if the functionality Is to change, then the tests change first. A change is still development, and the development is still test driven! What about on the BDD side Not all functional changes impact the external behaviour. Going back to the cash machine example for a moment: I could exchange the card transport mechanism for another model. I could exchange the screen for one with better resolution. I could upgrade the keyboard None of these substitutions would require a change to this Behavioural Test. For the sake of fairness, I should say that the the inverse situation is possible: If new and di
Комментарии