SteamVR Automated Testing?

I come from the web software engineering world. JS/Ruby/etc In that world, everything I write has an automated test. Unit tests, integration tests, controller tests, model tests, end to end tests, etc. I love tests because they keep what I wrote working, even across features, refactors, or other engineers touching my code.

I’m writing an application where Touch controller interactions should always be consistent, certain items shouldn’t be grabbable and different input modes exist. The trigger button might do something different in one mode versus the other.

I’m only two Early Access releases in and consistently my QA sessions are taking hours after a single new feature. I foresee that amount of time only increasing as the number of features increase. What’s the best way to approach automated testing in a Unity SteamVR C# environment?

Well… To me you have two ways:

  • Make sessions with a real person and record every movements / Action he do then replay them.
  • Using a 3D animated character but you have to script the buttons input over it…

A very interesting question.
One approach to recording/playback sessions would be to utilize the oculus avatar sdk.
It can serialize/deserialize poses for networking, this feature could also be used to record/playback sessions.
I don’t think button states are stored, this would have to be added.
You can check out the RemoteLoopback example in the ovr avatar sdk.

So, I take it this isn’t done widely right now? Is most 3d game testing still a manual process?

Yes, this way you also know if your game is enjoyable or not. A bot cannot do that.

Anyway, At work I make serious game most of the time and I often code an automatic process to test the game over several hours, sometime days. But I never had to make a game with HTC Vive controllers.

I decided automated testing was essential for my VR app, as one little change can introduce far reaching bugs, so I did some additional research. Unity comes with Debug.isDebugBuild: Unity - Scripting API: Debug.isDebugBuild

And also Assert: Unity - Scripting API: Assert

Combining these, I will write some semi-automatic tests that run when I click a button inside the game (the button won’t be active in release builds). This should go a long way toward providing a more reliable dev environment as I add features and the app grows. It’s not quite CI, but it’ll do for now.

Hmmm… looks like Unity supports integration tests too:

Looks like automated testing is a thing in Unity.

He talks about Unit Testing here:

I’m not sure the forum is allowing the time jumps in those youtube links, so:

  • Integration Tests at 22:51
  • Unit Tests at 47:51