Thursday, September 22, 2011

A Review of NetBeans IDE 7 Cookbook

A few weeks (actually a month+) ago, I was sent a request to review the NetBeans IDE 7 Cookbook and blog about it. Incidentally, I was preaching/teaching Netbeans to a few students during the same time. So, although I thought it came at the right time, later I was travelling quite a bit and didn’t have much time to read through the book. Finally, in the last few days, I decided that I should read through the book and see what it is all about. 

The book is published by Packt Publishers and written by the Brazilian Rhawi Dantas. It is nicely arranged in terms of the chapters and the kind of details that it talks about. Starting from the basics of creating projects, importing projects, to designing GUIs, Web projects, Mobile development, Profiling and Testing… It covers most parts of the IDE pretty well.

What it lacks is the depth of coverage. Like Maven and some of the options like skipping tests is a very useful feature in Netbeans is missing from the book. Or the WSDL Editor. Or Navigation features like Go To Implementation is missing!!

In conclusion I’d say the book is interesting for beginners and slightly boring for experienced Netbeans users. If you are preparing for Netbeans Certification, then this is a book you should read, but otherwise I feel the web documentation of Netbeans is good enough to find your way through… I’d rate this book 2.5/5

NetCAT 7.1 Bug Counting

Since, I have signed to NetCAT 7.1 (Community Acceptance Program), I wanted a quick way to see the number of bugs that I have filed compared to the other top 20, I’ve written a small script to go through bugzilla. The one that is on the page seems a little complex to look at and has lots of numbers to look at.

I’ve done this instead:

Beyond the bugs, there is also the email count… We will get to that later!!

Sunday, September 18, 2011

Speeding up Unit Tests by running them in parallel

I just discovered an interesting parameter in the maven-surefire-plugin when using JUnit 4.7+, that tests can be executed in parallel. With multi-threaded CPUs, OS and the like, this helps a lot when you want to decrease the time of your test suites.

So, what are the configurations options that you have:
  1. Running test methods in parallel:
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.9</version>
    <configuration>
    <parallel>methods</parallel>
    </configuration>
    </plugin>

  2. Running test classes in parallel:
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.9</version>
    <configuration>
    <parallel>classes</parallel>
    </configuration>
    </plugin>

There are some things to take care when running unit tests in parallel. Some of them might not be independent, isolated and reproducible. There are times when you have some test methods that might depend on other methods in the test class. That time you should use the parallel test class execution. You may also want to tweak the number of threads and core on which these threads run, using this configuration:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<parallel>methods</parallel>
<threadCount>4</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
</configuration>
</plugin>

Saturday, September 17, 2011

Sad state of Dell service centers, but loving my new SSD

I had received my new Intel 320 Series SSD nearly 2 weeks back, but have been struggling to find a way to fit it in my Dell Studio 1749 laptop. Struggling because the SSD didn’t ship with a laptop connector/caddy and Dell’s extremely bad service centers in Mumbai.

Even before I had my SSD, I looked through all the documentation on how to fit it in. I wanted to add the SSD to the second drive slot that is part of my laptop, but needed a caddy and L-shaped SATA connector. I had enquired the Dell customer care and they responded, they didn’t sell the stuff but should be available at the service centers in Mumbai. So as soon as the SSD arrived, I landed at the service center. But what stupidity on my part, to expect the dell service center engineers to know what I was going to talk about. One of the engineers bet with me that laptop’s can’t have two hard disks, another said I have to “burn some plastic” to fit it in. No one, out of the 7-odd engineers at the Dell service centers in Andheri or Mumbai Central had heard the word “caddy” in their lives!! (!!Damn Golf!!)

Nevertheless, after a couple of hours of trying to explain to these people, I had full faith on our lamington road fellows to have imported something from China. Sadly, it was just the regular “atta-chawal” (off-the-shelf stuff) that you can get at every computer shop around the city. Why would people come so far to lamington road, if they didn’t keep “not-so-common” parts?? Not that Dell has any small market in India… so the lamington road shopkeepers should have atleast heard or seen such a possibility… Nevermind, I realized from earlier that an eSATA cable for Seagate GoFlex Agent HDD (STAE103) is impossible to find in this market, forget my caddy!! After visiting over 30 shops and 5 laptop repair guys, I was convinced (… and even they were) that such a thing was impossible to find in India

So, I ordered online with priority shipping from the nice guys at newmodeUS. I say nice because I called them after ordering to clarify about the eSATA cable that I also purchased (already cut to work with Seagate GoFlex Open-mouthed smile) along with my caddy and they answered nicely. I couldn’t find anywhere in Norway that had these either!! Sad smile. It reached me in 2 days and I was happy again!!

DELL_1745_1747_caddy 2intel-ssd-320-series-small eSATA-GoFlex

Boot times from 35 sec to 19 sec; Shutdown from 15 sec to 6 sec. Netbeans starts in less than 7 sec compared to 25 sec. Overall amazing performance upgrade!!! The laptop even earlier was a performance beast with 8GB RAM, 500HDD, 4-thread, 3+Ghz i7 processor… but this speed boost is awesome!!