Closed kaiser-dan closed 1 year ago
@danielhankim @SiddharthP96 This is not a priority, but if you have some time could you two take a look at writing some tests?
@kaiser-dan So you want us to verify your submodule codes right?
Yes please, that would be helpful
@kaiser-dan In which place would you mind if I make an additional directory for saving test codes? I'm trying to use the pytest
.
Currently, I made a new branch for unit tests and doing some stuff by making a new directory unit_test
under src
. Meanwhile, I don't have a nice understanding on what a unit test is lol. I would be glad if you can give me a brief guideline :)
Currently, I made a new branch for unit tests and doing some stuff by making a new directory
unit_test
undersrc
. Meanwhile, I don't have a nice understanding on what a unit test is lol. I would be glad if you can give me a brief guideline :)
Sure thing; I found the geeksforgeeks article on unit testing a useful read with its workflow diagrams.
Effectively, we are looking to build here code that checks if individual components of the code perform as expected on some baseline cases we already know the answer to. If a single function returns the expected result, basically. If the individual components are correct, it adds confidence in the overall workflow. There is a testing paradigm known as "integration testing" that tests specifically that the interactions of functions is working, but generally one want to make sure that all of the parts are correctly implemented before the system as a whole is.
What is the task Create a test suite for the source code.
Describe how the task contributes to the project So far a couple bugs have been found throughout the project that have thrown results into question - as the source code grows in complexity, it may be time to consider "real" unit tests.
Describe the solution you imagine A collection of unit tests for each core functionality in
src/
submodules. At the time of writing, this includes:snowballutilscorrelationsparameterspowerlawsremnantsAdditional remarks I personally am not partial to either the standard library
unittest
or the more popularpytest
, though perhaps pytest is "easier"?