Jump to content
  • Advertisement
Sign in to follow this  

How to automate testing for 3D-algorithms

This topic is 1933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



to ensure that some graphic-algorithm just works even if I do some refactoring in an existing "historical grown" code base I want to do some automatic integration-tests for these ( like for instance using an animation-path ). Screen-resolution and used HW are constant. 

The approach I am currently thinking about is even straight forward:

  1. Start rendering the object to animate using the path at time 0 -> make the first screenshot
  2. At a given time during the animation -> make another screenshot
  3. At the end of the animation make the last screenshot
  4. Now do a bitmap compare between the reference pictures and the new one 
  5. Differences -> buggy algoriuthm


  • Easy to implement
  • You can validate some kind of visual representation


  • A lot of data will be generate
  • What happens when the difference is really small?
  • Animation is not checks, only some states of the animation itself.
  • You have to save the bitmaps
  • What to do with antialiasing

A different approach could be: 

  1. Start the anmation, save the transformation.
  2. Do this at a given point of time
  3. Do this at the end of the animation
  4. Look out for differences


  • Only numerical data
  • Easiy to check


  • How to deal with numerical rounding issues.
  • ...

So I am just curious: how do you deal with issues like this. Just be aware: I am not talking about pure unit-testings, I want to test the integration and the visual representation of a couple of classes and subsystems.


Thanks in advance,



Share this post

Link to post
Share on other sites

Of course it is possible to do all these testing manually. But special for an ongoing refactoring people have to fight against a lot of scare caused by the facts, that they do not fully understand the legacy system or even do not know all supported features ( and I am sure the customer know them all when we break them down ). And things you don't know you cannot test and this is a scary fact in doing refactoring / redesign.


So building up automated tests can be one way to learn something about the current behaviour and document them by writing an easy to understand test. 



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!