"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Tim Driven Development | Test until the fear goes away
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Kent Beck wrote:Test-driven development is a set of techniques that any software engineer can follow, which encourages simple designs and test suites that inspire confidence. If you are a genius, you don't need these rules. If you are a dolt, the rules won't help. For the vast majority of us in between, following these two simple rules can lead us to work much more closely to our potential.
· Write a failing automated test before you write any code.
· Remove duplication.
How exactly to do this, the subtle gradations in applying these rules, and the lengths to which you can push these two simple rules are the topic of this book.
Kent Beck wrote:Here's a simple example of multiplication:
(I know, I know, public fields, side-effects, integers for monetary amounts, and all that. Small steps. We'll make a note of the stinkiness and move on. We have a failing test, and we want the bar to go to green as quickly as possible.)
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
I wrote:There's a design guideline that states that a method should either mutate an object or return the result of a calculation but never both. This is related to the Single Responsibility Principle (SRP) and sometimes also to Demeter's Law.
Antoine de Saint Exupéry wrote:
Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.
(It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove.)
Junilu Lacar wrote:I have learned to write another test to illustrate the problem with the current design first.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
J. Kevin Robbins wrote:
Junilu Lacar wrote:I have learned to write another test to illustrate the problem with the current design first.
So how would you write a test that demonstrates this problem?
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
J. Kevin Robbins wrote:I don't quite understand that last example, but you've convinced me to order the book. It's on it's way.
I'll revisit this thread after I've worked through part of the book and see if it make more sense to me.
It's interesting how you often compare the study of software development to the study of the martial arts. It's like the Zen of Programming.
Java Problems Solved - http://farenda.com
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|