Skip to content

Simplify tests - #1164

Closed
Zhiyuan-Amos wants to merge 5 commits into
exercism:masterfrom
Zhiyuan-Amos:simplify-tests
Closed

Zhiyuan-Amos wants to merge 5 commits into
exercism:masterfrom
Zhiyuan-Amos:simplify-tests

Conversation

@Zhiyuan-Amos

@Zhiyuan-Amos Zhiyuan-Amos commented Jan 2, 2018 •

Copy link
Copy Markdown
Contributor

I've opened up an issue in exercism/problem-specifications to discuss the validity of this PR.


Reviewer Resources:

Track Policies

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.

@sjwarner-bp sjwarner-bp left a comment •

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.

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 at https://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.

@Zhiyuan-Amos

Copy link
Copy Markdown
Contributor Author

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? :)

@sjwarner-bp

Copy link
Copy Markdown
Contributor

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 🙂

@FridaTveit

Copy link
Copy Markdown
Contributor

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 :)

@FridaTveit

Copy link
Copy Markdown
Contributor

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 :)

@Zhiyuan-Amos

Copy link
Copy Markdown
Contributor Author

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() {

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.

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.

@Zhiyuan-Amos
Zhiyuan-Amos deleted the simplify-tests branch January 17, 2018 01:50
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.

3 participants