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

Reorganize unit test files to match the structure of the code under test #498

Open
dylanahsmith opened this issue Jun 11, 2021 · 0 comments
Labels

Comments

@dylanahsmith
Copy link
Contributor

Currently, it is hard to determine where a test should go, since a lot of the test files are organized around overlapping features, resulting in multiple places that could seem like the right place for the tests.

This disorganization can make it harder to:

  • find where to put a new test
  • notice duplicate tests
  • determine if a code path is tested
  • run the relevant tests for a code change

I think this disorganization largely came from the disorganization of the code under test (#497).

Instead, tests for a code path in the code under test belongs in a test file with a corresponding name and in a test name prefixed with a corresponding test name prefix. Note that a test can be for a code path in a method without directly calling it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant