So the idea is before you’ve even starting writing your task, you must think about what it is that your task should do, what is the behaviour of your task that you want. And then you write something that describes that behaviour and ensures that the result you get out of it is what you expect. Then you write the task and should tick a couple of magical boxes. One is that if you can’t write a sentence starting with the word should, the chances are there’s another task that should be doing it.
I was talking to somebody. I’d written an equals methods, that shouldn’t really have been there but I thought it should at the time. So I wrote it, he came past and went: “That shouldn’t be that way. You shouldn’t have equals method. We should be able to get round it, it should be the same object and so, an involved method isn’t needed.” I said “Oh, it shouldn’t to do that.” “No. What do I do about the test?” I said “Well, it shouldn’t do that delete the test, you know, and change it to the way it should work.â€? You can talk about behaviour that way instead of saying test something.

delicious
digg