Various ways to test the quality of code in Java are:
- Removal of unused/unnecessary objects or variables - Improves code readability and reduce the lines of code. It is always a good practice to remove the unused objects/variables.
- Removal of empty try/catch blocks - Removes redundant code and helps in streamlining the code. Instead of commenting out empty try catch blocks, it is always a good practice to remove them.
- One can tie itself to your IDE such as eclipse, Intelligent IDEA, etc. or your build tools such as maven. For further instructions on installation and usage, you can refer to Documentation Index.
So, as a QA engineer, one can make use of PMD.