-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development
: Refactor quiz server tests
#6570
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #6570 +/- ##
=============================================
- Coverage 80.43% 80.41% -0.02%
Complexity 13639 13639
=============================================
Files 2410 2410
Lines 91880 91880
Branches 12886 12886
=============================================
- Hits 73900 73883 -17
- Misses 9881 9898 +17
Partials 8099 8099 see 12 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
… into test/refactor-quiz-server-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good after other reviews and merges of develop branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproved
src/test/java/de/tum/in/www1/artemis/quiz/QuizExerciseIntegrationTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code approved, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproved
Checklist
General
Server
Motivation and Context
There are many tests that do not follow the best testing practices and could be improved. There is a lot of duplicated code, overly long and unclear tests. Some assertions are missing and others are unnecessary. The PR tackels the before mentioned issues found in the
QuizExerciseIntegrationTest.java
class.Description
Duplicated code has been reduced by introducing new helper functions which get reused in many tests. New and improved assertions have been in a few places and a two tests or so have been removed. Additionally, I also tried removing repository access wherever possible.
Note: there are four tests related to quiz statistics (
testRecalculateStatistics
,testReevaluateStatistics
,testReevaluateStatistics_Practice
andtestReEvaluateQuizQuestionWithMoreSolutions
) that I skipped. They are longer and more difficult to understand compared to other tests in the class, so I would prefer to deal with them at a later point.Review Progress
Look through the code and make sure the refactorings make sense. The tests should be easier to understand and more efficient (less repository access).
Code Review
Test Coverage
unchanged