Skip to content

grade-school: remove potential test pollution #371

Closed

Description

@jtigger

The grade-school exercise creates a single instance of School and uses it through the entire test suite. The suite has deftly avoided test pollution by leaning on deterministic test ordering and using different grades in each test. This sets a bad example of how to organize tests: each test should be isolated from the others so as to avoid false negatives (test failures when there is no corresponding defect in the code) and false positives (tests passing when a defect exists but is covered up by side-effects of earlier tests).

Please move the construction of School into a setUp() method.

Activity

  1. rado-radoev commented on Mar 10, 2017

    @rado-radoev
    Contributor

    Hi @jtigger , I am learning Java now and I am just starting to contribute to GitHub projects, but if you don't mind I would like to take a shot at this.

  2. added a commit that references this issue on Mar 10, 2017
  3. jtigger commented on Mar 20, 2017

    @jtigger
    ContributorAuthor

    I'm delighted you're digging in, @superklamer. Your PR looks good (included some rebase help, there). Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions