2: Advancing your skills
The code should test a specific characteristic or functionality of the package.
Because if your action does too many things at once, you have to search longer for the bug.
Unit testing is a method to communicate to various stakeholders the package requirements.
There are different flavors of unit tests that we write:
Remove Fear of Change
Reduce Development Time
When you are developing new features in a package make sure to prepare the area with unit tests for the expected behavior of the feature.
This will serve two main purposes:
vdiffrpackage allows to save vector graphics file of the expected plot outcome
ggplot2::layer_data()function to extract layer information
covrto calculate coverage
covrpageto create a summary report
When developing through a version control platform like GitHub, GitLab, Bitbucket you can automatically run your tests through CI/CD for each commit or when working with other developers via pull requests.