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:
- Start rendering the object to animate using the path at time 0 -> make the first screenshot
- At a given time during the animation -> make another screenshot
- At the end of the animation make the last screenshot
- Now do a bitmap compare between the reference pictures and the new one
- 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:
- Start the anmation, save the transformation.
- Do this at a given point of time
- Do this at the end of the animation
- 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,