Testing And Coverage Assignment

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
{| border="1"
+
 
|-
+
{{Learning Activity Overview
|'''Title''' || 
+
|title=
 
Testing and Coverage Assignment
 
Testing and Coverage Assignment
|-   
+
|overview=
|'''Overview''' || 
+
 
Participants write unit tests (in GoogleTest) to identify bugs in a C++ class
 
Participants write unit tests (in GoogleTest) to identify bugs in a C++ class
|-
+
|prerequisites=
|'''Prerequisite Knowledge''' ||
+
 
Students need to have installed and programmed unit tests with GoogleTest. They should also know how to run a coverage analyzer and interpret its results. Intermediate knowledge of Git version control is required.
 
Students need to have installed and programmed unit tests with GoogleTest. They should also know how to run a coverage analyzer and interpret its results. Intermediate knowledge of Git version control is required.
|-
+
|objectives=
|'''Learning Objectives''' ||
+
* Write unit tests.
Students should write unit tests and use a coverage analysis tool to identify test cases they may be missing and to reflect over possible errors in the code.
+
* Use a coverage analysis tool to identify test cases they may be missing and to reflect over possible errors in the code.
|}
+
|process skills=
 +
}}
  
=== Directions: ===
+
=== Directions ===
  
==== Students: ====
+
==== Students ====
  
*You were just hired by ''GameTastic''. They outsourced the work to start development of '''ConnectX''', a variation of the board game "[https://en.wikipedia.org/wiki/Connect_Four Connect Four]." However, when they discovered that their outsourced workers were not following Test-Driven Development, they decided to hire new developers including you. They have tasked you to test the code already written and identify any bugs that already exist. Before going any further, they want to be confident in the code.
+
# You were just hired by ''GameTastic''. They outsourced the work to start development of '''ConnectX''', a variation of the board game "[https://en.wikipedia.org/wiki/Connect_Four Connect Four]." However, when they discovered that their outsourced workers were not following Test-Driven Development, they decided to hire new developers including you. They have tasked you to test the code already written and identify any bugs that already exist. Before going any further, they want to be confident in the code.
*Use your knowledge of how to write unit tests and assessing the quality of testing to write sufficient tests so the team can be confident that your tests will identify any problems.
+
# Use your knowledge of how to write unit tests and assessing the quality of testing to write sufficient tests so the team can be confident that your tests will identify any problems.
*Fork the [https://github.com/kbuffardi/ConnectX ConnectX repo] into your own GitHub space
+
# Fork the [https://github.com/kbuffardi/ConnectX ConnectX repo] into your own GitHub space
*Clone the fork onto your computer. For this test, you should commit changes to your computer locally, but do not push any of your commits to the fork until instructed to do so by the instructor.
+
# Clone the fork onto your computer. For this test, you should commit changes to your computer locally, but do not push any of your commits to the fork until instructed to do so by the instructor.
*Keep your local repo clean -- only staging and committing the files relevant to the project tests: <code>ConnectXTest.cpp</code> and <code>README.md</code>. Do NOT commit changes to any other files.
+
# Keep your local repo clean -- only staging and committing the files relevant to the project tests: <code>ConnectXTest.cpp</code> and <code>README.md</code>. Do NOT commit changes to any other files.
*In <code>README.md</code>, put your name and in bullet-list form, note any bugs you discover. Describe the bugs with enough detail that another developer can start fixing them.
+
# In <code>README.md</code>, put your name and in bullet-list form, note any bugs you discover. Describe the bugs with enough detail that another developer can start fixing them.
*Do not actually fix the bugs, you will only send your bug report to another developer on the team
+
# Do not actually fix the bugs, you will only send your bug report to another developer on the team
*Have your work completed and committed locally on your computer (and ready to push, but not yet pushed) by ''(deadline)''
+
# Have your work completed and committed locally on your computer (and ready to push, but not yet pushed) by ''(deadline)''
  
=== Deliverables: ===
+
=== Deliverables ===
  
 
A fork of the ConnectX repository, with added tests and documentation of found bugs
 
A fork of the ConnectX repository, with added tests and documentation of found bugs
  
=== Assessment: ===
+
=== Assessment ===
  
 
Grades will be based on the following specifications:
 
Grades will be based on the following specifications:
Line 74: Line 73:
 
|}
 
|}
  
=== Additional Information: ===
+
=== Additional Information ===
{| border="1"
+
 
|-
+
{{Learning Activity Info
|'''Knowledge Area/Knowledge Unit''' || 
+
|acm unit=
 
Software Engineering / SE Software Verification Validation
 
Software Engineering / SE Software Verification Validation
|-
+
|acm topic=
|'''Topic''' || 
+
 
Unit Testing, Test Coverage, Bug Reporting
 
Unit Testing, Test Coverage, Bug Reporting
|-
+
|difficulty=
|'''Level of Difficulty''' || 
+
 
Writing thorough unit tests will take intermediate knowledge of object oriented programming and discovering the existing bugs will take advanced debugging skills
 
Writing thorough unit tests will take intermediate knowledge of object oriented programming and discovering the existing bugs will take advanced debugging skills
|-
+
|time=
|'''Estimated Time to Completion''' ||
+
 
The assignment should take from 1-3 hours of work and is recommended as an equivalent to a relatively small programming assignment.
 
The assignment should take from 1-3 hours of work and is recommended as an equivalent to a relatively small programming assignment.
|-
+
|environment=
|'''Materials/Environment''' ||
+
 
Need to have a working C++ development environment with GoogleTest and gcov installed
 
Need to have a working C++ development environment with GoogleTest and gcov installed
|-
+
|author=
|'''Author''' || 
+
 
Kevin Buffardi
 
Kevin Buffardi
|-
+
|source=
|'''Source''' ||
+
 
Kevin Buffardi
 
Kevin Buffardi
|-
+
|license=
|'''License''' ||
+
{{License CC BY SA}}
Licensed CC BY-SA 4.0
+
}}
|}
+
 
+
 
+
--------------------
+
This work is licensed under a
+
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]
+
 
+
[[File:CC_license.png]]
+
  
[[Category: Learning_Activity]]
+
[[Category:Learning Activity]]
[[Category: Quality_and_Testing]]
+
[[Category:Quality and Testing]]
[[Category: Good Draft]]
+
[[Category:Good Draft]]

Revision as of 12:22, 8 September 2018


Title

Testing and Coverage Assignment

Overview

Participants write unit tests (in GoogleTest) to identify bugs in a C++ class

Prerequisites

Students need to have installed and programmed unit tests with GoogleTest. They should also know how to run a coverage analyzer and interpret its results. Intermediate knowledge of Git version control is required.

Learning
Objectives
After successfully completing this activity, the learner should be able to:
  • Write unit tests.
  • Use a coverage analysis tool to identify test cases they may be missing and to reflect over possible errors in the code.
Process Skills
Practiced


Directions

Students

  1. You were just hired by GameTastic. They outsourced the work to start development of ConnectX, a variation of the board game "Connect Four." However, when they discovered that their outsourced workers were not following Test-Driven Development, they decided to hire new developers including you. They have tasked you to test the code already written and identify any bugs that already exist. Before going any further, they want to be confident in the code.
  2. Use your knowledge of how to write unit tests and assessing the quality of testing to write sufficient tests so the team can be confident that your tests will identify any problems.
  3. Fork the ConnectX repo into your own GitHub space
  4. Clone the fork onto your computer. For this test, you should commit changes to your computer locally, but do not push any of your commits to the fork until instructed to do so by the instructor.
  5. Keep your local repo clean -- only staging and committing the files relevant to the project tests: ConnectXTest.cpp and README.md. Do NOT commit changes to any other files.
  6. In README.md, put your name and in bullet-list form, note any bugs you discover. Describe the bugs with enough detail that another developer can start fixing them.
  7. Do not actually fix the bugs, you will only send your bug report to another developer on the team
  8. Have your work completed and committed locally on your computer (and ready to push, but not yet pushed) by (deadline)

Deliverables

A fork of the ConnectX repository, with added tests and documentation of found bugs

Assessment

Grades will be based on the following specifications:

 50% Unit tests are written correctly and logically
 30% Testing thoroughly assesses the code
 10% At least one bug in the code is discovered (there are two related intentional bugs in the existing code)
 10% Instructions followed precisely
 EXTRA CREDIT: Bugs are identified correctly and described clearly
Criteria Level 1 (poor) Level 2 (fair) Level 3 (excellent)
Unit tests (50%) Tests not adequately set up nor separated into individual test functions that each check one specific case Unit tests generally follow the correct format but do not follow all conventions such as poorly-named functions or a test function really checking multiple cases Unit tests are organized in a collection of test functions which each test specific cases and each test has appropriate input, output, and assertions
Testing thoroughness (30%) The unit tests does not exercise each function of the program The unit tests execute each function but does not check each condition of control statements (if, else, etc) The unit tests exercise each line of code and follow each branch of control statements
Bug discovery (10%) No bugs are identified At least one bug has been identified but are not described accurately and precisely both by failing tests and in the documentation Failing tests indicate where the code does not operate as described and documentation accurately describes the bugs
Instructions (10%) The submission did not follow the instructions correctly to fork the repository and pull request made only when instructed by the teacher The student followed the general instructions but made minor mistakes, such as copying the repo locally rather than forking it Instructions were followed accurately and precisely


Additional Information

ACM BoK
Area & Unit(s)

Software Engineering / SE Software Verification Validation

ACM BoK
Topic(s)

Unit Testing, Test Coverage, Bug Reporting

Difficulty

Writing thorough unit tests will take intermediate knowledge of object oriented programming and discovering the existing bugs will take advanced debugging skills

Estimated Time
to Complete

The assignment should take from 1-3 hours of work and is recommended as an equivalent to a relatively small programming assignment.

Environment /
Materials

Need to have a working C++ development environment with GoogleTest and gcov installed

Author(s)

Kevin Buffardi

Source

Kevin Buffardi

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

CC license.png

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