Saturday, April 6, 2019

Code Review

1.How do you do code review in Java? Best Practices for Code Review ?

  • First step to review code using tools like PMD, css, sonarQube etc.
  • 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.

2. What are Java Tools for Source Code Optimization and Analysis ?

3. Code review tools for java ?

No comments:

Post a Comment