HACKER Q&A
📣 sovietmudkipz

Why is the gaming industry resistant to automated tests?


I work at bigcorp working on applications built on top of kubernetes/public cloud as the target platform. One thing I’ve been impressed by at work is how writing automated tests is paramount. The “Growing Software guided by Tests,” “Unit Testing: principles and practices,” and other media/books are recommended by engineers to help others get up to speed writing good tests and good software. What is a good test, and what is a waste of time to test? This is a constant discussion and I love it.

As a hobby, I write video games because why not. One thing I’ve noticed is how different attitudes are on automated testing. It’s highly discouraged because ‘games don’t lend themselves to being tested’ apparently. It’s just as amazing to see how resistant this slice of the overall IT industry is to something the rest of the industry has considered very good.

This culminates for me in two anecdotes.

First, trying to find out what a good test looks like for video games is very, very, very challenging. There aren’t content creators noodling on or presenting findings on this subject. Not many articles, not many videos, not much content describing good tests. If there are industry veterans who do testing right, they seem to be keeping that information far, far away from the public. Perhaps even they see this as a market differentiator? My experience leads me to think this is something very few explore, and even fewer share.

Second: Unity put together a thing in Fall of 2020 called “open game project” where the idea was to create an open source game as a community. The game, now called “chop chop,” has a series of YouTube livestreams where the Unity devs discuss the project. The super interesting thing to me is that within 72 hours of project start, someone put together a PR to try and introduce tests. A Unity forum thread was referenced where discussion occurred. When I read through the discussion, I got the sense that the Unity devs did not want tests in the project. “Too early,” “too complex,” and other blockers existed at that time, apparently. Fast forward to the project end— still no tests.

Why is the gaming industry so resistant to automated tests, especially when compared with the overall IT industry?


  👤 Flankk Accepted Answer ✓
Video games are disposable products, other software is usually mission critical and requires long-term support. So for games you can get away without automation but with other software it would destroy you. Testing is not free, it is a tradeoff where the benefits outweigh the costs by some margin. Video game testing is difficult to automate so in many circumstances the costs of automation may outweigh the benefits. Automated tests are just a subset of quality assurance, which can be accomplished in a variety of ways.

👤 muzani
I think it's because by default, you have no idea what you're building for games.

Let's say you're making a typical RPG on web/JS. First off, what is the interface? Typical WASD? Is it a grid? 2D or 3D or 2.5D/isometric? How do you attack monsters? Do you click or press a key? Is it Mount and Blade style where the feel of the weapon depends on character skill? Is it FF style where you pick an attack from a menu?

Oh wait, we forgot mobile. WASD won't work nor would most roguelike controls. Do we just ditch mobile support? Do we hack in a D-Pad? Do we do two different interfaces? Would it be portrait supported or landscape to make it more compatible with monitors?

From this alone, it's very hard to do TDD, as opposed to writing some hotel booking app where you know that essentially someone books a hotel.

And then you have the next stage: exploits.

Sword kills the skeleton monster in 10 hits. Mace kills the skeleton monster in 5 hits. Spiked chain kills the skeleton in 13 hits but it has a little more range, so the hero takes less damage. You write tests and it checks out perfectly. You test that randomisation falls within the parameters, test that the soul stealing artifact sword is balanced, test that paladins are properly corrupted when using soul stealing weapons.

And then you get this: https://www.giantitp.com/comics/oots0216.html

Someone finds out that half-ogre spiked chain can defeat every monster in the game without a single injury. Suddenly half the game are using low level spiked chains and the soul stealing artifact sword is in the bargain bin.


👤 2rsf
> devs did not want tests in the project. “Too early,” “too complex,”

I get that response a lot from general purpose devs, not just gaming devs many still don't see the benefit of tests at all levels


👤 detaro
> something the rest of the industry has considered very good.

That's a ... very optimistic view of the rest of the industry. You see attitudes similar to those you cite in many places.

That said, testing for games is a very interesting topic indeed. From what I gather, it's easy to build tests that are not very effective, and a lot of work to test non-trivial things. Combine that with the kind of iteration and likely less fixed specs in gaming makes many people think it's not worth it.


👤 PaulHoule
I thought C/C++ programmers never got into the testing habit. In fact, with the dangerous memory model probably the only safe thing to do if a test fails is exit() in the child and fork() a new one in the parent… If you are in POSIX country!