uTest

uTest is a system testing framework that allows you to easily create distributed system tests that execute over multiple processes, for Unity. The lack of off-the-shelf solutions for testing networked Unity applications is what drove us to develop uTest, and it is indeed used in most of MuchDifferent's projects.

Check out the Getting Started chapter to get testing using uTest ASAP. If unfamiliar with system testing, you may also wish to read our general chapter on testing multiplayer games. uTest is presently aimed only for functional testing, and you might wish to look at our uSuite Load Tester for a solution to load tests of Unity servers.

Key Features

uTest as a tool provides everything you need to perform functional system testing of networked software, while integrating closely with Unity. Here is a non-exhaustive list:

  • Simple and straightforward API inspired by NUnit (with the same assertions)
  • Coroutines familiar from Unity allowing linear execution of tests, without callbacks
  • Node synchronization through barriers
  • Logging of all nodes
  • Timeouts and failure handling
  • Support for different process models: Isolated processes, threaded AppDomains, sequential

Quick Overview

A distributed test written in uTest works like the following:

  1. uTest is started and given a class containing the code for a test. This class contains the code for each node in a separate method.
  2. All the node processes of the test are started and initialised but without starting the test.
  3. When all nodes are ready, the test is started. All nodes begin executing their test code.
  4. The test runs until all nodes have finished, either by finishing running their test code or by failing.
  5. The results for each node are gathered and a final result for the test is determined.
  6. All node processes are closed.
  7. The final result is presented to the user.

Future Work

uTest is presently in closed beta and under development. Upcoming extensions to existing functionality include:

  • Unity editor integration
  • Fully Unityless version (standalone presently requires uServer?)
  • Results aggregation and presentation
  • Support for non-functional testing