Posts

Showing posts from March, 2008

Windows Vista SP1 Released Today

Get it from http://www.microsoft.com/downloads/details.aspx?FamilyID=b0c7136d-5ebb-413b-89c9-cb3d06d12674&DisplayLang=en.

I had the RC1 installed and so when i tried installing the SP1 release then it gave me an error that SP1 is already installed.

So, you must remove all previous version of SP1 before upgrading to the next.

Control Panel > Programs and Features > Installed Updates (upper left corner
under Tasks) > Highlight "Service Pack KB936330" > Uninstall

It will take awhile, there will be 2-3 reboots. Then you can install the
new version.

Follow the above steps and then go to the given link above (for MS download center for Vista SP1) and download and install the SP1 here. To know the features of SP1 please refer to this article.

Using SAP Memory Analyzer for Java memory leak detection

[Click to watch video of using SAP Memory Analyzer]I recently had opportunity to use the SAP Memory Analyzer tool for analyzing an HPROF heap dump generated on OutOfMemory error in code. I found that its an excellent and user friendly tool for job of memory leak analysis with good documentation. Though i generally preferred to use JHAT for heap walking but i realized that this SAP tool is much more intuitive and memory leak detection in code was a breeze. The above video tutorial talks about using the version 1.1.1 (which happens to be the latest at this time). Highly recommended.

Emma vs Cobertura

The 2 open source Java code coverage tools that are the best among the lot are cobertura and emma. Both have their own pros and cons.

Cobertura - http://cobertura.sourceforge.net/
vs
Emma - http://emma.sourceforge.net/

Points borrowed from: http://raibledesigns.com/rd/entry/emma_vs_cobertura_for_code
Video : http://video.google.com/videoplay?docid=820584080702226910

Emma:
1. Stats on both class and method coverage
2. Partial/fractional line coverages is unique trait - shown in yellow when there are multiple conditions in a conditional block like if (x < 0 and x > 10) and say x > 10 never gets executed this is shown in yellow. This is important feature which lets us determine if the tests cover all conditions of such more than one conditions conditional blocks.
3. Not being actively developed.
4. Stricter code coverage.
5. Integration with Eclipse available - http://www.eclemma.org/
6. Better documentation than cobertura.
7. Instrumentation process is faster than cobertura.
8. Standalone …

Using TestNG with Emma for automating test code coverage report generation

TestNG and Emma can be used together to automate the generation of code coverage report after every test run in the ANT builld script.
Following ant build script snippet shows how both tools are used together for this important metrics collection.

To run it:
$ ant emma test

This will generate the code coverage report for the TestNG tests in ./coverage directory (where, basedir = ".").

<!-- output directory used for EMMA coverage reports: -->

<property name="coverage.dir" value="${basedir}/coverage" />

<!-- directory that contains emma.jar and emma_ant.jar: -->
<property name="emma.dir" value="${lib}/emma" />

<!-- path element used by EMMA taskdef below: -->
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>

<!-- this loads <emma> and <emmajava> custom tasks: -->
<taskd…