TR  2:00 - 3:15 pm (CAS) 134
Week 11 Class 21 Thu Nov 07 Posted: Nov 07
After Class
Announcements
Project 3: Code Analysis TDD Deadline 2 feedback in Exercise 46 and Report2.md.
Stop doing the following:
if
Team Exercises
touch
, cd
, are not Git commandsGit push
is not a Git commandClass
Unless stated otherwise, all exercises are due by 3 pm on Fri Nov 08
In this exercise, you will go through a workflow to perform a refactoring. The overall process includes:
The following workflow must be followed to receive credit. Use the same commit messages as shown.
main
, you are going to work on the branch issue_n_ where n is the issue number, e.g., if the issue number is 1 then the branch name is issue1
. First, make sure you are in the branch main
. Then, create the branch:
Branches can be created via GitHub. However, please create this issue via the command line.Report For your report of the following, keep a list of all the git commands you enter. Keep them in order. Do not put any name, title, etc. For commits, enter the git commit short hash (first 7 characters) on the line after the git commit.
length()
definition to the new method size()
. Successfully build the program. Once done, commit using the commit message:
Push your changes to GitHub.size()
and length()
do the same thing. Now, change length()
(the old method) to call size()
(the new method). The definition of length()
should only have the call to size()
. Note that you must pass along the parameters and handle any return
statements.
Push your changes to GitHub.length()
with a call to method size()
. Again, this must be done one call at a time. After each change, compile, build, and run successfully. Commit each time using the git command:
Push your changes to GitHublength()
in ToDoList.cpp. Compile, build, and run successfully. Commit using the command:
Push your changes to GitHubAt this point, the refactoring is complete.
Create a pull request at GitHub. You want to pull from the branch issue1
into the branch main
.
Accept the pull request at GitHub. Typically, this would be done by another team member, but in this case, you can accept your pull request.
Switch to the main
branch in your cloned repository and pull the changes. The rename should appear in the code on the main
branch.
issue1
has done its job and is no longer needed. All your commits on this branch are now in the branch main
.The article How to Write a Git Commit Message has guidance on commit messages in general and Git projects specifically. Especially note the 7 rules. As the writeup mentions, these ideas are not new.
A message with only a subject line is adequate for our projects. The rules that only concern the subject are:
Make sure to use these guidelines as you implement any projects or exercises.
TA: Ms. Afia Asante aa998@uakron.edu