Coding project 1
Contents
3. Coding project 1#
3.1. Contributing to an open source package: unit tests#
See https://github.com/statlab/permute and https://statlab.github.io/permute/
Clone https://github.com/statlab/permute to your own device or to datahub. Set upstream to be a repository within your Berkeley Github repo for Stat 240.
Look at the code coverage for the latest build, https://app.codecov.io/gh/statlab/permute
Identify at least one function that does not have complete test coverage.
Fork your
permute
main branch to make a testing branchWrite a unit test that exercises functionality that was not previously tested. Document your unit test using an appropriate docstring that follows PEP8 (https://peps.python.org/pep-0008/) and PEP257 (https://peps.python.org/pep-0257/)
Verify that your test increases the coverage, using covecov. Github automation can be configured to run codecov whenever you push your branch and/or make a pull request. That’s how it’s set up at https://github.com/statlab/permute
When everything is verified, make a pull request at https://github.com/statlab/permute to have your test included in the package. Congratulations! You’ve made a pull request for an open source project! If the moderator approves your pull request, you will be listed as a contributor.
Bonus: find one or more existing unit tests in
permute
that do not exercise the code well and write better unit tests to replace them. Verify that you have not decreased the coverage. Make a pull request to the project once you have verified everything.