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

[FEATURE]: Refactor test suite that covers private tests #242

Closed
5 tasks done
tomvothecoder opened this issue May 26, 2022 · 0 comments
Closed
5 tasks done

[FEATURE]: Refactor test suite that covers private tests #242

tomvothecoder opened this issue May 26, 2022 · 0 comments
Assignees
Labels
type: enhancement New enhancement request

Comments

@tomvothecoder
Copy link
Collaborator

Feature Request Criteria

  • Feature is not implemented by xarray
  • Feature is not implemented by another actively developed xarray-based package
  • Feature is not limited to specific use cases (e.g., data quality issues)
  • Feature is generally reusable
  • Feature is relatively simple and lightweight to implement and use

Is your feature request related to a problem?

The test suite includes tests for private methods and functions.

Per my comment here #236 (comment):

I learned that testing private methods is unnecessary and introduces coupling to the implementation details, which breaks encapsulation. It makes refactoring significantly more tedious because the tests for the private methods need to also be updated (also risk of test duplication with public methods). Instead, tests should revolve around public methods and their behaviors/outputs.

More info on why testing private methods is considered "bad" practice:
https://softwareengineering.stackexchange.com/a/380296
https://stackoverflow.com/questions/105007/should-i-test-private-methods-or-only-public-ones

Describe the solution you'd like

Update tests for public APIs to cover tests for private APIs, and then remove the private API tests.

Describe alternatives you've considered

No response

Additional context

No response

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

No branches or pull requests

1 participant