jgs CSC 309 Software Engineering II Lecture 06: Code Review Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 6 § “Any fool can write code that a computer can understand. Good programmers write code that humans can understand”. -Martin Fowler § “Even bad code can function”. –Robert C. Martin Coding
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 8 § Describe why the change is necessary (fixes a bug, improves the user experience, refactors the existing code). § Identify ways to simplify the code while still solving the problem. § Offer alternative implementations, § Seek to understand the author's perspective. § Remember that you are here to provide feedback, not to be a gatekeeper. Core Ideas for Reviewers
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 9 § Be grateful for the reviewer's suggestions. ("Good call. I'll make that change.") § Seek to understand the reviewer's perspective. § Extract some changes and refactoring into future stories. § Try to respond to every comment. And, merge once you feel confident in the code and its impact on the project. Having Your Code Reviewed
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 16 § Check Javadoc for Classes and Methods § Check to name classes, methods, and variables. § Be suspicious of any static element and ask, Does this really need to be static? Static is dangerous and can drive you to the Structural Programming model, and you want to do Object-Oriented. § Is it DRY? § Is it KIS? Summary (par 1 /2 )
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 17 § Check connections (inheritance, having, using) § Are these global variables needed as global? § Should this be delegation or inheritance? § Be careful about what is shared on the Blackboard. Blackboard is dangerous; it can make you forget encapsulation and drive you to the everyone have access to everything approach. § Check for Observer pattern misuse or overuse Summary (par 1 /2 )
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 19 Office Hours Tuesday and Thursday 3 - 5 pm But an appointment required Sent me an email – [email protected]
jgs CSC 309 Software Engineering II Lab 06: Code Review Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 22 Think about this Add a draft Code Review to your report for Assignment 01. Nothing to submit today
jgs CSC 309 Software Engineering II Javier Gonzalez-Sanchez, Ph.D. [email protected] Winter 2023 Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly. They cannot be distributed or used for another purpose.