QA InfoTech , Independent Software Testing Service Logo
jobs@qainfotech.com
Sales: Contact Sales +1 469-759-7848 sales@qainfotech.com
QA Infotech your Software testing partner
Menu
  • About
    • Team
    • Overview
    • Values and Culture
    • QA InfoTech Foundation
    • Careers
  • Services
    • QUALITY ENGINEERING
      • Functional Testing
      • Automation Testing
      • Mobile Testing
      • Performance Testing
      • Accessibility Testing
      • Usability Testing
      • Security Testing
      Quality ASSURANCE
      • Globalization, Translation & Localization Testing
      • Courseware & Content Testing
      • Crowdsourced Testing
      • Cloud Testing
      Software Development
      • eLearning
      • Data Sciences
      • Accessibility Development
      • Mobility Solutions
      • Web Development
      • Front End Frameworks
      • Salesforce Development
      • Cloud Solutions
      • Enterprise Content Management
      • Odoo
      • ServiceNow
      • AS400
      Digital Assurance
      • Digital Assurance
      • Data Sciences & Analytics
      • Quality Consulting & Test Center of Excellence (TCOE)
      • SAP Testing
      • Selenium Test Automation
      • Blockchain Testing
  • Verticals
    • e-learning
      List Start
    • e-Learning
    • Publishing
    • BFSI
    • Health Care
    • Media
    • Travel
    • Retail
    • Government
    • OpenERP
    • List Stop
  • Knowledge Center
    • Case Studies
    • White Paper
    • Webinars
    • Blogs
  • WebinarsNew
  • News
    • News
    • Press Release
  • Contact
  • Get A Quote
  • Home
  • »
  • Business
  • »
  • Company
  • »
  • Dot Net
  • »
  • Events
  • »
  • Fun at Devlabs
17 Oct, 2015

Code Review Checklist – To Perform Effective Code Reviews

  • Yogeshwar Singh Chauhan
  • Business,Company,Dot Net,Events,Fun at Devlabs
  • no comments

This code review checklist helps the code reviewers and software developers (during self code review) to gain expertise in the code review process, as these points are easy to remember and follow during the code review process.

Let’s first begin with the basic code review checklist and later move on to the detailed code review checklist.

Basic Code Review Checklist

Let’s discuss about the basic code review checklist, which can be very handy if you are a beginner in code reviews and/or during initial code reviews.

 

While reviewing the code, ask yourself the following basic questions:

  1. Am I able to understand the code easily?
  2. Is the code written following the coding standards/guidelines?
  3. Is the same code duplicated more than twice?
  4. Can I unit test / debug the code easily to find the root cause?
  5. Is this function or class too big? If yes, is the function or class having too many responsibilities?

If you feel that the answer is not satisfactory to any of the above questions, then you can suggest/recommend code changes.

Detailed Code Review Checklist

The following code review checklist gives an idea about the various aspects you need to consider while reviewing the code:

1. Code formatting

While going through the code, check the code formatting to improve readability and ensure that there are no blockers:

a) Use alignments (left margin), proper white space. Also ensure that code block starting point and ending point are easily identifiable.

b) Ensure that proper naming conventions (Pascal, CamelCase etc.) have been followed.

c) Code should fit in the standard 14 inch laptop screen.  There shouldn’t be a need to scroll horizontally to view the code. In a 21 inch monitor, other windows (toolbox, properties etc.) can be opened while modifying code, so always write code keeping in view a 14 inch monitor.

d) Remove the commented code as this is always a blocker, while going through the code. Commented code can be obtained from Source Control (like SVN), if required.

2. Architecture

a) The code should follow the defined architecture.

  1. Separation of Concerns followed
    • Split into multiple layers and tiers as per requirements (Presentation, Business and Data layers).
    • Split into respective files (HTML, JavaScript and CSS).
  1. Code is in sync with existing code patterns/technologies.
  2. Design patterns: Use appropriate design pattern (if it helps), after completely understanding the problem and context.

3. Coding best practices

  1. No hard coding, use constants/configuration values.
  2. Group similar values under an enumeration (enum).
  3. Comments – Do not write comments for what you are doing, instead write comments on why you are doing. Specify about any hacks, workaround and temporary fixes. Additionally, mention pending tasks in your to-do comments, which can be tracked easily.
  4. Avoid multiple if/else blocks.
  5. Use framework features, wherever possible instead of writing custom code.

4. Non Functional requirements

a) Maintainability (Supportability) – The application should require the least amount of effort to support in near future. It should be easy to identify and fix a defect.

  1. Readability: Code should be self-explanatory. Get a feel of story reading, while going through the code. Use appropriate name for variables, functions and classes. If you are taking more time to understand the code, then either code needs refactoring or at least comments have to be written to make it clear.
  2. Testability: The code should be easy to test. Refactor into a separate function (if required). Use interfaces while talking to other layers, as interfaces can be mocked easily. Try to avoid static functions, singleton classes as these are not easily testable by mocks.
  3. Debuggability: Provide support to log the flow of control, parameter data and exception details to find the root cause easily. If you are using Log4Net like component then add support for database logging also, as querying the log table is easy.
  4. Configurability: Keep the configurable values in place (XML file, database table) so that no code changes are required, if the data is changed frequently.

b) Reusability

  1. DRY (Do not Repeat Yourself) principle: The same code should not be repeated more than twice.
  2. Consider reusable services, functions and components.
  3. Consider generic functions and classes.

c) Reliability – Exception handling and cleanup (dispose) resources.

d) Extensibility – Easy to add enhancements with minimal changes to the existing code. One component should be easily replaceable by a better component.

e) Security – Authentication, authorization, input data validation against security threats such as SQL injections and Cross Site Scripting (XSS), encrypting the sensitive data (passwords, credit card information etc.)

f) Performance

  1. Use a data type that best suits the needs such as StringBuilder, generic collection classes.
  2. Lazy loading, asynchronous and parallel processing.
  3. Caching and session/application data.

g) Scalability – Consider if it supports a large user base/data? Can this be deployed into web farms?

h) Usability – Put yourself in the shoes of a end-user and ascertain, if the user interface/API is easy to understand and use. If you are not convinced with the user interface design, then start discussing your ideas with the business analyst.

5. Object-Oriented Analysis and Design (OOAD) Principles

  1. Single Responsibility Principle (SRS): Do not place more than one responsibility into a single class or function, refactor into separate classes and functions.
  2. Open Closed Principle: While adding new functionality, existing code should not be modified. New functionality should be written in new classes and functions.
  3. Liskov substitutability principle: The child class should not change the behavior (meaning) of the parent class. The child class can be used as a substitute for a base class.
  4. Interface segregation: Do not create lengthy interfaces, instead split them into smaller interfaces based on the functionality. The interface should not contain any dependencies (parameters), which are not required for the expected functionality.
  5. Dependency Injection: Do not hardcode the dependencies, instead inject them.

In most cases the principles are interrelated, following one principle automatically satisfies other principles. For e.g: if the ‘Single Responsibility Principle’ is followed, then Reusability and Testability will automatically increase.

In a few cases, one requirement may contradict with other requirement. So need to trade-off based on the importance of the weight-age, e.g. Performance vs Security. Too many checks and logging at multiple layers (UI, Middle tier, Database) would decrease the performance of an application. But few applications, especially relating to finance and banking require multiple checks, audit logging etc. So it is ok to compromise a little on performance to provide enhanced security.

Tools for Code Reviews

  1. The first step while assessing the code quality of the entire project is through a static code analysis tool. Use the tools (based on technology) such as SonarQube, NDepend, FxCop, TFS code analysis rules. There is a myth that static code analysis tools are only for managers.
  2. Use plug-ins such as Resharper, which suggests the best practices in Visual studio.
  3. To track the code review comments use the tools like Crucible, Bitbucket and TFS code review process.

Conclusion

The above code review checklist is not exhaustive, but provides a direction to the code reviewer to conduct effective code reviews and deliver good quality code. Initially, it would take some time to review the code from various aspects. After a bit of practice, code reviewers can perform effective code reviews, without much effort and time. If you would like to become an expert code reviewer, this code review checklist serves as a great starting point. Happy Code Reviewing!

Site Categories

  • Accessibility Testing (29)
  • Automation Testing (27)
  • Banking Application Testing (2)
  • Blockchain (2)
  • Blogs (378)
  • Business (44)
  • Case Studies (37)
  • Cloud Testing (5)
  • Company (16)
  • Compatibility Testing (1)
  • DevLabs Expert Group (25)
  • DevOps (2)
  • Dot Net (27)
  • E-Learning testing (3)
  • Events (6)
  • Fun at Devlabs (1)
  • Functional Testing (4)
  • Healthcare App Testing (10)
  • Innovation (5)
  • Java (3)
  • Job Openings (31)
  • Mobile Testing (20)
  • News (144)
  • News & Updates (7)
  • Open Source (9)
  • Our-Team (9)
  • Performance Testing (24)
  • Press Releases (37)
  • QA Thought Leadership (3)
  • Salesforce App Development (2)
  • Security Testing (16)
  • Software Testing (37)
  • Testimonials (24)
  • Translation & Globalization Testing (10)
  • Uncategorized (3)
  • Usability Testing (1)
  • Webinars (26)
  • White Papers (35)
  • Popular
  • Recent
  • Tags
  • Zend Framework April 16, 2013
  • Effective Regression Testing Strategy for Localized Applications Effective Regression Testing Strategy for Localized Applications March 23, 2015
  • Moving from a commercial to an open source performance testing tool August 12, 2015
  • 3 Tier Architecture in .Net Framework March 21, 2013
  • Zend at QAIT Devlabs March 26, 2013
  • Key Focus Areas while Testing a Healthcare App Key Focus Areas while Testing a Healthcare App September 18, 2020
  • Need for the Right Performance Testing Strategy for your Mobile App Need for the Right Performance Testing Strategy for your Mobile App September 12, 2020
  • Key Points to Remember Before Starting Salesforce Customization Key Points to Remember Before Starting Salesforce Customization September 8, 2020
  • Top 5 Automation Testing Tools for Mobile Applications Top 5 Automation Testing Tools for Mobile Applications September 2, 2020
  • Improve Salesforce Application Performance Leveraging Platform Cache using Lightning Web Component Improve Salesforce Application Performance Leveraging Platform Cache using Lightning Web Component August 28, 2020
  • Jobs - 13
  • Hiring - 13
  • mobile app testing - 8
  • performance testing - 7
  • accessibility-testing - 6
  • #AccessibilityTesting - 6
  • #PerformanceTesting - 6
  • automation testing - 5
  • accessibility - 4
  • #PerformanceTestingServices - 4
  • Performance Testing Services - 4
  • mobile - 3
  • testing - 3
  • functional testing - 3
  • agile cycle - 3
  • DevOps - 3
  • performance - 3
  • software testing services - 3
  • data analytics - 3
  • #SoftwareTesting - 3
  • #TestAutomation - 3
  • #AppSecurity - 3
  • #SecureBankingApps - 3
  • #TestingBankingApplications - 3
  • #SoftwareTestingStrategy - 3

Site Archives

  • September 2020 (4)
  • August 2020 (9)
  • July 2020 (15)
  • June 2020 (9)
  • May 2020 (13)
  • April 2020 (13)
  • March 2020 (23)
  • February 2020 (7)
  • January 2020 (18)
  • December 2019 (9)
  • November 2019 (10)
  • October 2019 (8)
  • September 2019 (9)
  • August 2019 (6)
  • July 2019 (4)
  • June 2019 (7)
  • May 2019 (18)
  • April 2019 (15)
  • March 2019 (5)
  • February 2019 (1)
  • January 2019 (5)
  • December 2018 (3)
  • October 2018 (4)
  • August 2018 (4)
  • July 2018 (15)
  • June 2018 (1)
  • May 2018 (3)
  • April 2018 (7)
  • March 2018 (5)
  • February 2018 (15)
  • January 2018 (3)
  • December 2017 (8)
  • November 2017 (13)
  • October 2017 (19)
  • September 2017 (13)
  • August 2017 (11)
  • July 2017 (7)
  • June 2017 (6)
  • May 2017 (5)
  • April 2017 (2)
  • March 2017 (6)
  • January 2017 (3)
  • December 2016 (7)
  • October 2016 (3)
  • September 2016 (3)
  • August 2016 (6)
  • July 2016 (4)
  • June 2016 (3)
  • May 2016 (6)
  • April 2016 (3)
  • March 2016 (7)
  • February 2016 (3)
  • January 2016 (3)
  • December 2015 (20)
  • November 2015 (2)
  • October 2015 (28)
  • September 2015 (4)
  • August 2015 (2)
  • July 2015 (14)
  • June 2015 (2)
  • May 2015 (2)
  • April 2015 (5)
  • March 2015 (18)
  • February 2015 (11)
  • January 2015 (4)
  • December 2014 (3)
  • November 2014 (4)
  • October 2014 (6)
  • September 2014 (7)
  • August 2014 (6)
  • July 2014 (7)
  • June 2014 (6)
  • May 2014 (4)
  • April 2014 (7)
  • March 2014 (7)
  • February 2014 (8)
  • January 2014 (7)
  • December 2013 (3)
  • November 2013 (6)
  • October 2013 (6)
  • September 2013 (10)
  • August 2013 (3)
  • July 2013 (4)
  • June 2013 (6)
  • May 2013 (3)
  • April 2013 (12)
  • March 2013 (6)
  • February 2013 (2)
  • January 2013 (1)
  • December 2012 (2)
  • November 2012 (3)
  • October 2012 (3)
  • September 2012 (5)
  • August 2012 (2)
  • July 2012 (6)
  • June 2012 (1)
  • May 2012 (2)
  • April 2012 (3)
  • March 2012 (8)
  • February 2012 (4)
  • January 2012 (3)
  • December 2011 (1)
  • November 2011 (4)
  • October 2011 (3)
  • September 2011 (2)
  • August 2011 (3)
  • June 2011 (4)
  • May 2011 (1)
  • April 2011 (4)
  • February 2011 (1)
  • January 2011 (1)
  • October 2010 (2)
  • August 2010 (4)
  • July 2010 (2)
  • June 2010 (3)
  • May 2010 (3)
  • April 2010 (1)
  • March 2010 (5)
  • February 2010 (1)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (1)
  • October 2009 (2)
  • July 2009 (1)
  • June 2009 (2)
  • May 2009 (2)
  • March 2009 (2)
  • February 2009 (4)
  • December 2008 (2)
  • November 2008 (1)
  • October 2008 (1)
  • September 2008 (1)
  • August 2008 (2)
  • May 2008 (1)
  • February 2008 (1)
  • September 2007 (1)
  • August 2007 (1)
  • May 2007 (2)
  • June 2006 (1)

Tag Cloud

#AccessibilityTesting #AppSecurity #AutomationTesting #MobileAppTesting #MobileTesting #PerformanceTesting #PerformanceTestingServices #SecureBankingApps #SoftwareTestAutomation #SoftwareTesting #SoftwareTestingStrategy #TestAutomation #TestingBankingApplications .NEt accessibility accessibility-testing agile cycle automation automation testing BigData cloud computing cloud testing data analytics DevOps education functional testing functional testing services globalization Hiring Jobs localization testing mobile mobile app testing Mobile Testing Offshore QA Testing performance performance testing Performance Testing Services Security testing services Selenium Test Automation software testing software testing services technology testing xAPI

Post Calendar

January 2021
MTWTFSS
« Sep  
 123
45678910
11121314151617
18192021222324
25262728293031

About QA InfoTech

Q A QA InfoTech is a C M M i CMMi Level III and I S O ISO 9001: 2015, I S O ISO 20000-1:2011, I S O ISO 27001:2013 certified company. We are one of the reputed outsourced Q A QA testing vendors with years of expertise helping clients across the globe. We have been ranked amongst the 100 Best Companies to work for in 2010 and 2011 & 50 Best Companies to work for in 2012 , Top 50 Best IT & IT-BMP organizations to work for in India in 2014, Best Companies to work for in IT & ITeS 2016 and a certified Great Place to Work in 2017-18. These are studies conducted by the Great Place to Work® Institute. View More

Get in Touch

Please use Tab key to navigate between different form fields.

This site is automatically   protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Services

  • Functional Testing
  • Automation Testing
  • Mobile Testing
  • Performance Testing
  • Accessibility Testing
  • Security Testing
  • Localization Testing
  • Cloud Testing
  • Quality Consulting

Useful Links

  • Blogs
  • Downloads
  • Case Studies
  • Webinars
  • Team
  • Pilot Testing
  • Careers
  • QA TV
  • Contact

Office Locations

Michigan, USA
Toronto, Canada
Noida, INDIA ( HQ )
Bengaluru, INDIA
Michigan, USA

  • 32985 Hamilton Court East, Suite 121, Farmington Hills, Michigan, 48334
  • +1-469-759-7848
  • info@qainfotech.com

Toronto, Canada

  • 6 Forest Laneway, North York, Ontario, M2N5X9
  • info@qainfotech.com

Noida, INDIA ( HQ )

  • A-8, Sector 68 Noida, Uttar Pradesh, 201309
  • +91-120-6101-805 / 806
  • info@qainfotech.com

Bengaluru, INDIA

  • RMZ Ecoworld, Outer Ring Road, Bellandur, Bengaluru, Karnataka, 560103
  • +91-95600-00079
  • info@qainfotech.com

Copyright ©2020 qainfotech.com. All rights reserved | Privacy Policy | Disclaimer

Scroll
QA InfoTech logo
  • About
    ▼
    • Team
    • Values and Culture
    • Overview
    • QA InfoTech Foundation
    • Careers
  • Services
    ▼
    • Software Development
      ▼
      • eLearning
      • Data Sciences
      • Accessibility Development
      • Mobility Solutions
      • Web Development
      • Front End Frameworks
      • Salesforce Development
      • Cloud Solutions
      • Enterprise Content Management
      • Odoo
      • ServiceNow
      • AS400
    • Functional Testing Services
    • Automation Testing Services & Tools
    • Mobile Testing Services
    • Performance Testing Services
    • Accessibility Testing Services
    • Usability Testing
    • Security Testing
    • Translation & Globalization Testing
    • Courseware & Content Testing
    • Crowdsourced Testing
    • Cloud Testing
    • Digital Assurance
    • Data Sciences and Analytics
    • SAP Testing
    • Selenium Test Automation
    • Blockchain Applications Testing
  • Verticals
    ▼
    • e-Learning
    • Health Care
    • Retail
    • Publishing
    • Media
    • Government
    • BFSI
    • Travel
    • OpenERP
  • Knowledge Center
    ▼
    • Case Studies
    • White Paper
    • Webinars
    • Blogs
  • WebinarsNew
  • News
    ▼
    • News
    • Press Release
  • Contact
  • Get a Quote
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Accept CookiesPrivacy policy