Class Scorer

java.lang.Object
com.spertus.jacquard.coverage.Scorer
Direct Known Subclasses:
LinearScorer

public abstract class Scorer extends Object
A way of converting branch coverage and line coverage information into a single score.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final double
    The maximum score that can be earned.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Scorer(double maxScore)
    Creates a scorer.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Result
    getResult(String name, double branchCoverage, double lineCoverage)
    Creates a result based on information generated by Jacoco.
    abstract double
    score(double branchCoverage, double lineCoverage)
    Converts branch coverage and line coverage ratios into a score.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxScore

      protected final double maxScore
      The maximum score that can be earned.
  • Constructor Details

    • Scorer

      protected Scorer(double maxScore)
      Creates a scorer.
      Parameters:
      maxScore - the maximum possible score
  • Method Details

    • score

      public abstract double score(double branchCoverage, double lineCoverage)
      Converts branch coverage and line coverage ratios into a score.
      Parameters:
      branchCoverage - the branch coverage ratio [0, 1]
      lineCoverage - the line coverage ratio [0, 1]
      Returns:
      a nonnegative score
    • getResult

      public abstract Result getResult(String name, double branchCoverage, double lineCoverage)
      Creates a result based on information generated by Jacoco.
      Parameters:
      name - the name of the grader
      branchCoverage - the branch coverage ratio [0, 1]
      lineCoverage - the line coverage ratio [0, 1]
      Returns:
      the result