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

Implement accuracy report tests using JUnit @TestFactory #4

Open
Marcono1234 opened this issue Sep 22, 2024 · 0 comments
Open

Implement accuracy report tests using JUnit @TestFactory #4

Marcono1234 opened this issue Sep 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Marcono1234
Copy link
Owner

Consider implementing AbstractLanguageDetectionAccuracyReport using JUnit's @TestFactory.

Advantages:

  • Reduces a lot of code duplication which currently exists for all AbstractLanguageDetectionAccuracyReport implementations
    Instead could have a @TestFactory which creates a JUnit DynamicContainer for each language, containing DynamicContainer for the test variants (word, sentence, ...) and then DynamicTest for each input. In AbstractLanguageDetectionAccuracyReport it would then only be necessary to define the list of languages to test (or all?), and then automatically get their language code and the corresponding test data.

Disadvantages:

  • Might make merging upstream changes lightly more difficult (?)
  • Cannot easily run tests for individual languages anymore
    However, could consider adding system properties or similar which determine the detector and language, similar to the current existing logic in build.gradle.kts.
@Marcono1234 Marcono1234 added the enhancement New feature or request label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant