Our documentation is still under construction, please reach out to chat support in the bottom right corner if your queries cannot be answered here.

Supported Metrics

This is an extensive list of all metrics we support tracking and making reports with. It will be progressively updated as we add more options. Generally we have no language or framework restrictions, however some metrics might not be supported as output in all test frameworks.

Test Coverage

The cornerstone of OtterWise and code health, also referred to as code coverage. This metric essentially tells you from 0 to 100, how much of your code base is covered by tests, generally on a per-line level.

So if you have a test coverage of 50%, that means every other functional line of code, is being executed by at least one test. Functional lines are statements, conditionals and such. Code comments and method declarations are generally not considered functional lines, we do however support also calculating method declarations into your test coverage metrics.

Test Coverage: Patch

A useful metric that comes with test coverage is Patch Coverage, which is the test coverage of any changed lines of code in a commit, meaning not for the entire code base, but rather the git diff. A good rule of thumb if you are pushing for healthier code is to require collaborators to have a minimum of X % patch coverage.

Test Coverage: Branches

We also support branch coverage, which is a way of calculating the test coverage of your conditionals. A method with an if statement needs to be run through in more than one round to be considered fully covered, when tracking branch coverage. With branch coverage, you can see if all possible combinations of conditionals are covered. For example if both a true and false option was evaluated. If only a true option was passed, branch coverage will be 50%, while test coverage might still be 100% as all the code got executed.

Please see the documentation for your test framework if and how it supports branch coverage. We automatically collect it, if outputted.

Type Coverage

If you are using a language with weak typing, and want to embrace types, you can take advantage of type coverage tracking. This number, between 0 and 100, will tell you how much of your code has types defined.

We can also tell you what part of each line is missing a type, such as the method return type, parameter type and more.

Not all test frameworks supports type coverage output, so please consult with the documentation for your test framework and read our documentation about type coverage.

Type Coverage: Patch

Type Coverage also supports Patch Coverage, which tells you how much of your changed code is covered by types. This is most useful for PRs and any case where you have git diffs.