
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
Dnia Tue, 02 Dec 2003 13:50:17 +0100, Hansjörg Malthaner napisal(a):
> The Sheep schrieb:
>> Dnia Tue, 02 Dec 2003 12:00:10 +0100, Hansjörg Malthaner napisal(a):
>> Seems strange to me. The modules you can easily test using such an automated
>> method are simple -- both to write and debug. On the other hand, creating
>> a testing module for more complicated modules seems to be even more complicated...
<snip>
>
> This isn't very sophisticated I guess, but some of the tests have proven
> helpful.
I can imagine you need such tests if you have lots of different modules and
you make a lot of chnages in them...
>> For example, how to automatically test FOV routine?
> Only one choice IMO: give it a predefined scene. Compare the results
> with a hardcoded/handmade result table. Test several scenes.
Heh, after a bit of thinking I can answer myself. Use some kind of straightforward,
brute-force, slow-poke algorithm and compare the results.
>> Or item manipulating
>> (pick up, drop, put into bag, use, wield, take off, etc.) routines?
>
> These are easy to test IMO.
>
> Drop test:
> - place an item on the square
> - check if it actually there, check attributes if they are still correct
> - check item count for this square - must be one more than before
>
> Do tests with empty squares and squares that are occupied by items already.
>
> Wield test:
> - wield the item
> - check if players stats actually have changed accoring to the expected
> change
>
> Put into bag:
> - Put item into the bag
> - Check if it's there
> - Check if it still has the proper attributes
> - Check if bags weight grew as expected
> - Test bag overflow case?
>
> They are simple. But I guess they can be useful. At least they protect
> you from the samll/silly errors that you might make during developemnt.
I'm not sure. Never tried it, but most bugs I've struggled with that concerned
item manipulating were only showing up in certain, very special circumstances.
Offcourse, any errer detection mechanism is helpful. The question is: is it
worth the effort?
Surely, if you have the whole process automated -- it is.
--
Radomir `The Sheep' Dopieralski
This sentence is false.
| <-- __Chronological__ --> | <-- __Thread__ --> |