ArtLabss / open-data-anonymizer

Python Data Anonymization & Masking Library For Data Science Tasks
https://www.artlabs.tech
BSD 3-Clause "New" or "Revised" License
234 stars 29 forks source link

[FEAUTRE] Automated Testing #2

Closed schackartk closed 2 years ago

schackartk commented 2 years ago

Is your feature request related to a problem? Please describe. Thank you for developing this interesting package! However, I think the package would greatly benefit from testing. The two main reasons are:

  1. To give confidence in the package. Claimed features should be proven with tests.
  2. To make contribution possible. Without tests, how do I know if I have broken some current functionality when I add my own feature?

Describe the solution you'd like At a a minimum unit and integration tests should be implemented. Unit tests should ensure that functions and methods behave as expected. Pass in a value and check that the correct output is created. Integration tests should ensure that, from a user's standpoint, the functions in your package are doing what they should.

Testing is commonly implemented using the pytest package.

To be extra safe, static code checking should be done, for instance using pytest-flake8, and pytest-mypy for static type checking. These can catch hidden bugs before they become a problem. Additionally, adding pytest-pylint would ensure that contributors format their code well.

Describe alternatives you've considered There is no alternative to testing. However, there are a few packages to implement it aside from pytest, such as Robot and unittest.

Additional context This package is related to privacy, so it is critical that users can be confident in the product. I gain confidence in a package by seeing what claims are being substantiated by passing tests. If there isn't a test for it, I assume the feature cannot yet be trusted.

As it stands, I also would not be able to contribute (e.g. refactoring for efficiency) because I cannot be sure that I am not breaking current functionality.

shukkkur commented 2 years ago

@schackartk Hey, thank you for opening this issue and proposing a feature for improving our package! Yep, adding tests would definitely add some reliability to the package. Will work on that for sure. Greatly appreciated!

shukkkur commented 2 years ago

Tests for anonympy/pandas have been added, commit.