Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
student:eclipse:eclemma [2018/08/10 12:04] – created bernstdhstudent:eclipse:eclemma [2024/02/29 11:23] (current) bernstdh
Line 1: Line 1:
- 
- 
 ===== The EclEmma Code Coverage Tool for Eclipse ===== ===== The EclEmma Code Coverage Tool for Eclipse =====
  
Line 29: Line 27:
  
  
-Once you have selected the type of coverage, you can create a  coverage report by clicking on  {{eclemma_coverage-mode.gif}}.+Once you have selected the type of coverage, you can create a  coverage report by clicking on  {{eclemma_coverage-mode.gif}}. The coverage report will be available in the "Coverage" tab of the  Output View. (Note: If there is no "Coverage" tab you can enable  it by clicking on <key>Window</key>-<key>Show View</key>.)  This report provides a summary of the instructions covered by your tests (which is comparable to statement coverage).
  
- +**More importantly**, each source file will be  [[ http://www.eclemma.org/userdoc/annotations.html | marked-up ]]  to indicate which  statements, branches, etc... have been covered and which have not. (This is far more valuable and important than the coverage report.)
-The coverage report will be available in the "Coverage" tab of the  Output View. (Note: If there is no "Coverage" tab you can enable  it by clicking on <key>Window</key>-<key>Show View</key>.)  In addition, each source file will be  [[ http://www.eclemma.org/userdoc/annotations.html | marked-up ]]  to indicate which  statements, branches, etc... have been covered and which have not.+
  
 Note that EclEmma uses the term "branch" differently from the way  some other people use the term. In EclEmma, the number of  "branches" is the sum of the number of possible Boolean values in  an expression. So, a statement like:  ''%%if ((x > 0) || (y > 0) || (z > 0))%%''  will have  \(2 + 2 + 2 = 6\) "branches". Some people say this  statement has 2 "branches" (the entire expression is either true  or false, leading to 2 edges in the graph),  \(2 \times 3 = 6\) "conditions", and  \(2^3 = 8\) "multiple conditions". Note that EclEmma uses the term "branch" differently from the way  some other people use the term. In EclEmma, the number of  "branches" is the sum of the number of possible Boolean values in  an expression. So, a statement like:  ''%%if ((x > 0) || (y > 0) || (z > 0))%%''  will have  \(2 + 2 + 2 = 6\) "branches". Some people say this  statement has 2 "branches" (the entire expression is either true  or false, leading to 2 edges in the graph),  \(2 \times 3 = 6\) "conditions", and  \(2^3 = 8\) "multiple conditions".
Line 84: Line 81:
  
  
-Java adds an automatic constructor to all classes that do not    have a constructor, including utility classes. So, unless you go    out of your way to do so, your test suite will not cover the    automatic constructor which means that the declaration of the    class may appear to be uncovered. If you want, you can construct    an instance of the utility class in one of your tests (and, so,    cover the automatic constructor).+Java adds an automatic constructor to all classes that do not have a constructor, including utility classes. So, unless you go    out of your way to do so, your test suite will not cover the  automatic constructor which means that the declaration of the    class may appear to be uncovered. To get complete coverage you can
 +  * Construct  an instance of the utility class in one of your tests (and, so,    cover the automatic constructor); or 
 +  * Add a private default constructor to the utility class. 
 + 
 +==== Accessibility Settings ==== 
 + 
 +To change the color settings (for those who have difficulty with red/green colorblindness): 
 + 
 +<key>Window+Preferences+General+Editors+Text Editors+Annotations</key> 
 + 
 +The settings for code coverage highlighting can be found within 
 +  
 +1) Full Coverage 
 + 
 +2) Partial Coverage
  
 +3) No Coverage
  
 ==== For More Information ==== ==== For More Information ====