Optional Exercises for Section 2
Overview
Teaching: 0 min
Exercises: 45 minQuestions
What is a desirable way to measure and use test coverage?
Objectives
Further explore how to measure and use test coverage.
This episode holds some optional exercises for section 2. The exercises have an explorative nature, so feel free to go off in any direction that interests you. You will be looking at some tools that either complement or are alternatives to those already introduced. Even if you find something that you really like, we still recommend sticking with the tools that were introduced prior to this episode when you move onto other sections of the course.
Exercise: Apply to your own project(s)
Apply what you learned in this section to your own project(s). You can think of adding unit tests, add continuous integration pipelines, or measure the test coverage of your project(s) This is the time to ask any questions to your instructors or helpers.
Exercise: Branch coverage versus line coverage
For your test coverage, have a look at the concept of branch coverage as opposed to just line coverage. Which do you prefer and why?
Exercise: Desirable test coverage
Look at the projects below and see how much test coverage they have. Should 100% line (or branch) coverage always be the goal? Why or why not?
Exercise: Coverage badges
Try to add a coverage badge to the inflammation project.
Key Points