Disclaimer: I've only just built this plugin yesterday (10th March 2013) so don't expect it to be perfect yet, but do send bugs and feature requests to the github page
Still, it's good if you want to code coverage reports to be publicly visible. Check out an example of the results here
I use jacoco. It does not require compile- or runtime- dependencies, instruments classes on the fly w/o special instrumentation phase.
Also it integrated with Sonar and published on Maven Central.
I would like to add better reporting: more detailed branch coverage makrup, excluding of generated classes/methods, and to be handy like ScalaDoc (see SCCT reports for example)
One problem with non-mainstream languages (such as Scala) is that tools are hard to find, because they are hard to build.
This technical paper Branch Coverage for Arbitrary Languages Made Easy (I'm the author) describes how to build test coverage tools for langauges in systematic way to help get around this problem, using a generic tool-building infrastructure.
We've implemented test coverage tools for Java, C#, COBOL, C, C++, PL/SQL, ... this way, including instrumenters, data collection and test coverage display and reporting. It would be straightforward to implement Scala like this.
The solutions posed by other answers produces confusing information from the implementation of Scala ("auto genreated classes"). What developers want to see is coverage data in terms of their code. The approach we use instruments the source code, so the results are stated entirely and only in terms of the source code; even the test coverage viewer shows the source code covered with coverage information.
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.
Undercover is little better.
SCCT is a compiler plugin which instruments the classes to gather coverage data:
- Code Coverage Tools for Scala
- How do you impose scala code coverage specifically for integration tests?
- Partial EMMA code coverage in Scala Case Class for IntelliJ IDEA 10.5
- Code coverage for Scala integration tests with SCCT
- getting code coverage for java code with scala tests
- VSTS code coverage for Scala
- Code RED tools for Scala
- Code coverage for scala with separate test project in java
- How to get SonarQube code coverage for scala project
- Sonarqube, getting Zero Code Coverage for scala project
- Are there any tools for performing static analysis of Scala code?
- What is the accepted/recommended syntax for Scala code with lots of method-chaining?
- any UML tools for Scala
- Is there a Sonar-level code coverage equivalent for Scala?
- Is there a tool for Scala to clean all the unused imports from all the code files?
- Scala Shapeless Code for Project Euler #1
- Functional style for this Scala code
- Are there tools for code obfuscation for Scala?
- scala code causes error in eclipse for playframework-2.0
- How to configure code style for Scala in IntelliJ IDEA
- Scala Shapeless Code for Project Euler #2
- How to custom code folding for Scala in intelliJ IDEA?
- Measure Scala Code coverage in testcases in Eclipse
- Scala / Java Sandbox for untrusted code
- How to organize code for multiple scala versions and differents dependencies
- Human readable size units (file sizes) for scala code (like Duration)
- Integrating scala code coverage tool jacoco into a play 2.2.x project
- Scala 2.8 tools for production use
- Why Intellij's debugger hits breakpoint twice for this Scala code
More Query from same tag
- Does Scala have syntax for 0- and 1-tuples?
- Post request string to localhost in scala akka
- HIVE table not found
- Parametric or Subtype Polymorphism in Scala
- Placeholder Syntax in Scala Programming
- Using scala-eclipse for spark
- Scala Ordering, Ordered, and View Bound
- How to apply Sha2 for a particular column which is inside in the form of array struct in Hive or spark sql? Dynamically
- Collecting Akka actor system metrics
- How to aggregate values in Spark?
- Decode List[String] to List[JSONObject(key,value)] in circe scala
- How do I validate a subclassed field in my Scala abstract parent object?
- Converting the euclidean distance to manhattan distance
- How to use Scala to partition data into buckets for further processing
- How to refine Spark StructType Schema based on a list of required fields?
- How to do type safe, thread safe boundaries with Akka?
- What is the best way to define custom methods on a DataFrame?
- Lazify this flatMap on a list of iterators
- How can I add configuration files to a Spark job running in YARN-CLUSTER mode?
- Define a function parameter as a "var" in Scala?
- scala reassignment to val in Option Class
- How should I use MayErr[IntegrityConstraintViolation,Int] in Scala and Anorm?
- Emacs project management for Scala
- In Play 2.4 with DI, how to use a service class in "Secured" trait?
- Simple unit testing with monoids
- What's a good way to handle unitialized private members in Scala objects?
- Access entity within Lift Scala net.liftweb.util.Box object
- Scala, A type mismatch issue and type inference issue
- Scala (spray) json serialization and deserialization issue
- Scala companion class warning