Integrate SCCT (Scala Code Coverage Tool) with Lift Scala project


Its always a good practice to have a fine test coverage in any project. I am working on Lift framework. I have tried to integrate the SCCT with my lift scala project.

Here, I am going to elaborate a few easy steps to integrate the SCCT in Lift Scala project. I am using scala 2.10.0 and sbt 0.12 version.

1. Add the following lines of code in your plugin.sbt file. You need to add the plugin dependency to your project’s plugins.sbt.


resolvers += Classpaths.typesafeResolver

resolvers += "scct-github-repository" at "http://mtkopone.github.com/scct/maven-repo"

addSbtPlugin("reaktor" % "sbt-scct" % "0.2-SNAPSHOT")

2. Add the following to build.sbt to add SCCT plugin settings:


seq(ScctPlugin.instrumentSettings: _*)

3. Now, set the path to your project on the terminal and run sbt. This will download the all SCCT dependencies.

4. That’s it. Lets run the SCCT with command scct:test

5. You’ll find the html file with name index.html which would give you the full test report. You’ll find this file in this path /target/scala-2.10/coverage-report/index.html.

6. Run this file on browser and get the test coverage details.

About Ruchi Agarwal

Software Consultant at Knoldus Software LLP having around 2 year experience working in Scala and java. She has good understanding of various technologies like LiftWeb, Akka, Amazon EC2, jQuery, javascript, CSS etc. She is RAD (Rational Application Developer) for WebSphere Software and RFT (Rational Funtional Tester) for Java certified. She is a skilled professional focused on the basic business functions and creation of software. She has a firm understanding of design methodology. She likes to work with responsibility, dedication and perseverance, she has a facility to establish good interpersonal relationships and foremost she is loyal to her principles, ethics and always giving to the best of her caliber.
This entry was posted in LiftWeb, Scala. Bookmark the permalink.

One Response to Integrate SCCT (Scala Code Coverage Tool) with Lift Scala project

  1. Anjaiah says:

    Hi,
    1. I have added below dependencies to the plugin.sbt

    resolvers += Classpaths.typesafeResolver

    resolvers += “scct-github-repository” at “http://mtkopone.github.com/scct/maven-repo”

    addSbtPlugin(“reaktor” % “sbt-scct” % “0.2-SNAPSHOT”

    2. added seq(ScctPlugin.instrumentSettings: _*) this line in my Build.scala file

    3. after that i did; sbt clean compile

    4. now when i ran the scct:test or sbt clean scct:test

    getting the follwoing error: [info] Set current project to Pixie Workflow (in build file:/home/anji/project_dev/pixie/pixie-workflow/)
    [error] No such setting/task
    [error] scct:test
    [error] ^

    could please guid me, where I am doing mistake.

    I suspect step 2 not set properly, please guid me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s