# Code coverage support for tests

**URL:** https://discussions.unity.com/t/code-coverage-support-for-tests/801641
**Category:** Testing & Quality
**Tags:** Testing-and-Automation
**Created:** [July 25, 2020, 7:43am UTC](https://discussions.unity.com/t/code-coverage-support-for-tests/801641 "2020-07-25T07:43:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![liortal](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/liortal/32/238558_2.png) [@liortal](https://discussions.unity.com/u/liortal)
#### Post date: [July 25, 2020, 7:43am UTC](https://discussions.unity.com/t/code-coverage-support-for-tests/801641/1 "2020-07-25T07:43:53Z")

</div>

I am wondering which minimal Unity version is requirted for tracking code coverage in tests?

I recall that Unity’s code coverage support was introduced somewhere in the 2019.x cycle, but JetBrains DotCover claims that they support Unity 2018.3+

So - which version is required? And on a more technical note - what runtime changed were required to achieve this? I suppose it is sonething that is baked into the .net (mono) runtime? Or is there some other magic going on?

---

<div class="post-metadata">

### Author: ![superpig](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/superpig/32/992213_2.png) [@superpig](https://discussions.unity.com/u/superpig)
#### Post date: [July 25, 2020, 4:28pm UTC](https://discussions.unity.com/t/code-coverage-support-for-tests/801641/2 "2020-07-25T16:28:31Z")

</div>

I’m not sure how DotCover is doing things, but Unity’s package requires 2019.3 - you might be able to hack it to work in 2019.2 as that’s when the Coverage API was added, but no earlier than that.

Yes, there were changes required to Mono to support this - e.g. making their coverage data structures get cleaned up correctly when unloading/reloading the AppDomain.

---

<div class="post-metadata">

### Author: ![liortal](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/liortal/32/238558_2.png) [@liortal](https://discussions.unity.com/u/liortal)
#### Post date: [July 25, 2020, 5:18pm UTC](https://discussions.unity.com/t/code-coverage-support-for-tests/801641/3 "2020-07-25T17:18:15Z")

</div>

> [@superpig](#):
>
> I’m not sure how DotCover is doing things, but Unity’s package requires 2019.3 - you might be able to hack it to work in 2019.2 as that’s when the Coverage API was added, but no earlier than that.
> 
> Yes, there were changes required to Mono to support this - e.g. making their coverage data structures get cleaned up correctly when unloading/reloading the AppDomain.

In that case, i wonder how DotCover pulls it off in 2018.3 …
