Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Coverage Tools for Scala [closed]

What are the available code coverage tools for Scala?

I have Scala spec tests and a Hudson continuous integration set-up. Is there something I can hook-in to this setup to measure and track code coverage?

like image 200
arnab Avatar asked Jun 05 '09 02:06

arnab


People also ask

What is code coverage in Scala?

Code Coverage is a metric that measures what percentage of your code has been executed during unit and integration tests. JaCoCo is a great open-source toolkit for code coverage measurements. JaCoCo was originally written for Java and runs on the JVM, but because it's bytecode-based it works for Scala too.

Which tool is used for code coverage?

Code coverage tools are available for many programming languages and as part of many popular QA tools. They are integrated with build tools like Ant, Maven, and Gradle, with CI tools like Jenkins, project management tools like Jira, and a host of other tools that make up the software development toolset.

Is SonarQube code coverage tool?

SonarQube and JaCoCo are two tools that we can use together to make it easy to measure code coverage. They also provide an overview of the overall health of the source code by finding code duplications, bugs and other issues in the code. This helps us to know whether our code is production-ready or not.

What is Scala Scoverage?

scoverage is a free Apache licensed code coverage tool for Scala that offers statement and branch coverage. scoverage is available for sbt, Maven, Mill, and Gradle. NOTE: That this repository contains the Scala compiler plugin for Code coverage in Scala 2 and other coverage utilities for generating reports.


2 Answers

SCCT is a compiler plugin which instruments the classes to gather coverage data:

http://mtkopone.github.com/scct/

like image 147
Joni Avatar answered Sep 21 '22 14:09

Joni


I use Cobertura. However, any Java coverage tool should work just fine. The only catch is that you will end up with a large number of auto-generated classes in your coverage list. This is because while Scala compiles down into very natural JVM bytecode, it is forced to produce an unnaturally large number of classes to accommodate common functional features like lazy evaluation.

like image 22
Daniel Spiewak Avatar answered Sep 20 '22 14:09

Daniel Spiewak