Hacker News new | ask | show | jobs
by hartror 5534 days ago
You aren't testing the engine. You are testing that the unit, in your example the class Foo, responds correctly to the state and inputs you provide it. Decoupling those responses from other units such as the graphics subsystem gives you the assurance that under the tested conditions the unit works as intended.

What you are talking about is a regression or functional test. Same genus different species, still very useful but not the same tool.

Edit: Going to bed, if someone would like to explain by morning why this needed to be down voted so brutally I would be much obliged!

1 comments

It's impossible to unit test a component whose criteria for 'working' is tightly coupled to dependencies out of your control (video hardware & drivers).

Thus you'll never be able to unit-test a video game completely. Or even fulfill other forms of testing with the same breadth as is possible in other software, unless you have every possible configuration to test on, or stick with consoles. Games are among the buggiest of all software, but it's not for want of trying!

Yes, it's true that unit testing those components of a video game that abstract away the hardware underneath is hard or even practically impossible. But Foo here is not talking to hardware. It uses a model given by GrSubsys and that model can be mocked.