Appearance
Appearance
Tests give you confidence that your game will run as expected whenever new code is introduced or existing code is changed. Usually, you introduce code changes yourself, but sometimes the changes may come from external sources such as the Metaplay SDK or third-party libraries being updated. Either way, you need to ensure your game still functions as it should after making changes.
If you find yourself testing something over and over again before a release, it's a good sign it's time to automate it!
We rely extensively on automated testing to ensure the quality of the Metaplay SDK. Since the SDK ships as source code and is meant to be extended by game teams, we also ship our testing tools and test suites for you to help with your testing efforts.
If you just want to run all of our tests, take a look at the Integration Testing page for instructions on how to run them locally or in your CI.
To start adding more test coverage, you first need to decide what you want to test and then pick the appropriate tool for the job. Here are some common testing objectives and the approaches we recommend for each:
Objective | How to test | Further reading |
---|---|---|
I want to know if my game logic works correctly. | Write game logic unit tests with NUnit and cover the game features with BotClient. | .NET Unit Testing and BotClient Testing |
I want to know if my custom game server features work correctly. | Write C# unit and system tests with NUnit and Playwright.NET. | .NET Unit Testing and Advanced System Testing |
I want to know how my game performs at scale. | Use BotClients to simulate representative load. | BotClient Testing |
I want to know my LiveOps Dashboard customizations work correctly. | Write functional tests with Playwright. | Advanced Playwright Dashboard Testing |
I want to have confidence that my game has no regressions before a new release. | Run the integration_tests.py in your CI. | Integration Testing |
I want to have confidence that publishing a new game config does not harm the game. | Implement custom validation into your game config pipeline. | Custom Game Config Build Pipelines |
I want to run complex test scenarios on my game to avoid manual testing. | Write system tests that target the game server and LiveOps Dashboard from the outside. | Advanced System Testing |
You can jump to the dedicated testing guides if you know exactly what you want or continue reading to get a better understanding of the different types of tests and tools we provide.
There are many strategies for automated testing that each give confidence in different aspects of the game or the underlying technology.
Here is a high-level list of the testing methods we ship with the Metaplay SDK:
As a game developer, you are most interested in the integration, performance and functional tests. However, as your game gets more complex and you end up extending the Metaplay SDK, you may also find other kinds of test coverage useful.
You should adopt test coverage incrementally, starting from the most error-prone or critical parts of your game.
Now that you are familiar with the different types of tests, let's take a look at the tools we use to run these tests. You do not have to become an expert or even use all of these tools, but it's good to know what is available to you.
You can use the above-mentioned testing tools to write your game-specific tests. By utilizing the same tools and utilities to create your own test projects you avoid having to build your own test harnesses from scratch.
You should now have a high-level understanding of the different types of tests and tools that help with automated testing in the Metaplay SDK.
To start adding your own tests, take a look at the table in Writing Your Own Tests for guidance on which tools to use.