Ant Example code for Emma Instrumentation

rajeshkumar created the topic: Ant Example code for Emma Instrumentation

In-place instrument a certain subset of already compiled classes using overwrite mode and several coverage filters:

<emma enabled="${emma.enabled}" >
      <instr instrpathref="${out.dir}/classes"
             mode="overwrite"
      >
        <!-- always exclude every class with a "Test" in the name: -->
        <filter excludes="*Test*" />
        <!-- don't instrument everything in "${out.dir}/classes",
             only the stuff I am working on now: -->
        <filter file="myincludes.txt" />
        <!-- additional ANT command line hook: -->
        <filter value="${emma.filter}" />
      </instr>
    </emma>

Don’t overwrite compiled classes that later need to go into official release jars (stay in copy mode). However, use incremental instrumentation for fast personal testing:

 <emma enabled="${emma.enabled}" >
          <instr instrpathref="${out.dir}/classes"
                 outdir="${out.dir}/classes-instrumented"
                 merge="yes"
                 filter="${emma.filter}"
          />
    </emma>

Take all jars already produced by the product build and make test (coverage-enabled) copies of them:

  <emma enabled="${emma.enabled}" >
          <instr mode="fullcopy"
                 outdir="${out.instr.dir}"
                 merge="no"
                 filter="${emma.filter}"
          >
            <instrpath>
              <fileset dir="${out.dir}" includes="**/*.jar" />
            </instrpath>
          </instr>
    </emma>
<copy todir="${dist}">
      <fileset dir="${src}"
               includes="**/images/*"
               excludes="**/*.gif"
      />
    </copy>
<copy todir="${dist}">
      <fileset dir="${src}">
        <include name="**/images/*"/>
        <exclude name="**/*.gif"/>
      </fileset>
    </copy>
 
<fileset dir="${server.src}" casesensitive="yes">
      <include name="**/*.java"/>
      <exclude name="**/*Test*"/>
</fileset>
<fileset dir="${server.src}" casesensitive="yes">
      <patternset id="non.test.sources">
        <include name="**/*.java"/>
        <exclude name="**/*Test*"/>
      </patternset>
</fileset>

Groups all files in directory ${client.src}, using the same patterns as the above example.

<fileset dir="${client.src}" >
  	<patternset refid="non.test.sources"/>
</fileset>
 

Groups the same files as the top example, but using the selector.

<fileset dir="${server.src}" casesensitive="yes">
  <filename name="**/*.java"/>
  <filename name="**/*Test*" negate="true"/>
</fileset>

Groups the same files as the previous example using a combination of the selector and the selector container.

<fileset dir="${server.src}" casesensitive="yes">
  <filename name="**/*.java"/>
  <not>
    <filename name="**/*Test*"/>
  </not>
</fileset>

Selects all files in src/main

<fileset dir="src" includes="main/" />
 
     	<emma enabled="${emma.enabled}" >
          <instr mode="overwrite" 
          	 instrpath="${jar.location}"
                 destdir="${inst.jar.location}"	
                 metadatafile="${inst.jar.location}/metadata.emma"
                 merge="no" >
            	<instrpath>
              		<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
            	</instrpath>
 
         </instr>
      	</emma>
 
 
      	<emma enabled="${emma.enabled}" >
	          <instr mode="fullcopy" 
	          	 instrpath="${jar.location}"
	          	 outdir="${inst.jar.location}"
 
	                 metadatafile="${inst.jar.location}/metadata.emma"
	                 merge="no" >
	            	<instrpath>
	              		<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
	            	</instrpath>
 
	         </instr>
      	</emma>

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Sonar.lock.db what it this file ??

hareesh.aims created the topic: sonar.lock.db what it this file ??

Hi Rajesh , I installed Sonarqube in AWS, later i Unzipped to Opt directory , I tried to delete the sonarqube folder using this command rm -rf sonarqube-6.4.
My question is , after deleting the Sonaqube folder i see a file called “sonar.lock.db” and I see the contents as in this link github.com/saravanan-na/sonar/blob/maste…1/data/sonar.lock.db . Can you explain me what is for ?????

rajeshkumar replied the topic: sonar.lock.db what it this file ??

It seems like that before deleting the directory, you have not stopped the SonarQube servers and that a reason H2 alogn existing java process is holding the lock. You need to reboot the server or follow the instructions here

stackoverflow.com/questions/8158969/h2-d…d-by-another-process

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Source code analysis tools: Evaluation criteria

code-analysis-tools-evaluation-criteria

Source code analysis tools: Evaluation criteria

Support for the programming languages you use. Some companies support mobile devices, while others concentrate on enterprise languages like Java, .Net, C, C++ and even Cobol.

Good bug-finding performance, using a proof of concept assessment. Hint: Use an older build of code you had issues with and see how well the product catches bugs you had to find manually. Look for both thoroughness and accuracy. Fewer false positives means less manual work.

Internal knowledge bases that provide descriptions of vulnerabilities and remediation information. Test for easy access and cross-referencing to discovered findings.

Tight integration with your development platforms. Long-term, you’ll likely want developers to incorporate security analysis into their daily routines.

A robust finding-suppression mechanism to prevent false positives from reoccurring once you’ve verified them as a non-issue.

Ability to easily define additional rules so the tool can enforce internal coding policies.

A centralized reporting component if you have a large team of developers and managers who want access to findings, trending and overview reporting

Tagged : / / / / / / / / / / / / / / / / / /