Mirror
  • Mirror Networking
  • API Reference
  • Development Blog
    • A Brief History of Mirror
  • User Manual
    • General
      • Getting Started
      • Script Templates
      • Change Log
        • 2024 Change Log
        • 2023 Change Log
        • 2022 Change Log
        • 2021 Change Log
        • 2020 Change Log
        • 2019 Change Log
      • Deprecations
      • Migration Guide
      • Integrations
      • Timestamp Batching
      • TCP and UDP
      • CCU
      • SyncDirection
      • Round Trip Time (RTT)
      • Connection Quality
      • Lag Compensation
      • Client Side Prediction
      • History Bounds
      • Tests
      • NetGraph
    • FAQ
      • Execution Order
    • Transports
      • KCP Transport
      • Telepathy Transport
      • WebSockets Transport
        • Reverse Proxy
          • Windows
            • IIS
          • Linux
            • NGINX
            • Caddy
            • Apache
            • HA Proxy
        • SSL
      • Multiplex Transport
      • Latency Simulation Transport
      • Ignorance
      • LiteNetLib Transport
      • FizzySteamworks Transport
      • FizzyFacepunch Transport
      • Encryption Transport
      • Edgegap Transports
        • Edgegap Relay
        • Edgegap Lobby
    • Components
      • Network Animator
      • Network Authenticators
        • Basic Authenticator
        • Device Authenticator
      • Network Behaviour
      • Network Discovery
      • Network Identity
      • Network Manager
      • Network Manager HUD
      • Network Ping Display
      • Network Profiler
      • Network Rigidbody
      • Network Lerp Rigidbody
      • Network Room Manager
      • Network Room Player
      • Network Start Position
      • Network Statistics
      • Remote Statistics
      • Network Transform
        • Snapshot Interpolation
      • Deprecated
        • Network Proximity Checker
        • Network Scene Checker
        • Network Match Checker
        • Network Owner Checker
    • Interest Management
      • Spatial Hashing
      • Distance
      • Scene
      • Scene + Distance
      • Match
      • Team
      • Custom
      • Legacy
    • Guides
      • Authority
      • IDs
      • Attributes
      • Time Synchronization
      • Data types
      • Serialization
      • Synchronization
        • SyncVars
        • SyncVar Hooks
        • SyncEvent (Obsolete)
        • SyncLists
        • SyncDictionary
        • SyncHashSet
        • SyncSortedSet
      • Communications
        • Remote Actions
        • NetworkManager Callbacks
        • NetworkBehaviour Callbacks
        • Network Messages
      • GameObjects
        • Player Game Objects
        • Custom Character Spawning
        • Custom Spawn Functions
        • Scene GameObjects
        • Pickups, Drops, and Child Objects
    • Examples
      • Additive Levels
      • Additive Scenes
      • Basic
      • Billiards
      • Multiple Additive Scenes
      • Pong
      • Room
      • Tanks
      • EdgegapLobby
  • Server Hosting
    • The Pragmatic Hosting Guide
    • Cloud Hosting Guides
      • AWS
      • Google Cloud
      • Oracle Free Tier
    • Hosting with a Remote Desktop
    • Edgegap Hosting Plugin Guide
  • Security
    • Security Overview
    • Cheat Protection Stages
    • Cheats & Anticheats
  • Community Guides
    • Community Translations
    • Video Tutorials
    • Resources
    • Mirror Quick Start Project
    • Unity for MMORPGs
    • Unity Canvas HUD
    • Odin Inspector Support
    • Ready Up And Die!
    • iOS AppStore
    • Mirror Docker Guide
    • Gitbook Guide
    • Mirror Branding
    • Contributors Agreement
    • Documentation License
Powered by GitBook
On this page
  • Code Coverage Settings
  • MirrorTest
  1. User Manual
  2. General

Tests

Mirror Secret Sauce.

PreviousHistory BoundsNextNetGraph

Last updated 3 years ago

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

As far as we know, Mirror has the highest test coverage of any MonoBehaviournetworking library for Unity.

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.

    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.

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.

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.

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.

[2021-06-17] Mirror Test Coverage of 79.6% - including all [Obsoletes]
Code Coverage settings