TR 3:30 - 4:45 pm Arts & Sciences (CAS) 134
Week 9 Class 17 Tue Oct 20 Posted: Oct 20
Announcements
Professional CMake: A Practical Guide by Craig Scott is the best book on CMake for developers. Besides just covering the CMake features, it also has sections in each chapter with good practices and practical advice. One of the best books of its kind. It was a textbook for CPSC 489-010 T: DevOps in Spring 2024.
The first 5 chapters are a free download.
So take a look for any questions on cmake.
Class
Exercise 38: AddTest
Fix the code so that both tests pass. Make sure to commit this separately.
Then, add another single unit test following the style and formatting of the previous unit tests.
Make sure it passes all the tests before you commit.
Unless stated otherwise, all exercises are due by 4 pm on Wed Oct 21
The project, Vector Angle, calculates the degree angle between two vectors. It uses the function dotProduct(). It also includes a test program dotProductTest.cpp.
As you recall, white-box testing is testing (creating test cases) that knows the structure of the code because it knows the implementation. The test program dotProductTest.cpp includes a single test case using a separate block and an assert().
Your assignment is to add test cases to the file dotProductTest.cpp and get the tests to run successfully.
The repository for this assignment is a GitHub group repository. That means there is one repo per team. Assert Tests Invitation Link
First, build the program:
Then, run the program:
The test program is a separate executable, dotProductTest. To run the test program, there is a target, test. So run the test program:
For this assignment, add tests so that when the complete test program is run, all of the code in dotProduct() is run at least once. This would be 100% code coverage.
The workflow is:
Keep in mind the following:
git push for the other team members to see your test case.I encourage as many team members as possible to commit a test case. If using GitHub Codespaces, each team member has their own codespace. After a team member has entered a test case, the rest can use a git pull.
Add test cases one at a time to prevent merge issues.
Each team member must submit notes, including for each test case (not just their own):
dotProduct() and does not include empty lines or comment lines.dotProduct() by this test caseThe notes and commits of each team member are due by the end of the class, along with the test cases. Your score is based on the notes and commits in the team repository.
TA: Mr. Hayden Cowan hc138@uakron.edu