CST 438 - Week 4

 This was our fourth week in CST 438 - Software Engineering.

Reflection

Last week we set up a GitHub organization, along with some repositories and a project, for our multi-week group project for this course. We also planned who would do each task for the first two weeks, and our gave our estimates for how large and time consuming each task would be. This week we started working on the first set of tasks, which all focus on the API for the backend of the service. In the lecture material for the prooject it was mentioned that writing unit tests would take up more time than the code itself. This ended up being true, as most of my time was spent writing tests.
 
As part of this reflection, we were given the prompt "What is the most interesting thing you have learned in your reading of Software Engineering at Google?" For me I think the most interesting thing would be its coverage on tests, which I talked about in last week's post. The second most interesting thing that SAG discusses would be code reviews. According to the book, developers spend a large amout of time on code reviews. It also mentioned that new developers are often afraid of the criticism that code reviews bring. I very much felt this when I made a pull request for my portion of the project and recieved feedback. They had a lot to say, which made me feel a little overwhelmed. Ultimately, feedback from others is needed to see where you need to improve, so it was good that I had that experience.

SAG Ch. 9 - Code Reviews

Chapter nine of SAG discusses code review, which is defined as, "a process in which code is reviewed by someone other than the author, often before the introduction of that code into a codebase".
 
According to the text, code reviews follow these steps:
  1. An author writes a change to the codebase, then creates a snapshot of the change.
  2. The author sends the change to one or more reviewers.
  3. The reviewers post comments on the changes if needed.
  4. The author makes any needed changes and sends new snapshots to the reviewers. Steps 3 and 4 may be repeated.
  5. Once the reviewers are satisfied with the changes, they mark it as approved.
  6. The author is allowed to commit the change to the codebase.
Google also requires approval in three different ways for each change:
  • Approval from another engineer that the code is appropriate and does what the author claims.
  • Approval from one of the code owners that the code is appropriate for that part of the codebase.
  • Approval that the code conforms to readability practices from someone with language readability.
A well-designed code review process results in the following benefits:
  • Checks code correctness
  • Ensures the code change is comprehensible to other engineers
  • Enforces consistency across the codebase
  • Psychologically promotes team ownership
  • Enable knowledge sharing
  • Provides a historical record of the code review itself
Code reviews can fall into the following categories (sometimes having overlap):
  • Greenfield reviews and new features
  • Behavioral changes, improvements, and optimizations
  • Bug fixes and rollbacks
  • Refactorings and large-scale changes
 

Comments

Popular posts from this blog

Week 26

Week 22

Week 18