Skip to content

Code Coverage#643

Draft
mewilker wants to merge 36 commits into
mainfrom
398-code-coverage-grading
Draft

Code Coverage#643
mewilker wants to merge 36 commits into
mainfrom
398-code-coverage-grading

Conversation

@mewilker
Copy link
Copy Markdown
Contributor

Overview

Resolves #398. NOTE: this PR should not be merged until all other instruction has been updated and we are ready to start grading students on this requirement.

This PR changes how unit tests are graded, rather than counting numbers of tests, it evaluates the coverage on an area of source code that is relevant to the phase. The formula for grading is (student coverage / expected coverage). The idea is that unit tests are now graded on quality not quantity.

Details

  • Changed unit test grader to use coverage to caluclate scores
  • Added a verifier to ensure student code is in the correct spots to collect coverage, sends a warning if not
  • Penalty config now takes in configurable code coverage requirements
  • Rubric config sql statements have been changed to outline current expected coverage requirements (changing tables is probably not necessary for developers)

Testing

  • Added/updated unit tests
  • Tested edge cases
  • Manual testing (if needed)

Dependencies

The softwareconstruction repository with the instruction should be changed at the same time this goes into effect.

Future Work

Dr. Wilkerson has stated that we still may want to scan the code for bogus test assertions.

Additional Notes

Big shout out to @ZakkeryDaRebel for taking responsibility over this for a short while and @19mdavenport for writing the code that actually collects the coverage.

mewilker and others added 30 commits November 12, 2025 00:10
…tring so that nothing is removed from the coverage results if it is not Phase 3-4.
…ed line coverage checking if not for unitTests.
# Conflicts:
#	src/main/java/edu/byu/cs/autograder/test/TestGrader.java
#	src/main/java/edu/byu/cs/autograder/test/TestHelper.java
…e files showing if they have good coverage or not
@mewilker mewilker self-assigned this May 22, 2026
@mewilker mewilker linked an issue May 22, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@19mdavenport 19mdavenport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if my feedback is wanted, but I noticed a couple of things that may be helpful.

In addition to the other two comments on lines, I noticed in several places you added the coverage config stuff to the "penalty" section in the config. I understand you may not want to add a whole new config endpoint, request, and other things, but do the code coverage settings qualify as penalties?

Comment on lines +83 to +85
if (coveragePercent > extraCreditPercent) {
return 1.05F;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might you want the extra credit to be configurable from the frontend as well, rather than hardcoding it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraCreditPercent is configurable! If it can't grab it from the dao though it defaults to 90%

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait did you mean the score?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did

Comment thread src/main/java/edu/byu/cs/autograder/test/UnitTestGrader.java Outdated
@mewilker
Copy link
Copy Markdown
Contributor Author

I don't know if my feedback is wanted, but I noticed a couple of things that may be helpful.

In addition to the other two comments on lines, I noticed in several places you added the coverage config stuff to the "penalty" section in the config. I understand you may not want to add a whole new config endpoint, request, and other things, but do the code coverage settings qualify as penalties?

I'll take your feedback!

I figured they could qualify as penalties because if they don't reach a certain coverage their score is penalized :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: Add some verification of student test cases

3 participants