Skip to main content
gamedev.net
🔒 Locked

How do u do unit test?

Started by ccanan Mar 14, 2007 at 8:22 AM 1 replies 1.1k views
Original Post
ccanan
ccanan
just like in java,write tests before implementing a class; I find it's pretty difficult or troublesome to do unit test; Take culling as an example, we "improve" the culling system, then get a bug from tester that something dissappeared; It shouldn't be like this; I am considering about building a test map, including lots of things, then when we do some modifications, we can use this to check if it's right instead of waiting for tester's feedback; but you know, it will be difficult to build so good a map, and so on; so what's your experience? how do you test before throwing everything to testers?
ccanan
ccanan
my idea including:
build test map, then get standard things, screenshot, culling result, hdr value,memory, time and so on
we can update these, and store them;
when we update code, we check for the difference;
the result includes,if it's different, how much it's different, need we update the standard things;
keep on do this, so we can code and feel pretty reassuring;
Emmanuel Deloget
Emmanuel Deloget
It's very hard to unit test rendering operations. What you can do (if culling happens to take place on software) is to verify known corner cases with unit tests:

* input set contain A,B,C,D
* run culling on this set
* output set should contain A,B,D

If culling takes place on the hardware, it's going to be far less easy. Verifying reference images doesn't help much in this case (image comparison is quite difficult).

Remember that unit test should try to test simple things. The more complex the operation is, the more corner cases you'll have, and the more difficult it will be to correctly test the product. Unit testing complex systems is not only very hard, it's only not that useful - because two different problems can produce a correct output for most cases, so getting the diagnostic right is going to be harder.

Regards,

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.