For this week’s blog post I decided to write about important things to consider when doing a technical review on object-oriented code. I chose this topic as I figured it would serve as a good refresher on key object-oriented concepts that we should keep in mind going forward with the next software testing project. I thought that reminiscing on good practices of object oriented design would enable us to be more aware of what to look for while writing out software technical review on the Sir-Tommy Solitaire program.
I found a short book entitled Object Oriented Programing that was written by a software professional named Carl Erickson. Erickson is also the CEO and founder of a software company called Atomic Object. Although the book was written in 2009, I still think it is relative in the world of object-oriented design today. There are many sections to Erickson’s book but I plan on looking at just a few sections that I thought were most relevant to writing our software technical review. The sections I intend to focus on in this blog post are the following: sections 4 – OO Naming Conventions, 8 – Encapsulation & Modularity, 9 – Object-Oriented Hierarchy.
In section 4, Naming Conventions, Erickson briefly touches upon good practice for naming classes, methods, and variables. He explains that class names should have the first letter of the first word capitalized along with the first letter of every word after that whereas, object variable and method names should have the first word begin with a lowercase letter and all following words begining with capitalized letters. This probably isn’t news to any of use in CS-443 but it’s definitely something to consider when writing our software technical reviews.
Next, in sections 8 and 9, Erickson explores the ideas of class encapsulation and hierarchy. Encapsulation is an important idea to consider when writing software technical reviews because improper use of encapsulation such as instantiating a variable as public when it should be private can lead to serious headache down the road. For example, if something in the code were to go wrong with regards to a public variable that you instantiated, it may be very difficult to track down the culprit of the bug since the variable in question is not private. Also, Erickson brings up the notion of the “is a” relationship between classes, sub-classes, and interfaces which will be significant in determining the flexibility of the code in question.
It’s also worth reading over the rest of the sections in Erickson’s book. In particular sections 10 -14 as they go over essential concepts regarding to object-oriented design. Section 13 does a good job of explaining how to evaluate whether or not a piece of object-oriented code is designed and implemented efficiently by focusing whether the code adheres to user specifications and object-oriented design techniques. Keeping in mind the foundational concepts of object-oriented design may allow us to make more insightful suggestions and write better technical reviews.
From the blog CS@Worcester – Caleb's Computer Science Blog by calebscomputerscienceblog and used with permission of the author. All other rights reserved by the author.