Professional Documents
Culture Documents
CodeReviewChecklist BestPractices
CodeReviewChecklist BestPractices
CodeReviewChecklist BestPractices
General Checklist:
S.No Review Guidelines Verified(Yes/
. No)
2 Test script should be unit tested before sending for Internal/External Review
3 A New file should be created as per the Standard Naming convention and the name should signify the test’s
purpose E.g.: SanityAliveTests(Caps for first letter of each word/Pascal Casing)
9 Variable name should follow standard naming convention(Camel Casing/NoUnderscore,No Numbers). Boolean
variables should start with 'is'/'does' etc. Eg:isFilePresent, For Collections, use plurals in the name
10 Check for existing utils - Project lib & external lib before creating a new util
11 Add Methods in CommonUtils only if they can be reused across various tests/features
13 All String/Text/version/numbers/regex/patterns
16 Method names should follow standard naming convention and the name should signify the function’s
purpose(Camel Casing/NoUnderscore,No Numbers).
E.g.: tuneToChannelAndVerify () - start with lower case and every other word should start with uppercase
character.
17 All Methods should contain ENTERING and EXITING log messages in DEBUG level
18 All Methods and file should contain detailed comment headers(Java Doc format)
19 All class, variable, and method modifiers should be validated. For correctness
21 All computed STRINGS/Objects should have NULL check validation using CommonMethods.isNotNull()
22 Complex algorithms should be explained with references/comments.
24 Use RegEx/PatterFinder/PatternMatcher to perform any String Manipulation (try to avoid split/contains etc.)
26 Check if the code is applicable for all devices, if not the condition is handled
27 Use grep -I <text> <filename> , do not use cat xxx| grep yyy
33 Invalid parameter values are handled properly early in methods (Fast Fail).
34 An Error handler/finally block must clean up state and resources no matter where an error occurs.
35 Avoid large objects in memory, or using String to hold large documents which should be handled with better
tools. For example, don't read a large XML document into a String.
38 Comments should be added for every step/command executed to tell the purpose of the step
41 Do PMD Check before Code-Review , this will provide us with violations in the test code
42 For internal/External review, send a mail to the reviewer with following details
Test log should be attached
Test Plan should be attached
Gerrit ID/s should be mentioned. (Project Specific)
Code Review Checklist
46 Use equals for Object comparison & equalsIgnoreCase for value comparison
49 Use private branches to make changes to the code, get them reviewed and merge to develop brach.
8 Use CommonUtils.getPidOfProcess() for checking whether a process is running instead of systemctl/ps -ef
9 Test Class name -> Compass<Functionality Name>Test.java. For Reboot test, the class name should be CompassAppleTest.java,
etc.
13 CompassCommonUtils.enableDisableReportingService() -> To enable or disable any reporting service along with pooling &
reporting period.
14 CompassCommonUtils.postHttpRequest()
1 Always avoid sensitive data leak (using production accounts in test files, PII, Credit Card Numbers etc)
3
log only necessary information and obfuscate the sensitive data .
4 ALWAYS STORE YOUR SECRETS IN VAULTS. When not possible, HASH THEM.
8 Use CommonUtils.getPidOfProcess() for checking whether a process is running instead of systemctl/ps -ef
9 Test Class name -> Compass<Functionality Name>Test.java. For Reboot test, the class name should be CompassAppleTest.java,
etc.
14 CompassCommonUtils.postHttpRequest()