Testing And Coverage Assignment

From Foss2Serve
Revision as of 18:08, 8 March 2017 by ADalal (Talk | contribs)
Jump to: navigation, search
Title

Testing and Coverage Assignment

Overview

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

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.

Learning Objectives

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.

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 and README.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:

Knowledge Area/Knowledge Unit

Software Engineering / SE Software Verification Validation

Topic

Unit Testing, Test Coverage, Bug Reporting

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

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.

Materials/Environment

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

Author

Kevin Buffardi

Source

Kevin Buffardi

License

Licensed CC BY-SA 4.0



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