Sign in to follow this  
Kimmi

How to automate testing for 3D-algorithms

Recommended Posts

Hi,

 

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

Pros's:

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

Con's:

  • 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

Pro's:

  • Only numerical data
  • Easiy to check

Con's

  • 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,

 

Kimmi

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. 

 

Kimmi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this