Re: [TDD] How do you write tests if you aren't sure what the result should be?
Thank you for your help and suggestions so far. My actual use case is a bit boring, but I found a more fun analogy. Say you were asked to make a change to a game called Yetti Sport.
By
Avi Kessner
·
#35220
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Hi Avi, I'm not sure whether this is applicable to your situation, but I also had a case where we were calculating some complex formulas and I couldn't get an exact result predicted, simply because
By
Wouter Lagerweij
·
#35219
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Hi Avi, If you had to test your work only by direct observation, what would you look for? Charlie
By
Charlie Poole
·
#35218
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Ill write more later when I'm at my desk, but the use case here is matching and predicting animations
By
Avi Kessner
·
#35217
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Even when the math is complicated, there should be inputs where the results are easy to hand compute. For example, where the inputs are combinations of 0s, 1s, -1s, etc. Those trivial cases should be
By
Steve Gordon
·
#35216
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
I don't think the problem is directly related to TDD per say. Let me rephrase your question to point out what the real problem is : "How do you know your computation is right if you're not even sure
By
Pascal Roy <pascal_roy_1967@...>
·
#35215
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Hi Avi, Is it possible to redefine the question? You could gain confidence by testing the algorithm behaves as expected with given clock values, instead of having to guess (and have test failures when
By
Carl Hume
·
#35214
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Do you have the formulae or do you need to develop them? From: testdrivendevelopment@... [mailto:testdrivendevelopment@...] On Behalf Of Avi Kessner To:
By
Amir Kolsky <kolsky@...>
·
#35213
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Hi people! English is not my mother tongue, so maybe I misunderstood some of your message, Avi. Review: - You have a program, you write it using TDD Ok? Then, - You have complicated formulas, already
By
Angel Java Lopez
·
#35212
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
You can't. You need to compute by hand, or some other means, the expected result for some input. This should not be impossible. Check the result for simple cases. For instance, if I were writing a sin
By
Matteo Vaccari
·
#35211
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Avi, I don't think that's a simple question at all! I think it's hacking away at the boundary between TDD (a method) and algorithms (invention). John D.
By
Donaldson, John <john.m.donaldson@...>
·
#35210
·
|
Re: [TDD] How do you write tests if you aren't sure what the result should be?
Hi, I have a simple question. I've been developing my program with TDD however I have hit a snag and I'm not sure how to continue. We have some complicated mathematical formulas that interact with
By
Avi Kessner
·
#35209
·
|
Re: Request to participate in a research study regarding the performance appraisal of software testers.
Dear Members, Thank you for supporting me in my research studies. Unfortunately we didn't receive enough response for this study. Hence we modified the study and made it a short and simple one. If you
By
Tanjila Kanij
·
#35208
·
|
Re: [TDD] Does TDD ask me to 'forget' all I know about software design?
sh wrote: I am responding a little late, so I hope this is still relevant. My best experience is the benefits of the small steps approach. In traditional design-first, the preconceptions and
By
Michal Svoboda
·
#35207
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
On Thu, Jan 24, 2013 at 6:34 AM, John Goodsen <jgoodsen@...> wrote: > On Wed, Jan 23, 2013 at 4:14 PM, Charlie Poole <charliepoole@... > >wrote: > > > > > I'd make this change myself
By
Matteo Vaccari
·
#35206
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
so it boils down to (a) use the real object if you can and it's not a PIA or (b) write a thin adapter that you can mock in other tests. ... or (c) not discussed since it's Java - but if you were in a
By
John Goodsen <jgoodsen@...>
·
#35205
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
Hi, Regarding "making the code fit the test"... Your need to test has led you to consider an alternate structure involving an adapter. Now you have to ask yourself... would such an adapter improve the
By
Charlie Poole
·
#35204
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
Matteo, Having worked on IC development, I can say that's not always true. And there are definitely diagnostics to test that the electronics is constructed right, for testing prior to adding cost b
By
George Dinwiddie
·
#35203
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
I agree in principle with Grenning, but there is a difference: the diagnostics in electronics are not there to test the correctness of the electronics design; they are there to check if the
By
Matteo Vaccari
·
#35202
·
|
Re: [TDD] Howto mock a final object that doesn't offer an interface?
There's an interesting discussion there : Perhaps, there would be value in exploring why people feel this way� What are the objections? I'm not disputing there may be valid objections behind that
By
Pascal Roy <pascal_roy_1967@...>
·
#35201
·
|