Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Choice of test data

1. ## Choice of test data

I've been browsing&searching through this forum but haven't found an answer to the following elementary question concerning functional or black box testing:

Suppose I want to test some code that carries an implementation of a simple formula like A = B*C + D. I'm only interested in valid input data for the moment: When I create my test data, I have to choose values for B,C and D and add the expected result for A to my (later) automated test.

But: WHICH and HOW MANY constellations of B/C/D do I have to choose in order to state that the algorithm is "tested"? Speaking of classes of valid data, I could choose exactly one representative for each value and consequently do just one test calculation and say "that's it", but I'm not quite satisfied with that. The main problem is that I have a non-discrete set of possible input values from which I need to choose my representatives in an intelligent way. (An alternative would be to try random input data but then I'd have to detect the expected result every time which means I'd have to implement a small machine doing that, which itself would have to be tested... so, no gain here, especially when the formula in question is much more complicated than the one mentioned above.)

Are there any hints/tips/laws/experiences/links about how to choose input data in a situation like this?

Thanks a lot,
cb

2. ## Re: Choice of test data

Are there any boundaries to B C or D? What type of field is A - long integer, short, integer, etc? I would use the data types that the equation is coded for.

I would at a minimum include a test with zero as all three, and zero as B or C.

Maybe try some negative numbers depending upon the requirements.

And you might want to check that the equation is re-initialized after ever calculation.

Otherwise math is math.

------------------
JRica, CSTE

3. ## Re: Choice of test data

Thanks for your reply. Looks like there's little "universal" theory for stuff like that & it all reduces to the given situation - which I have no problem with but which I find a little disturbing. Especially the question "Is just one calculation with arbitrary 'typical' numbers (non-zero etc.) enough?" remains open up to now.

Anyway, math is fun!

4. ## Re: Choice of test data

You might want to do a web search on "combinatorial pairwise coverage" for some ideas on one approach to this problem.

------------------
Charles Reace

#!/usr/bin/perl
my @email = qw(charles reace verizon net);
printf("%s.%s@%s.%s\n", \$email[0], \$email[1], \$email[2], \$email[3]);

5. ## Re: Choice of test data

Hi cb,

Maybe you should put another question, instead your original one. For example:
- what kind of inputs should I use to verify
an algorithm ?

http://www.qaforums.com/Forum46/HTML/000096.html

P.S. cb, Refering your username, first two characters have a particular meaning ?

------------------
If you need a reason to be happy - FIND IT, don't wait it !

[This message has been edited by Daniel_S (edited 09-24-2002).]

6. ## Re: Choice of test data

Charles & Daniel,

thanks for your helpful suggestions. Since I'm quite new to the testing business, I appreciate them a lot.

PS: Daniel - yes.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.