CPSC 480-020 Software Engineering (SE) Fall 2024

Exercise 35: Team Assert Tests Posted: Oct 22

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 Classroom Group Repository. That means there is one repo per team. Have one person create the Team in GitHub Classroom; the rest can join afterward.

I assume you are using GitHub Codespaces for the rest of this. If you are not, you must clone the repository locally.

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:

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:

The 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.