Test Coverage Activity
m |
|||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | {| | + | |
− | + | {{Learning Activity Overview | |
− | + | |title= | |
Automated testing and test coverage activity | Automated testing and test coverage activity | ||
− | | | + | |overview= |
− | + | ||
Participants run the automated tests for a project, view the resulting coverage | Participants run the automated tests for a project, view the resulting coverage | ||
report, and interpret and understand the results in class. | report, and interpret and understand the results in class. | ||
− | | | + | |prerequisites= |
− | + | ||
Have cloned and set up a development environment for a project. | Have cloned and set up a development environment for a project. | ||
− | | | + | |objectives= |
− | + | ||
Participant will be able to run a projects automated tests, review its coverage | Participant will be able to run a projects automated tests, review its coverage | ||
report, and understand their importance to a project. | report, and understand their importance to a project. | ||
− | |} | + | |process skills= |
+ | }} | ||
− | === Background | + | === Background === |
Automated tests, and test coverage results, are an important measure of code | Automated tests, and test coverage results, are an important measure of code | ||
Line 25: | Line 23: | ||
importance. | importance. | ||
− | === Directions | + | === Directions === |
− | ==== Instructor | + | ==== Instructor ==== |
Demonstrate how to run automated tests on a project and generate coverage data. | Demonstrate how to run automated tests on a project and generate coverage data. | ||
− | ==== Students | + | ==== Students ==== |
# [at home] Run its automated tests and view its coverage results. | # [at home] Run its automated tests and view its coverage results. | ||
Line 41: | Line 39: | ||
#* 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? | #* 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 | + | === Deliverables === |
A screen shot of the automated test results. | A screen shot of the automated test results. | ||
− | === Assessment | + | === Assessment === |
− | A quick inspection that the students successfully ran the automated tests for | + | A quick inspection that the students successfully ran the automated tests for the project. |
− | the project. | + | |
− | === Comments | + | === Comments === |
=== Additional Information: === | === Additional Information: === | ||
− | {| | + | |
− | + | {{Learning Activity Info | |
− | + | |acm unit= | |
− | + | Software Engineering | |
− | | | + | |acm topic= |
− | + | ||
Testing and test coverage | Testing and test coverage | ||
− | | | + | |difficulty= |
− | + | ||
Setting up and running a project can be medium to hard depending on the project. | 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. | Running the tests is easy to medium depending on the project. | ||
− | | | + | |time= |
− | + | Depending on the project and the number of automated tests it has, | |
− | Depending on the project and the | + | running the tests may take quite some time (hours). |
− | running the tests may take quite some time (hours). The discussion will probably | + | The discussion will probably be about 20 minutes. |
− | be about 20 minutes. | + | |environment= |
− | | | + | |
− | + | ||
Need an HFOSS project and its development enviornment set up. | Need an HFOSS project and its development enviornment set up. | ||
− | | | + | |author= |
− | + | ||
Stoney Jackson | Stoney Jackson | ||
− | | | + | |source= |
− | + | ||
Stoney Jackson | Stoney Jackson | ||
− | | | + | |license= |
− | + | {{License CC BY SA}} | |
− | + | }} | |
− | + | ||
− | + | ||
=== Suggestions for the Open Source Project: === | === Suggestions for the Open Source Project: === | ||
Line 94: | Line 83: | ||
* MouseTrap | * MouseTrap | ||
− | + | [[Category:Learning Activity]] | |
− | + | [[Category:Quality and Testing]] | |
− | [ | + | [[Category:Minimal Sketch]] |
− | + | ||
− | + | ||
− | [ | + | |
− | + | ||
− | [[Category: | + | |
− | [[Category: | + |
Latest revision as of 12:12, 8 September 2018
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. |
Prerequisites |
Have cloned and set up a development environment for a project. |
Learning Objectives |
After successfully completing this activity, the learner should be able to:
Participant will be able to run a projects automated tests, review its coverage report, and understand their importance to a project. |
Process Skills Practiced |
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
Instructor
Demonstrate how to run automated tests on a project and generate coverage data.
Students
- [at home] Run its automated tests and view its coverage results.
- [at home] Record the coverage results, and which files are least covered. Take a screen shot.
- [in class] Report on their project and its coverage.
- [in 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.
Comments
Additional Information:
ACM BoK Area & Unit(s) |
Software Engineering |
---|---|
ACM BoK Topic(s) |
Testing and test coverage |
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. |
Estimated Time to Complete |
Depending on the project and the number of automated tests it has, running the tests may take quite some time (hours). The discussion will probably be about 20 minutes. |
Environment / Materials |
Need an HFOSS project and its development enviornment set up. |
Author(s) |
Stoney Jackson |
Source |
Stoney Jackson |
License |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License |
Suggestions for the Open Source Project:
Any project that uses an automated test framework that can produce coverage data. For example, on GitHub, a project that has a coverage badge in their REAME that displays what percent of the project is covered by tests would fit the bill. Here are a couple HFOSS projects that use automated tests. Most do.
- OpenMRS
- MouseTrap