Repository navigation
Simplify tests - #1164
Simplify tests#1164Zhiyuan-Amos wants to merge 5 commits into
Conversation
These tests are already covered by the test testIdenticalWordIsNotAnagram().
This test is already covered by the test testDoesNotConfuseDifferentDuplicates().
This test is already covered by the test testDetectMultipleAnagramsForLongerWord().
This test is testing for too many parameters, when it should only test that identical words of different cases do not count as anagrams. Let’s simplify the list of anagrams that’s being tested with the anagram subject.
Existing tests verify that anagrams are detected when: 1. Only the subject begins with uppercase letter 2. Only the anagram begins with uppercase letter 3. Both the anagram & subject begins with uppercase letter These tests don't seem to add much value to the existing suite of tests. Let's remove these 3 tests and replace it with a higher difficulty test which verifies that mixed case letters anagrams are being detected.
There was a problem hiding this comment.
We try and mirror the canonical-data.json in the problem-specifications closely, to allow a better cross-track consistency.
If you believe some of these tests are excessive, I would suggest raising the issue there, so that all tracks may be subject to the change 🙂
Edit:
This information can be found in CONTRIBUTING.md:
- Check if there is canonical data for the exercise you're adding.
This can be found athttps://github.com/exercism/problem-specifications/tree/master/exercises/EXERCISE-SLUG/canonical-data.json.
If there is canonical data for your exercise then you should follow this when making the tests.
We aim to follow the canonical data as closely as possible in our tests to ensure thorough test coverage.
|
Yup, I've raised an issue in the other repo, but I was quite brief in the issue description because I thought that it would be much more descriptive to have both the changes made to the code together with the commit messages, instead of just trying to elaborate everything in text. How should I better go about this then? :) |
|
Once the issue has been resolved in problem-specifications, we can see the outcome of that issue and then begin to apply changes (if any) here 🙂 That is unless the rest of @exercism/java have a better idea 🙂 |
|
I agree with @sjwarner-bp :) Once the issue has been resolved in problem-specifications we can update our tests to match any changes made to the canonical data :) |
|
So if it's okay with you @Zhiyuan-Amos we should probably close this PR for now? It can take a while before problem-specification issues get resolved since they impact many tracks and therefore changes impact many people. Feel free to reopen this PR or make a new one once the problem-specifications issue has been resolved and the canonical data updated :) |
|
Yes sure! Didn't know that it will take a while for problem-specification issues to be resolved. Thank you :) |
|
|
||
| @Ignore("Remove to run test") | ||
| @Test | ||
| public void testDetectMultipleAnagrams() { |
There was a problem hiding this comment.
Note to self: This commit should be deleted because there's a difference between both tests. testDetectMultipleAnagrams() actually test for 2 matching anagrams, while testDetectMultipleAnagramsForLongerWord() test for 3 matching anagrams. As such, we should rename the method names instead for clarity.
I've opened up an issue in exercism/problem-specifications to discuss the validity of this PR.
Reviewer Resources:
Track Policies