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

Improving the test suite #448

Open
MarieRoald opened this issue Sep 5, 2022 · 0 comments
Open

Improving the test suite #448

MarieRoald opened this issue Sep 5, 2022 · 0 comments
Labels
API design Issue for discussing design decisions

Comments

@MarieRoald
Copy link
Contributor

@yngvem and I have discussed the test suite a bit, and we have thought of some ways that might improve it. We don't need to adress all these points in one go, but we could try to be mindful about it for new additions and maybe incrementally split up the tests we have into smaller tests? What do you guys think?

Test structure

Currently, TensorLy mainly has monolithic tests that check many things at once. However, best practices are splitting large tests into smaller tests that (ideally) only test one thing at a time. This will make it easier to see what fails and what works.

Better use of fixtures

If we split the monolithic tests into smaller tests, we should probably use fixtures more actively to avoid having to rewrite the same boilerplate code for each of the smaller test functions. So, for example, we could have fixtures for the different decompositions.

Clearer separation of unit tests and integration tests

There is currently little difference between unit tests (which test a single unit of code) and integration tests (which test how several code units work together). It can be challenging to create a hard line separating the different types of tests, but it is a good strategy to be mindful of the difference and have both.

Better handling of random numbers

Currently, we use fixed random seeds. We can use pytest-randomly to get new random seeds every time we run the test suite, with the possibility to specify the seed manually and re-run the last seed from added command line arguments to the pytest command.

@MarieRoald MarieRoald added the API design Issue for discussing design decisions label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API design Issue for discussing design decisions
Projects
None yet
Development

No branches or pull requests

1 participant