4 ms·
Sorry fella but you don't understand the concept of unit testing. I suggest you do some reading on the subject. http://en.wikipedia.org/wiki/Unit_testing http:
by hartror 15y ago
Sorry fella but you don't understand the concept of unit testing. I suggest you do some reading on the subject.
http://en.wikipedia.org/wiki/Unit_testing http://en.wikipedia.org/wiki/Unit_testing
- palish 15y ago"In a unit test, mock objects can simulate the behavior of complex, real (non-mock) objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test." Why would you want to simulate the graphics subsystem (and therefore the video card)? The goal here isn't performance testing. It's to check whether the engine works.
- hartror 15y agoYou 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!
- seabee 15y agoIt'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!
- rapala 15y agoYes, 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.