Autograding Model

This module autogrades Java projects based on a configurable set of metrics.

License

License

MIT license
Categories

Categories

Auto Application Layer Libs Code Generators
GroupId

GroupId

edu.hm.hafner
ArtifactId

ArtifactId

autograding-model
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

Autograding Model
This module autogrades Java projects based on a configurable set of metrics.
Project URL

Project URL

https://www.cs.hm.edu/die_fakultaet/ansprechpartner/professoren/hafner/index.de.html
Source Code Management

Source Code Management

https://github.com/uhafner/autograding-model

Download autograding-model

How to add to project

<!-- https://jarcasting.com/artifacts/edu.hm.hafner/autograding-model/ -->
<dependency>
    <groupId>edu.hm.hafner</groupId>
    <artifactId>autograding-model</artifactId>
    <version>1.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/edu.hm.hafner/autograding-model/
implementation 'edu.hm.hafner:autograding-model:1.3.0'
// https://jarcasting.com/artifacts/edu.hm.hafner/autograding-model/
implementation ("edu.hm.hafner:autograding-model:1.3.0")
'edu.hm.hafner:autograding-model:jar:1.3.0'
<dependency org="edu.hm.hafner" name="autograding-model" rev="1.3.0">
  <artifact name="autograding-model" type="jar" />
</dependency>
@Grapes(
@Grab(group='edu.hm.hafner', module='autograding-model', version='1.3.0')
)
libraryDependencies += "edu.hm.hafner" % "autograding-model" % "1.3.0"
[edu.hm.hafner/autograding-model "1.3.0"]

Dependencies

compile (7)

Group / Artifact Type Version
edu.hm.hafner : codingstyle jar 2.0.6
edu.hm.hafner » analysis-model jar 9.8.1
org.apache.commons : commons-lang3 jar 3.11
com.fasterxml.jackson.core : jackson-databind jar 2.12.1
javax.annotation : javax.annotation-api jar 1.3.2
com.github.spotbugs : spotbugs-annotations jar 4.2.1
com.google.errorprone : error_prone_annotations jar 2.5.1

test (7)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.7.1
org.junit.jupiter : junit-jupiter-engine jar 5.7.1
org.junit.platform : junit-platform-launcher jar 1.7.1
org.junit.jupiter : junit-jupiter-params jar 5.7.1
org.mockito : mockito-core jar 3.8.0
org.assertj : assertj-core jar 3.19.0
com.tngtech.archunit : archunit-junit5 jar 0.17.0

Project Modules

There are no modules declared in this project.

Autograding Model

Jenkins Version GitHub Actions Codacy Badge codecov LGTM grade LGTM alerts

Scores

Java library that autogrades projects based on a configurable set of metrics. Currently, you can select from the following metrics:

  • Test statistics (e.g., number of failed tests)

  • Code coverage (e.g., line coverage percentage)

  • PIT mutation coverage (e.g., missed mutations' percentage)

  • Static analysis (e.g., number of warnings)

For each metric you can define the impact on the overall score, and the individual scoring criteria using a JSON configuration:

{
  "analysis": {
    "maxScore": 100,
    "errorImpact": -5,
    "highImpact": -2,
    "normalImpact": -1,
    "lowImpact": -1
  },
  "tests": {
    "maxScore": 100,
    "passedImpact": 0,
    "failureImpact": -5,
    "skippedImpact": -1
  },
  "coverage": {
    "maxScore": 100,
    "coveredPercentageImpact": 0,
    "missedPercentageImpact": -1
  },
  "pit": {
    "maxScore": 100,
    "detectedImpact": 0,
    "undetectedImpact": -1,
    "detectedPercentageImpact": 0,
    "undetectedPercentageImpact": 0
  }
}

Creating an aggregated score takes just a few steps:

String configuration = "{\"analysis\": { \"maxScore\": 100, \"errorImpact\": -5}}";
AggregatedScore score = new AggregatedScore(configuration);
score.addAnalysisScores(new JenkinsAnalysisSupplier(run));
score.addTestScores(new JenkinsTestSupplier(run));
score.addCoverageScores(new JenkinsCoverageSupplier(run));
score.addPitScores(new JenkinsPitSupplier(run));

The actual grading results are then available as properties on the AggregatedScore instance.

For each of the 4 supported grading result types you need to implement a supplier implementation that provides the corresponding details of the project. Please have a look at the Jenkins plugin to see an example implementation of these suppliers.

Versions

Version
1.3.0
1.2.0
1.1.1
1.1.0
1.0.0
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0