CPSC 480-020 Software Engineering (SE) Fall 2025

Exercise 48: Team Mock Clock III Posted: Nov 06

If you haven't completed the previous Mock Clock exercise, do so before completing this one.

A team member created an issue in your repository. You have been asked to add a test for this issue. Go to the Issues for your repository at GitHub and read it.

Session Testing

Record In your notes, explain why you cannot practically write a test for this issue without using dependency inversion.

Session Testing with DIP

  1. Move to the branch dip. Verify that you are on the correct branch.
  2. As you work on this branch, record a list of git commands you entered. Order does not matter, and you don't have to repeat them.
  3. Create a new Clock in the files Issue2Clock.hpp and Issue2Clock.cpp, and a test program in the file SessionIssue2Test.cpp. You will need to add these files so that Git will version control them: Do not commit yet.
  4. There is a pull request for the branch dip that has an updated version of CMakeLists.txt that knows about the SessionIssue2Test files. At GitHub, accept that pull request. You will then need to git pull to see the changes in your clone repository in the branch dip.

  5. Create a minimal test program in SessionIssue2Test.cpp. This body of the main should be assert(false) with a return. Make sure the test builds and runs, but it will fail.
  6. Complete the verification with the test program and the new clock.
  7. Commit your work with the commit message:

Session Testing with DIP and Mock

As you work on this branch, record a list of git commands you entered. Order does not matter, and you don't have to repeat them.

Repeat the Session Testing with DIP, but this time on the branch mock. Note the following:

Commit your work with the commit message: