> For the complete documentation index, see [llms.txt](https://mirror-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mirror-networking.gitbook.io/docs/manual/general/tests.md).

# Tests

A lot of developers are surprised by how stable Mirror is, compared to what they've used before.

This is not by coincidence. Mirror is **heavily** tested with:

* \> **1400** unit tests
* \~ **80%** test coverage

![\[2021-06-17\] Mirror Test Coverage of 79.6% - including all \[Obsoletes\]](/files/-McNLt7D7WVo6LT8tKru)

{% hint style="success" %}
As far as we know, **Mirror** has the highest test coverage of any `MonoBehaviour`networking library for **Unity**.&#x20;
{% endhint %}

In other words, 80% of our code is **covered with tests** making sure that for the given input, it always produces the correct output. Here is what this means in practice:

* If you **report a bug**, we usually fix it and add a test to guarantee that it **never** happens again.&#x20;

  If we **accidentally** introduce a bug, odds are our tests will catch it immediately before you ever encounter it in our game.
* We can **improve** existing functions with confidence. If a rewrite doesn't produce exactly the same output as the previous version, then our tests will catch it.

{% hint style="success" %}
As **rule** **of** **thumb**, encountering a Mirror bug in production simply means that we haven't covered that part of the code with tests yet.
{% endhint %}

![](/files/-Ma7o48WN0C1t_Id8USK)

If you download Mirror from the **Asset Store**, then you don't see those tests because we don't want you to worry about them. They are only on **GitHub**.

## Code Coverage Settings

To reproduce the Coverage results, use Unity's Code Coverage Package and run all of our Edit Mode tests.

![Code Coverage settings](/files/-McNIaclZb5da0cAYSrH)

## MirrorTest

If you want to contribute tests or clean up existing ones, please do!

Check out the `MirrorEditModeTest` and `MirrorPlayModeTest` base classes. They provide some convenience functions and setup that we use for most of our tests. For example, Creating a networked object with some network components.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mirror-networking.gitbook.io/docs/manual/general/tests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
