Podcast
Questions and Answers
What is the typical review speed for code according to best practices?
What is the typical review speed for code according to best practices?
Which type of code should be prioritized for review?
Which type of code should be prioritized for review?
What is the purpose of the assert macro in C++?
What is the purpose of the assert macro in C++?
Which of these bugs requires attention during a code review?
Which of these bugs requires attention during a code review?
Signup and view all the answers
What should unit test plans include?
What should unit test plans include?
Signup and view all the answers
Which of these is a problem often encountered during code reviews?
Which of these is a problem often encountered during code reviews?
Signup and view all the answers
What type of problems are categorized as flaws in software development?
What type of problems are categorized as flaws in software development?
Signup and view all the answers
Which of the following is a primary goal of conducting a code review?
Which of the following is a primary goal of conducting a code review?
Signup and view all the answers
What benefit does code review provide by finding defects earlier in the lifecycle?
What benefit does code review provide by finding defects earlier in the lifecycle?
Signup and view all the answers
What is a key consideration during the code review process?
What is a key consideration during the code review process?
Signup and view all the answers
What is the primary purpose of a code review?
What is the primary purpose of a code review?
Signup and view all the answers
Which of the following describes the typical frequency of code reviews in modern development practices?
Which of the following describes the typical frequency of code reviews in modern development practices?
Signup and view all the answers
Which of the following steps is NOT part of the typical code review workflow?
Which of the following steps is NOT part of the typical code review workflow?
Signup and view all the answers
What is the primary benefit of manual security code review compared to automated tools?
What is the primary benefit of manual security code review compared to automated tools?
Signup and view all the answers
Why do many software developers create vulnerabilities in their code?
Why do many software developers create vulnerabilities in their code?
Signup and view all the answers
Why is it recommended for code authors to use a code review checklist before sending their code for review?
Why is it recommended for code authors to use a code review checklist before sending their code for review?
Signup and view all the answers
What should a code reviewer focus on according to best practices in code reviews?
What should a code reviewer focus on according to best practices in code reviews?
Signup and view all the answers
What is a key benefit of using a code review checklist for code reviewers?
What is a key benefit of using a code review checklist for code reviewers?
Signup and view all the answers
What is the primary reason the review team should understand the business purpose of the application?
What is the primary reason the review team should understand the business purpose of the application?
Signup and view all the answers
Which source of information is considered the most effective for starting a security code review?
Which source of information is considered the most effective for starting a security code review?
Signup and view all the answers
How can security review teams build trust with the development team?
How can security review teams build trust with the development team?
Signup and view all the answers
What is a significant challenge typically faced during the information gathering phase of a code review?
What is a significant challenge typically faced during the information gathering phase of a code review?
Signup and view all the answers
Why is it important for the reviewer to verify that key risks have been properly addressed?
Why is it important for the reviewer to verify that key risks have been properly addressed?
Signup and view all the answers
Which of the following best describes the role of the code author in the review process?
Which of the following best describes the role of the code author in the review process?
Signup and view all the answers
Which two stakeholders are typically involved in the code review process?
Which two stakeholders are typically involved in the code review process?
Signup and view all the answers
Study Notes
CSC 2045 Code Review
- Objectives: Conduct thorough source code analysis using various tools and techniques; describe the purpose and process of a code review; describe common security vulnerabilities in the course programming language; and describe the purpose and process of a code review.
Agenda: Week 04
-
Vulnerabilities in Software: Bugs (problems introduced during implementation, easily discovered and corrected, e.g., buffer overflows, race conditions, unsafe system calls, incorrect validation); Flaws (problems at a deeper level, more subtle, originated from design and instantiation in code, e.g., compartmentalization, error-handling, broken access control).
-
Teaching Code Review: Read the article: https://www.eduflow.com/blog/teaching-code-review-to-university-students; Reflect on your top takeaway.
-
Introduction to Code Review: Inspection of source code by someone other than the author to identify coding defects for later removal. Focus on identifying defects and helping improve code quality. Read the article: https://wiki.owasp.org/index.php/Code_Review_Introduction. Browse: https://www.awesomecodereviews.com/fundamentals/code-review.
-
Benefits of Code Review: Find defects earlier in the lifecycle; IBM finds 82% of defects before testing; Defects found with less effort than testing (IBM: 3.5 hrs/defect, testing: 15–25 hrs/defect); Identify different defects than testing; Identify design and requirement problems; Educate developers about security bugs; Developers frequently repeat the same mistakes.
-
Code Review Preparation: Read the OWASP article: https://wiki.owasp.org/index.php/Code_Review_Preparation, including: Laying the Groundwork, Before We Start, Discovery: Gathering the Information, Context, Context, Context, and The Checklist. Students should browse: https://www.awesomecodereviews.com/checklists/code-review-checklist
-
Code Review Considerations: Know your limits (typical review speed is 150–200 lines/hour); Know what bugs to look for (checklists and static analysis tools). Problems include needing substantial expertise in programming and security; human errors; and slow reviews of legacy code. Understand the time commitment required for effective code reviews.
-
Prioritizing What Code To Review: Code accessible without authentication, code with a history of vulnerabilities, code that handles sensitive data, complex code, code that changes frequently.
-
What To Look For & Giving Feedback: Bugs/Potential bugs (repetitive code, disagreements between code and spec, off-by-one errors, global variables, optimistic/un-defensive programming, magic numbers); unclear, messy code (bad variable/method names, inconsistent indentation, too much on one line, trivial comments, multiple purposes for variables). Students can browse: https://www.youtube.com/embed/NNXk_WJzyMI?si=Lh-LHmqHxg. Use the provided URLs for additional resources.
-
Best Practices For Code Review: Enhance software security through structured design, code inspection, peer review; integrate code review into the software development process; Meet with developers, determine if code meets secure code development criteria, consider coding standards, code review checklists, inspect code comments/documentation/unit test plans/security requirements. Students should browse: https://www.awesomecodereviews.com/best-practices/code-review
-
Testing: Unit test plans should include how to test the code; demonstrate that the code meets security requirements and design/coding standards; and include a test procedure, inputs, and expected outputs. Students should browse: https://best-practice-and-impact.github.io/qa-of-code-guidance.
-
Assert Or Not To Assert (C++):
assert
macro for debugging prints error, and aborts the program; designed to catch programming errors, not run-time errors, and usually disabled after debugging; your member functions should not useassert
to validate user interaction, instead return abool
(true if valid, false if not). Students can browse: https://pythontutor.com/visualize.html#code=%23include%20%3eck. -
Example: Zune Infinite Loop: A provided code example demonstrates a potential infinite loop in the Zune software. A code example of a potential Zune infinite loop (12/31/08) illustrates how flawed logic in a year calculation (e.g., failing to account for leap years) can cause a while loop to run endlessly. Students can browse: https://leancrew.com/all-this/2009/01/leap-year-and-the-zune.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Explore the intricacies of code review in CSC 2045. This quiz will cover source code analysis, security vulnerabilities, and the process of code reviews. Learn about the detection of bugs and flaws and gain insight from relevant articles.