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

Feat/exercises-for-testing-session #32

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions sessions/testing.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ These checks verify that the package has:

among other things.

To-Do: Explain the output of a CRAN check
TODO: Explain the output of a CRAN check

## Exercise: Create your first unit test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we would go through creating a unit test first, and then they do it again on their own time. So it could be something like "Write a unit test to check for ABC". The exact details don't matter too much, as long as there is a general structure or steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This first exercise could even be something like "Review these example unit tests and identify the individual parts within and find out if they work as intended or not". So it could be more of a code reading exercise.


## exercise

Complete these tasks as part of the package for your first project
assignment. Refer to the project assignment TODO: Add ref to assignment
Expand Down Expand Up @@ -151,7 +152,7 @@ task, and pushing to GitHub.
TODO: Reading text
:::

## Exercise: TODO: Add title
## Exercise: TODO: Create unit tests for the remaining functions in your package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit too generic. It ideally would be a clear, explicit aim. If the first exercise is a code reading exercise, this one could be to create another unit test to check for some condition. Or even include a first task to ask them to select which condition to test for and then test it.


> Time: \## minutes.

Expand All @@ -161,6 +162,19 @@ TODO: Reading text
#| code-summary: "**Click for the solution**. Only click if you are struggling or are out of time."
```

TODO: Reading text

## Exercise: TODO: Run a CRAN check on the package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said above, we would ideally run this with them the first time. The exercise would be to do it on their own, after doing some changes or improving things.


> Time: \## minutes.

```{r solution-LABEL}
#| eval: false
#| code-fold: true
#| code-summary: "**Click for the solution**. Only click if you are struggling or are out of time."
```


## Summary

- TODO: List of summary items