¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: [TDD] How do you write tests if you aren't sure what the result should be?


Pascal Roy
 

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 what the results should be?"

I would say, it's a pretty fundamental issue...

Pascal Roy
www.elapsetech.com


Le 2013-02-14 ¨¤ 05:57, Angel Java Lopez <ajlopez2000@...> a ¨¦crit :

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 written, THAT ARE not in your
program, that is, it's not part of what you are writing using TDD, it can
be viewed as a math library you have. Your program will use that ALREADY
written formulas.

or?

- You have complicated formulas, you must use and write in the next piece
of your program

Which is the case? I presume it is the second case, am I right?

Then, you wrote
I need to write a series of functions which predict what the steps of the
formula will be. (How many timer ticks will it take to get to point A?)

WHY? Which is the use case in your program?

I would start with a simple mini use case, then the formula(s) and their
application will evolve in your program.

Can you describe a use case?

I could imagine one program:

- I need to write a physics engine

Instead of testing the results of a multibody gravity evaluation in a
complicated environment, I would start with:

- Given a ball, suspended in air, at time t0 its at y0, then I would test
that at t1 its at y1 with y1 < y0

Angel "Java" Lopez
@ajlopez
gh:ajlopez

On Thu, Feb 14, 2013 at 4:24 AM, Avi Kessner <akessner@...> wrote:

**


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 each
other The math is too complicated for me to resolve easily. These
formulas are calculated based on time. (For example, an elastic tween
formula)
I need to write a series of functions which predict what the steps of the
formula will be. (How many timer ticks will it take to get to point A?)

This is something that I feel can have tests, and needs tests. But I have
no idea what to check or how to know if the test is correct.

My actual question is a meta-question by the way. How do I write tests
when I don't know what the results should be, but I know the computer needs
to get the "correct" result?

Thanks.

brought to you by the letters A, V, and I
and the number 47

[Non-text portions of this message have been removed]



[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links





[Non-text portions of this message have been removed]

Join [email protected] to automatically receive all group messages.