Saturday, April 6, 2019

Code Review

Question: How do you do code review in Java? Best Practices for Code Review ?
Answer:- 
  • First step to review code using tools like PMD, css, sonarQube, or using Git like create PR(pull request) for code review and assign to any other team member who can review your code and approve PR.
  • Manual code review line-by-line.
  • Code formatting is applied (code should intended).
  • Don't return null in exception means it should return proper message or message code. 
  • Check naming conventions.
  • Meaningful full function names.
  • Funcion sholud be samll.
  • Loosely coupling code.
  • Proper Exception Handling.
  • Using property file for messaging so that we can easly change message if required.
  • Proper implementation of SOLID principles.
  • Implement appropriate design pattern.
  • Avoid duplication of code.
  • Release the resource when no longer needed. so that it prevent the memory leaks.
  • Validate user input properly as required. to avoid mistakes (like size boundaries, input type etc.)
  • Security & performance.
  • Reusability of code.
Question: What are Java Tools for Source Code Optimization and Analysis ?
Answer:-

Question: Code review tools for java ?
Answer:- 

No comments:

Post a Comment