Skip to content
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

Refactor Unit Tests #335

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Refactor Unit Tests #335

wants to merge 4 commits into from

Conversation

madmike200590
Copy link
Collaborator

(clone of PR #316, re-creating in order to fix git history that got messed up after squashing modularization commits during merge of #274)

This PR is a follow-up to PR #274. Following the changes to the overall code structure and API introduced through modularization, I took the opportunity to get started on some refactorings of Alphas unit tests.
Specifically, this PR aims to

Reduce dependencies and narrow down tested code for unit tests

In order to make our unit tests more precise and avoid localized errors failing lots of tests, I removed unnecessary dependencies from most tests. Especially, we don't want to have tests of core components like gronder and solver depend on the complete program preprocessing workflow including parser and rewritings.

Move functional tests to alpha-solver module

Most tests that test rewriting and preprocessing features, as well as all tests that just pass programs into an Alpha instance and verify returned answer sets should be considered functional tests rather than unit tests since they test complete features through the complete workflow. These were moved into the alpha-solver module since the default implementation of Alpha resides there.

Mark functional and integration tests for further attention

In order to improve build performance and better distinguish between unit-, integration-, functional- and performance-tests, these should be separated into separate tasks in the build (of which some should probably only run in CI) process.
This has not yet been realized yet, but tests that should probably be treated as integration tests or functional tests were marked with appropriate TODOs in preparation for that refactoring step. (Issue TBD)

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Base: 70.77% // Head: 71.66% // Increases project coverage by +0.88% 🎉

Coverage data is based on head (927dc22) compared to base (e0d4705).
Patch coverage: 64.28% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #335      +/-   ##
============================================
+ Coverage     70.77%   71.66%   +0.88%     
- Complexity     2150     2194      +44     
============================================
  Files           182      182              
  Lines          8025     8035      +10     
  Branches       1424     1425       +1     
============================================
+ Hits           5680     5758      +78     
+ Misses         1970     1881      -89     
- Partials        375      396      +21     
Impacted Files Coverage Δ
...kr/alpha/commons/externals/AspStandardLibrary.java 78.26% <ø> (ø)
...mmons/externals/BinaryPredicateInterpretation.java 0.00% <ø> (ø)
...xternals/BindingMethodPredicateInterpretation.java 11.11% <ø> (ø)
...c/tuwien/kr/alpha/commons/externals/Externals.java 8.57% <ø> (ø)
.../commons/externals/IntPredicateInterpretation.java 50.00% <ø> (ø)
...commons/externals/LongPredicateInterpretation.java 0.00% <ø> (ø)
...mmons/externals/MethodPredicateInterpretation.java 15.78% <ø> (ø)
...s/externals/NonBindingPredicateInterpretation.java 33.33% <ø> (ø)
...ons/externals/SuppliedPredicateInterpretation.java 0.00% <ø> (ø)
...ommons/externals/UnaryPredicateInterpretation.java 0.00% <ø> (ø)
... and 42 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@madmike200590
Copy link
Collaborator Author

@AntoniusW This has been open for a long while, and I'd really like to get it merged. Could you please take a look?

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.

1 participant