<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Coverage Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/code-coverage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/code-coverage/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:53:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>What is SonarJava? Is it replacement for Checkstyle, PMD, FindBugs?</title>
		<link>https://www.scmgalaxy.com/tutorials/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/</link>
					<comments>https://www.scmgalaxy.com/tutorials/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 28 Jul 2017 17:38:24 +0000</pubDate>
				<category><![CDATA[SonarQube]]></category>
		<category><![CDATA[Alternatives]]></category>
		<category><![CDATA[Checkstyle]]></category>
		<category><![CDATA[Code analyzer]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[FindBugs]]></category>
		<category><![CDATA[PMD]]></category>
		<category><![CDATA[SonarJava]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2017/07/28/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/</guid>

					<description><![CDATA[<div>
<div>
<div><strong>Know About SonarJava! Is it replacement for Checkstyle, PMD, FindBugs?</strong></div>
</p></div>
<p> SonarJava has a great coverage of well-established quality standards. The SonarJava capability is available in Eclipse and IntelliJ for developers (SonarLint) as well as throughout the development chain for automated code review with on-premise SonarQube or on-line SonarCloud.</p></div>
<div> </div>
<div>SonarJava is a code analyzer for Java projects. Information about the SonarJava features is available below;</div>
<div> </div>
<div><strong>Why SonarJava?</strong></div>
<div>SonarQube is currently on the way to deprecate PMD, Checkstyle and Findbugs and use their own technology to analyze Java code (called SonarJava). They do it, because they don't want to spend their time fixing, upgrading (or waiting on it) those libraries (e.g. for Java 8), which for example uses outdated libraries. Well at least since SonarQube 6.3+ it seems to be that Findbugs is (at the moment) no longer supported as a plugin.</div>
<div> </div>
<div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/">What is SonarJava? Is it replacement for Checkstyle, PMD, FindBugs?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-2850 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/know-about-sonarjava.png" alt="know-about-sonarjava" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/know-about-sonarjava.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/07/know-about-sonarjava-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>SonarJava has a great coverage of well-established quality standards. The SonarJava capability is available in Eclipse and IntelliJ for developers (SonarLint) as well as throughout the development chain for automated code review with on-premise SonarQube or on-line SonarCloud.</p>
</div>
<div></div>
<div>SonarJava is a code analyzer for Java projects. Information about the SonarJava features is available below;</div>
<div></div>
<div><strong>Why SonarJava?</strong></div>
<div>SonarQube is currently on the way to deprecate PMD, Checkstyle and Findbugs and use their own technology to analyze Java code (called SonarJava). They do it, because they don&#8217;t want to spend their time fixing, upgrading (or waiting on it) those libraries (e.g. for Java 8), which for example uses outdated libraries. Well at least since SonarQube 6.3+ it seems to be that Findbugs is (at the moment) no longer supported as a plugin.</div>
<div></div>
<div><strong><br />
Features</strong></div>
<div>409+ rules (including 103+ bug detection, 273 Code Smells, 33 Vulerabilities)</div>
<div>Metrics (complexity, number of lines etc.)</div>
<div>Import of test coverage reports</div>
<div>Custom rules</div>
<div></div>
<div><strong>SonarJava is being used in the following&#8230;</strong></div>
<div>SonarQube</div>
<div>SonarCloud</div>
<div>SonarLint for Eclipse</div>
<div>SonarLint for Intellij IDEA</div>
<div></div>
<div><strong>Supported versions, frameworks and special analyses&#8230;</strong></div>
<div>Java language versions through 8</div>
<div>Frameworks Struts, Spring, Hibernate</div>
<div>Native integration with Maven, Gradle, and Ant</div>
<div></div>
<div><strong>Metrics</strong></div>
<div>Code Coverage by Tests: SonarJava supports the import of JaCoCo and Cobertura test coverage reports.</div>
<div></div>
<div><strong>Custom Rules</strong></div>
<div>SonarJava supports custom rules written in Java.</div>
<div></div>
<div><strong>Reference</strong></div>
<div><a href="https://github.com/SonarSource/sonar-java" target="_blank" rel="noopener">https://github.com/SonarSource/sonar-java</a></div>
<div><a href="https://www.sonarsource.com/products/codeanalyzers/sonarjava.html" target="_blank" rel="noopener">https://www.sonarsource.com/products/codeanalyzers/sonarjava.html</a></div>
<div><a href="https://docs.sonarqube.org/display/PLUG/SonarJava" target="_blank" rel="noopener">https://docs.sonarqube.org/display/PLUG/SonarJava</a></div>
<div></div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/">What is SonarJava? Is it replacement for Checkstyle, PMD, FindBugs?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/know-about-sonarjava-is-it-replacement-for-checkstyle-pmd-findbugs/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between Code Coverage and Test Coverage &#124; Code Coverage VS Test Coverage</title>
		<link>https://www.scmgalaxy.com/tutorials/difference-between-code-coverage-and-test-coverage/</link>
					<comments>https://www.scmgalaxy.com/tutorials/difference-between-code-coverage-and-test-coverage/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Tue, 07 Apr 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Test Coverage Tools]]></category>
		<category><![CDATA[Between]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Code analysis]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[Code Coverage vs Test Coverage]]></category>
		<category><![CDATA[Coverage]]></category>
		<category><![CDATA[Difference]]></category>
		<category><![CDATA[Difference between Code Coverage and Test Coverage]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Test Coverage]]></category>
		<category><![CDATA[What]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2015/04/07/difference-between-code-coverage-and-test-coverage/</guid>

					<description><![CDATA[<p>There is not any official distinguished between code Coverage and Test Coverage. Some practitioner has expressed their difference opinion in [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-code-coverage-and-test-coverage/">Difference between Code Coverage and Test Coverage | Code Coverage VS Test Coverage</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-3488 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/04/code-coverage-and-test-cove.png" alt="code-coverage-and-test-coverage-difference" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/04/code-coverage-and-test-cove.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/04/code-coverage-and-test-cove-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>There is not any official distinguished between code Coverage and Test Coverage. Some practitioner has expressed their difference opinion in terms of defining Code Coverage and Test Coverage.<br />
Code coverage and test coverage metrics are both measurements that can be seful to assess the quality of your application code. Code coverage is a term to describe which application code is exercised when the application is running.</p>
<p>Whereas Test coverage refers to metrics in an overall test-plan. In this expert  response, you&#8217;ll learn how quality assurance professionals use both of these metrics effectively.</p>
<p><strong>Another definition found over the google search as below;</strong><br />
<em>Code coverage</em> is a measure of how much code is executed during testing &amp;<br />
<em>Test coverage</em> is a measure of how many test cases have been executed during testing.</p>
<p><strong>Lets know about  Code Coverage by definition more in details.</strong><br />
In computer science, code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite. A program with high code coverage has been more thoroughly tested and has a lower chance of containing software bugs than a program with low code coverage. Many different metrics can be used to calculate code coverage; some of the most basic are the percent of program subroutines and the percent of program statements called during execution of the test suite.</p>
<h3>Basic coverage criteria</h3>
<p>There are a number of coverage criteria, the main ones being:</p>
<ul>
<li>Function coverage &#8211; Has each function (or subroutine) in the program been called?</li>
<li>Statement coverage &#8211; Has each statement in the program been executed?</li>
<li>Branch coverage &#8211; Has each branch (also called DD-path) of each control structure (such as in if and case statements) been executed? For example, given an if statement, have both the true and false branches been</li>
<li>executed? Another way of saying this is, has every edge in the program been executed?</li>
<li>Condition coverage (or predicate coverage) &#8211; Has each Boolean sub-expression evaluated both to true and false?</li>
</ul>
<p>[Taken from Wikipedia]</p>
<p>Simply put, code coverage is a way of ensuring that your tests are actually testing your code. When you run your tests you are presumably checking that you are getting the expected results. Code coverage will tell you how much of your code you exercised by running the test. Your tests may all pass with flying colours, but if you&#8217;ve only tested 50% of your code, how much confidence can you have in it?</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-code-coverage-and-test-coverage/">Difference between Code Coverage and Test Coverage | Code Coverage VS Test Coverage</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/difference-between-code-coverage-and-test-coverage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Code Coverage and Why Code Coverage?</title>
		<link>https://www.scmgalaxy.com/tutorials/what-is-code-coverage-and-why-code-coverage/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-is-code-coverage-and-why-code-coverage/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 17 May 2013 12:00:23 +0000</pubDate>
				<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Advantages]]></category>
		<category><![CDATA[Benefits of Code Coverage]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[Coverage]]></category>
		<category><![CDATA[Coverage Tools]]></category>
		<category><![CDATA[Quality analysis]]></category>
		<category><![CDATA[Software Quality]]></category>
		<category><![CDATA[Test Coverage]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[What]]></category>
		<category><![CDATA[What is Code Coverage]]></category>
		<category><![CDATA[Why]]></category>
		<category><![CDATA[Why Code Coverage]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2013/05/17/what-is-code-coverage-and-why-code-coverage/</guid>

					<description><![CDATA[<p>What is Code Coverage Code Coverage is an important measurement in Software Quality Engineering. While Software testing ensures correctness of [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-code-coverage-and-why-code-coverage/">What is Code Coverage and Why Code Coverage?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-3760 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/code-coverage.png" alt="code-coverage" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/code-coverage.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/code-coverage-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>What is Code Coverage</strong><br />
Code Coverage is an important measurement in Software Quality Engineering. While Software testing ensures correctness of the applications, a metric is required to track the What is Code Coverage Code Coverage is an important measurement in Software Quality Engineering. While Software testing ensures correctness of the applications, a metric is required to track the completeness and effectiveness of the testing undertaken. Code Coverage helps achieve reliable quality through identifying untested areas of the application.</p>
<p><strong>Why Code Coverage</strong><br />
Software testing is a challenging function. The testers need to ensure complete functional and non-functional correctness of the product. Considering the complex workflows and use cases of modern day applications, the number of unique cases that the software can be used often run into millions, which is not feasible to be covered under testing exercise. The testers thus need to<br />
&#8211; While Planning Tests<br />
o Ensure covering all workflows in terms of decision trees in the code<br />
o Ensure covering all data values – by identifying patterns rather covering millions of values<br />
&#8211; While testing<br />
o Ensuring the testing is completely exercising the whole application with planned and exploratory tests.</p>
<p>At the end of testing, the decision to stop testing and release the product still remains subjective, based on the presence or absence of bugs, inflow of new bugs, success rate of each test cycle, confidence rating of the testers or users, etc. Whereas the definitive metric of quantifying how much of the application was really tested, is missed.</p>
<p>Code Coverage is measured as quantification of application code exercised by the testing activities. Code Coverage can be measured at various levels – in terms of programming language constructs – Packages, Classes, Methods, Branches or in terms of physical artifacts &#8211; Folders, Files and Lines. For Eg. A Line Coverage metric of 67% means the testing exercised 67% of all executable statements of the application. A Code Coverage metric usually is accompanied by Code Coverage Analysis Report – which helps identify the un-tested part of the application code, thereby giving the testers early inputs for complete testing.</p>
<p><strong>Benefits of Code Coverage</strong></p>
<ul>
<li>Objective Indicator of Test Coverage of application code</li>
<li>Pointers to uncovered Packages / Classes / Methods / Branches</li>
<li>Pointers to uncovered Folders / Files / Lines</li>
<li>Drill down to untested part of source code and devise new tests</li>
<li>Early Indicator for Testing Quality and Fixing it by adding new tests.</li>
<li>Remove redundancy in testing</li>
<li>Increased Confidence for Releases</li>
</ul>
<p><strong>Test Your Test</strong></p>
<p><strong>Typical Emotional Storyboard</strong></p>
<ul>
<li>Write Some code! Happy!</li>
<li>Does it work? Sad!</li>
<li>Write some test! Happy!</li>
<li>Do they really test the code? Sad!</li>
<li>Measure the Code Coverage! Happy!</li>
</ul>
<p><strong>Coverage Measurement</strong></p>
<ol>
<li>Shows Which line of code are executed</li>
<li>How much of your code is covered by your tests?</li>
<li>Your tests test your product</li>
<li>Coverage testing tests your tests</li>
</ol>
<p><strong>Goal</strong></p>
<ul>
<li>100%</li>
<li>Coverage Ideal</li>
<li>Not Always possible</li>
<li>Can be expensive to achieve</li>
<li>Design for testability</li>
</ul>
<p><strong>Good: Write more tests</strong><br />
Only way to truly increase code coverage</p>
<p><strong>Bad</strong><br />
Excluding Code to boost Coverage</p>
<p><strong>Types of Coverage</strong></p>
<ol>
<li>Statement Coverage</li>
<li>Branch Coverage</li>
<li>Path Coverage</li>
<li>Loop Path Coverage</li>
<li>Data – driven Code</li>
<li>Complex Conditionals</li>
<li>Hidden Branches</li>
</ol>
<p><strong>How; &#8211; Coverage Tools</strong></p>
<ol>
<li>Clover</li>
<li>Cobertura</li>
<li>Emma</li>
</ol>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-code-coverage-and-why-code-coverage/">What is Code Coverage and Why Code Coverage?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/what-is-code-coverage-and-why-code-coverage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Overview of EMMA &#124; Code Coverage Tool &#8211; EMMA</title>
		<link>https://www.scmgalaxy.com/tutorials/overview-of-emma/</link>
					<comments>https://www.scmgalaxy.com/tutorials/overview-of-emma/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 17 May 2013 11:54:07 +0000</pubDate>
				<category><![CDATA[Code Analysis]]></category>
		<category><![CDATA[Advantages of Emma]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Code analysis]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[Code Coverage Tool]]></category>
		<category><![CDATA[Coverage]]></category>
		<category><![CDATA[Coverage Tools]]></category>
		<category><![CDATA[Emma]]></category>
		<category><![CDATA[EMMA Overview]]></category>
		<category><![CDATA[Overview of EMMA]]></category>
		<category><![CDATA[tool]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2013/05/17/overview-of-emma/</guid>

					<description><![CDATA[<p>Overview EMMA is a tool for measuring coverage of Java software. Such a tool is essential for detecting dead code [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/overview-of-emma/">Overview of EMMA | Code Coverage Tool &#8211; EMMA</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3763 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/emma-overview.png" alt="emma-overview" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/emma-overview.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/05/emma-overview-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" />Overview</h1>
<p>EMMA is a tool for measuring <em>coverage</em> of Java software. Such a tool is essential for detecting dead code and verifying which parts of your application are actually exercised by your test suite and interactive use.<br />
EMMA&#8217;s design strives for several, very elusive in their combination, goals:</p>
<ul>
<li>report rich coverage analysis data without introducing significant overhead during <em>either</em> build <em>or</em> execution time</li>
<li>be useful in team development environments, while at the same time enabling fast individual develop-test cycle</li>
<li>support quick development and testing of small standalone Java applications as well as scale up to massive enterprise sotfware suites containing thousands of Java classes</li>
</ul>
<p><strong>Advantages of Emma over other coverage tools</strong></p>
<p>EMMA differs from other coverage tools in its extreme orientation towards <em>fast</em> iterative develop-test style of writing software. JVM Profiler Interface (JVMPI)-based tools do not require an instrumented source build, but the runtime overhead of running with JVMPI on is empirically known to be very high and results in depressingly slow testsuite runs. For tools based on source code instrumentation, having to wait for a full source code rebuild just to check coverage metrics is not something a normal developer wants to do several times during a day. EMMA&#8217;s goal is to be so <em>unintrusive</em> that frequent daily checking of coverage numbers becomes second nature to <em>every</em> developer on the team, if not a completely automatic byproduct of every test run.</p>
<p><strong>Install and Configuration</strong></p>
<p>Method 1: To run on Command Line.<br />
Copying emma.jar to &lt;your jre dir&gt;/lib/ext/ directory for whichever JRE you use from command line.<br />
Method 2:<br />
Still, if you are wary of adding a third-party library as a standard JRE extension, just make sure that all your EMMA command line invocations add emma.jar to the JVM classpath:<br />
&gt;java -cp &#8230;/lib/emma.jar &lt;emma or emmarun command&gt;</p>
<p><strong>Implementing EMMA with Application</strong></p>
<ul>
<li>On the Fly Mode – Based suited for Standalone Application</li>
<li>Offline Mode – Best suited for J2EE framework based application</li>
</ul>
<p><strong>Implement EMMA in J2EE project {WebLogic, Websphere, Tomcat, JBoss, &#8230;}?</strong></p>
<p>There are very less opportunities given by Emma that  you would be able setup emma for J2EE Project on the fly mode. The reason behind this to fact that many J2EE features requires specialized class loading that will happen outside EMMA instrumenting class holder. The server might run fine but you will unlikely to get EMMA report.<br />
So, based Procedures to Instrument your classes prior to deployment (offline mode); offline instrumentation always follows the same compile / instrument / Package / deploy / get coverage / Generate report sequence.<br />
There are following steps need to follow to implement EMMA in J2EE based project…</p>
<ul>
<li>Use EMMA’s instr tool to instrument the desire classes. This can be done a post compilation step, before packaging. However many users also find it convenient to let EMMA process their jars directly (either in place, using overwrite mode, or by creating separate instrumented copies of everything, fullcopy mode.</li>
<li>do your J2EE packaging as normal, but do <em>not</em> include <strong>emma.jar</strong> as a lib at this level, that is, within your .war, .ear, etc;</li>
<li>locate whichever JRE is used by the container and copy <strong>emma.jar</strong> into its &lt;jre dir&gt;/lib/ext directory. If that is impossible, add <strong>emma.jar</strong> to the server classpath (in a server-specific way);</li>
<li>deploy your instrumented classes, .jars, .wars, .ears, etc and exercise/test your J2EE application via your client-side testcases or interactively or whichever way you do it;</li>
<li>to get a coverage dump file, you have three options described. It is highly recommended that you use coverage.get  control command with the ctl tool available in v2.1.</li>
</ul>
<p><strong>Notes:</strong></p>
<p>Reference:<br />
<a href="http://emma.sourceforge.net/faq.html#q.runtime.appservers">http://emma.sourceforge.net/faq.html#q.runtime.appservers</a><br />
<a href="http://emma.sourceforge.net/reference/ch02s03.html#tool-ref.instr.outmodes">http://emma.sourceforge.net/reference/ch02s03.html#tool-ref.instr.outmodes</a></p>
<p>Emma Integration with other tools</p>
<p>Emma Integration with Sonar<br />
Emma Integration with Hudson<br />
Emma Integration with CruiseControl</p>
<p><strong>jar instrumentation using Emma</strong></p>
<p><a href="http://primates.ximian.com/~flucifredi/emma-HOWTO.html">http://primates.ximian.com/~flucifredi/emma-HOWTO.html</a><br />
<a href="http://emma.sourceforge.net/reference/ch02s03.html#tool-ref.instr.outmodes">http://emma.sourceforge.net/reference/ch02s03.html#tool-ref.instr.outmodes</a><br />
<a href="http://primates.ximian.com/~flucifredi/emma-HOWTO.html">http://primates.ximian.com/~flucifredi/emma-HOWTO.html</a><br />
<a href="http://groovy.329449.n5.nabble.com/EMMA-Code-Coverage-has-problem-with-Groovy-classes-td360560.html">http://groovy.329449.n5.nabble.com/EMMA-Code-Coverage-has-problem-with-Groovy-classes-td360560.html</a></p>
<h1></h1>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/overview-of-emma/">Overview of EMMA | Code Coverage Tool &#8211; EMMA</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/overview-of-emma/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Clover and Maven working with Distributed Applications</title>
		<link>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/</link>
					<comments>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 07 Jul 2010 09:01:57 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Clover]]></category>
		<category><![CDATA[Clover and Maven working with Distributed Applications]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[Distributed Applications]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[How Clover and Maven works with Distributed Applications]]></category>
		<category><![CDATA[Instructions]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Maven Clover plugin]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Run]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2010/07/07/clover-and-maven-working-with-distributed-applications/</guid>

					<description><![CDATA[<p>1.       Configure maven clover plugin. 2.       Build the all components with clover enabled. 3.       Deploy the clover enabled build to [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/">Clover and Maven working with Distributed Applications</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4444" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi.png" alt="clover-and-maven-working-with-distributed-applications" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Configure maven clover plugin.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Build the all components with clover enabled.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Deploy the clover enabled build to test server.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Run the tests.</span></span></span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Create &amp; Review the Code Coverage Report.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;">Configure Maven Clover Plugin</span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><span style="font-family: Calibri; color: #000000; font-size: small;">Configure the maven plugin in pom.xml .If you are having multi module projects; you can configure the plugin in parent-pom instead of modifying each module’s pom xml.</span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;"><br />
Build all components with clover enabled.</span></span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;">Run the following command.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="text-indent: 0.25in; margin: 0in 0in 0pt 0.75in;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="mso-spacerun: yes;">  </span>“mvn <span class="apple-style-span"><span style="color: black;">-U clover2:setup package clover2:aggregate</span></span></span></span></strong><span class="apple-style-span"><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">”</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;"><span style="mso-spacerun: yes;">   </span><span style="mso-tab-count: 1;">             </span>If you got something like this</span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Loaded from: C:\Documents and Settings\Administrator\.m2\repository\com\cenqua\clover\clover\2.6.3\clover-2.6.3.jar</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Clover: Commercial License registered to ABC Corporation.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Creating new database at &#8216;C:\p4_depot\trunk\4A\target\clover\clover.db&#8217;.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Processing files at 1.5 source level.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Clover all over. Instrumented 5 files (1 package).</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Elapsed time = 0.532 secs. (9.398 files/sec, 812.03 srclines/sec)</span></span></span></span></p>
<p class="MsoNoSpacing" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><em><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">Congratulation, you get clover work with your source!!</span></span></span></span></em></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-style: italic;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-style: italic;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">Deploy the clover enabled build to test server.</span></span></span></span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Deploy the Clover enabled build to the server. The same process as normal </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Copy the Clover registry file to the appropriate directory on each of the test servers </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">The registry file is the DB file create during compile, defined by <em>initstring </em>parametersclover‐setup task, this needs to occur after the Clover build is complete, and before you run your tests </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Background: the Clover initstring </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">FileName: xxx.db </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">At build time, Clover constructs a registry of your source code, and writes it to a file at the location specified in the Clover initstring. When Clover‐ instrumented code is executed (e.g. by running a suite of unit tests), Clover looks in the same location for this registry file to initialise itself. Clover then records coverage data and writes coverage recording files next to the registry file during execution</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Notes: gives the folder contains the registry file full control permissions </span></strong></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; font-size: small;"> </span></span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">Recommended Permissions </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Clover requires access to the Java system properties for runtime configurations, as well as read write access to areas of the file system to read the Clover coverage database and to write coverage information. Clover also uses a shutdown hook to ensure that it flushes any as yet unflushed coverage information to disk when Java exits. To support these requirements, the following security </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">permissions are recommended: </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;"> </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">grant codeBase &#8220;file:/path/to/clover.jar&#8221; { </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.util.PropertyPermission &#8220;*&#8221;, &#8220;read&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.io.FilePermission &#8220;&lt;&gt;&#8221;, &#8220;read, write&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.lang.RuntimePermission &#8220;shutdownHooks&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">} </span></em></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;"> </span></em></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">Grant Permissions to clover.jar </span></em></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="color: #000000;">Edit the java.policy file of the java runtime on the test server </span></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="color: #000000;">%JAVA_HOME%/jre/lib/security</span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt 0.5in;"><span style="color: #000000;">Copy clover.jar and license file to the java runtime class path of the test servers </span></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="color: #000000;">%JAVA_HOME%/jre/lib/ext </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;">Run the test suite</span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Run the test suite as normal. Either automation test case or manual test case.</span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;">Create Code Coverage Report</span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Copy the coverage recording files to build machine. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Once test execution is complete, you will need to copy the coverage recording files from each remote machine to the initstring path on the build machine in order to generate coverage reports. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Background: CoverageRecording Files </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Filename:xxx.dbHHHHHHH_TTTTTTTTTT or clover.dbHHHHHHH_TTTTTTTTTT.1 (where HHHHHHH and TTTTTTTTTT are both hex strings) </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">CoverageRecording files contain actual coverage data. When running instrumented code, Clover creates one or more Coverage Recorders. Each Coverage Recorder will write one CoverageRecording file. The number of Coverage Recorders created at runtime depends the nature of the application you are Clovering. In general a new Coverage Recorder will be created for each new ClassLoader instance that loads a Clovered class file. The first hex number in the filename (HHHHHHH) is a unique number based on the recording context. The second hex number (TTTTTTTTTT) is the timestamp (ms since epoch) of the creation of the Clover Recorder. CoverageRecording files are named this way to try to minimise the chance of a name clash. While it is theoretically possible that a name clash could occur, in practice the chances are very small. </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">CoverageRecording files are <strong>written </strong>during the execution of Clover‐instrumented code. CoverageRecording files are <strong>read </strong>during report generation or coverage browsing. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Run the generating report goal to create the report. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="color: #000000;"><span style="mso-tab-count: 2;">                                </span>“mvn clover2:clover”</span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-tab-count: 1;"><span style="color: #000000;">                </span></span></strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/">Clover and Maven working with Distributed Applications</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
