Test Coverage Activity
Title |
Automated testing and test coverage activity |
Overview |
Participants run the automated tests for a project, view the resulting coverage report, and interpret and understand the results in class. |
Author |
Stoney Jackson |
Source |
Stoney Jackson |
Knowledge Area/Knowledge Unit |
Softward Engineering |
Topic |
Testing and test coverage |
Level of Difficulty |
Setting up and running a project can be medium to hard depending on the project. Running the tests is easy to medium depending on the project. |
Prerequisite Knowledge |
Have cloned and set up a development environment for a project. |
Estimated Time to Completion |
Depending on the project and the ammount of automated tests the project has, running the tests may take quite some time (hours). The discussion will probably be about 20 minutes. |
Learning Objectives |
Participant will be able to run a projects automated tests, review its coverage report, and understand their importance to a project. |
Materials/Environment |
Need an HFOSS project and its development enviornment set up. |
License |
Licensed CC BY-SA 4.0 |
Contents |
Background:
Automated tests, and test coverage results, are an important measure of code quality. They are also important for long term maintainability of code. This activity gives students the opportunity to run a project's automated tests, view its test coverage result, and properly interpret that number and its importance.
Directions:
Instructors:
At home
- [home] Run its automated tests and view its coverage results.
- [home] Record the coverage results, and which files are least covered. Take a screen shot.
- [class] Report on their project and its coverage.
- [class] Discuss
- How important it is (or isn't) to have 100% coverage and why?
- What does the coverage number mean? How should one interpret it? What does it say about the code?
- Imagine that you need to make a change to the code. What does the coverage number, and automated tests, mean to you as a developer?
Deliverables:
A screen shot of the automated test results.
Assessment:
A quick inspection that the students successfully ran the automated tests for the project.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License