Monday, July 2, 2018

Java Code Coverage Tools


The popular Java Code Coverage Tools:

->  Using  junit developer  can test the code is working fine properly or not.
->  public class StatementDtls {
            --------
            --------
       100 }

"  The process of  finding the number of lines tested by the developer using  Junit is called Code coverage "

% of code coverage =  no. of line tested by the developer /total no. of lines.

Ex :   300/500 =  60 %

Note :  Client will expect minimum code coverage is  75 %

Note :  If we want increase the code coverage from 60 to 75 or above.  We need write more  test cases to test the code.

Q :  How to find the code coverage ?

   Solution  :  1)  Cobertura.    2)  Jacococ


How  to enable Cobertura ?

 With Maven

          Add Cobertura  report plugin in Maven.xml   




without Maven








How  skip the pmd ?

>mvn install -Dpmd.skip=true

How to skip the Junits ?

>mvn install -Dmaven.test.skip=true





No comments:

Post a Comment

Hyderabad Trip - Best Places to visit

 Best Places to Visit  in Hyderabad 1.        1. Golconda Fort Maps Link :   https://www.google.com/maps/dir/Aparna+Serene+Park,+Masj...