Test Coverage Activity

From Foss2Serve
(Difference between revisions)
Jump to: navigation, search
(Initial draft)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 
{| border="1"
 
{| border="1"
 
|-  
 
|-  
|'''Title''' ||
+
|'''Title''' ||
 
Automated testing and test coverage activity
 
Automated testing and test coverage activity
|-
+
|-    
|'''Overview''' ||
+
|'''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.
|-
 
|'''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''' ||
 
|'''Prerequisite Knowledge''' ||
 
Have cloned and set up a development environment for a project.
 
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''' ||
 
|'''Learning 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.
|-
 
|'''Materials/Environment''' ||
 
Need an HFOSS project and its development enviornment set up.
 
|-
 
|'''License''' ||
 
Licensed CC BY-SA 4.0
 
 
|}
 
|}
 
  
 
=== Background: ===
 
=== Background: ===
Line 54: Line 27:
 
=== Directions: ===
 
=== Directions: ===
  
Instructors:
+
==== Instructor: ====
  
At home
+
Demonstrate how to run automated tests on a project and generate coverage data.
  
# [home] Run its automated tests and view its coverage results.
+
==== Students: ====
# [home] Record the coverage results, and which files are least covered. Take a screen shot.
+
 
# [class] Report on their project and its coverage.
+
# [at home] Run its automated tests and view its coverage results.
# [class] Discuss
+
# [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?
 
#* 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?
 
#* 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?
 
#* 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: ===
Line 75: Line 49:
 
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: ===
 +
 +
=== Additional Information: ===
 +
{| border="1"
 +
|-
 +
|'''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.
 +
|-
 +
|'''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.
 +
|-
 +
|'''Materials/Environment''' ||
 +
Need an HFOSS project and its development enviornment set up.
 +
|-
 +
|'''Author''' || 
 +
Stoney Jackson
 +
|-
 +
|'''Source''' ||
 +
Stoney Jackson
 +
|-
 +
|'''License''' ||
 +
Licensed CC BY-SA 4.0
 +
|}
 +
 +
 +
=== 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
  
 
--------------------
 
--------------------
 
This work is licensed under a  
 
This work is licensed under a  
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]
+
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons
 +
Attribution-ShareAlike 4.0 International License]
  
 
[[File:CC_license.png]]
 
[[File:CC_license.png]]
Line 84: Line 103:
 
[[Category: Learning_Activity]]
 
[[Category: Learning_Activity]]
 
[[Category: Quality_and_Testing]]
 
[[Category: Quality_and_Testing]]
 +
[[Category: Minimal Sketch]]

Latest revision as of 17:39, 8 March 2017

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.

Prerequisite Knowledge

Have cloned and set up a development environment for a project.

Learning Objectives

Participant will be able to run a projects automated tests, review its coverage report, and understand their importance to a project.

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:

  1. [at home] Run its automated tests and view its coverage results.
  2. [at home] Record the coverage results, and which files are least covered. Take a screen shot.
  3. [in class] Report on their project and its coverage.
  4. [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:

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.

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.

Materials/Environment

Need an HFOSS project and its development enviornment set up.

Author

Stoney Jackson

Source

Stoney Jackson

License

Licensed CC BY-SA 4.0


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

This work is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]

CC license.png

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox