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

Only testing the shape of the output, not the correctness of the output #2

Open
hanson-hschang opened this issue Jun 2, 2024 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@hanson-hschang
Copy link
Owner

https://github.com/hanson-hschang/BR2/blob/246324bb8094e7768187ffdc99195de02693ea5c/tests/test_actuation_tool.py#L29-L91

@skim0119 as shown in the link, what's the proper way of testing these operations? Currently, it is only testing the shape of the output, but not the correctness.

@hanson-hschang hanson-hschang added the help wanted Extra attention is needed label Jun 2, 2024
@hanson-hschang hanson-hschang self-assigned this Jun 2, 2024
@skim0119
Copy link
Collaborator

skim0119 commented Jun 3, 2024

Instead of random number, use some set of known_values and expected_answer.

Example: https://docs.pytest.org/en/stable/how-to/parametrize.html#pytest-mark-parametrize-parametrizing-test-functions

Typically we don't use random number for numerical test, because it is hard to debug when the test goes wrong (i.e. the test is not reproducible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants