Testing And Coverage Assignment
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | {| | + | |
− | + | {{Learning Activity Overview | |
− | + | |title= | |
Testing and Coverage Assignment | Testing and Coverage Assignment | ||
− | | | + | |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= |
− | + | ||
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= |
− | + | * 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= |
+ | }} | ||
− | === 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. | |
− | + | # 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 | |
− | + | # 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. | |
− | + | # 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 | |
− | + | # 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 === |
− | {| | + | |
− | + | {{Learning Activity Info | |
− | + | |acm unit= | |
Software Engineering / SE Software Verification Validation | Software Engineering / SE Software Verification Validation | ||
− | | | + | |acm topic= |
− | + | ||
Unit Testing, Test Coverage, Bug Reporting | 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 | Writing thorough unit tests will take intermediate knowledge of object oriented programming and discovering the existing bugs will take advanced debugging skills | ||
− | | | + | |time= |
− | + | ||
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= |
− | + | ||
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= |
− | + | ||
Kevin Buffardi | Kevin Buffardi | ||
− | | | + | |source= |
− | + | ||
Kevin Buffardi | Kevin Buffardi | ||
− | | | + | |license= |
− | + | {{License CC BY SA}} | |
− | + | }} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | [[Category: | + | [[Category:Learning Activity]] |
− | [[Category: | + | [[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:
|
Process Skills Practiced |
Directions
Students
- 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.
- 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 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.
- Keep your local repo clean -- only staging and committing the files relevant to the project tests:
ConnectXTest.cpp
andREADME.md
. Do NOT commit changes to any other files. - 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. - 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)
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 |