David's Blog

Profiling Tools

Today I did a short evaluation of free profiling tools. I have used Yourkit Java Profiler for some years now, and I am a big fan of it, but I wanted to give the alternatives another try.

First I had a look at Eclipse TPTP. Last time I tried (3 years ago) I couldn't even get it to start on my Mac. This time I am working on a Windows PC, so I thought this could be better supported. I downloaded it using the update site for eclipse, and after a restart of eclipse I got a nice introduction screen saying that I can now profile applications. So, I right-clicked on a project, selected "Profile As -> JUnit Test", and: Nothing happened. Except that after some time an exception message said that the profiler timed out. So, TPTP still sucks. BTW, I tried to search for solutions, but in the discussion forums and mailing lists are no real hints how to solve this problem.

The other tool I tried was jvisualvm, which is included in Java 6. I started it, and it found some java applications running. I launched the unit tests, and connected jvisualvm to the running tests. I got profiling results, but found no way to analyze them. Compared to Yourkit, jvisualvm is just a toy.

What I've learned today is that Yourkit is definitely worth the money. My advice for anyone who needs a profiling tool is: Download the trial version of Yourkit. I bet you'll buy it after the 15 days ;)

Posting Type: 

It's about courage

Refactoring large parts of a complex software system can cause a lot of troubles. And it is difficult. And I am always afraid to do it. But we have a lot of automated unit tests, integration tests and user acceptance tests in my current project, so most of the time I am pretty confident that I can make it. Without destroying any major feature.

Some days ago, I had a discussion with my co-workers whether we should start a large refactoring or not. Some were against it because of our tight schedule. We are committed to deliver working software at the end of the sprint, and we are committed to deliver the selected sprint backlog. And refactoring that part of the program would affect a lot of existing functionality, and all the committed user stories for the sprint.

After this discussion I really was not sure anymore if the refactoring would be a good idea right now. But it was absolutely necessary. We had a lot of code duplication. Some classes were used but not needed anymore, because the functionality could have been added to their base class. Responsibilities of one object were distributed over several classes.

Yesterday, despite all doubt, I started the refactoring. Today before noon I had outlined the basics so my co-workers could build on it. Shortly after that all unit- and integration-tests were green again. I started tomcat and tested the Application - all existing functionality still worked.

Implementing the current user story was really easy using the new design, and the next will be easier than before the change too. The refactoring was really successful - Everything still works and we have earned a quick win. And there were so many good arguments against starting it.

It's all about courage. (One of the 5 values)

You might be also interested in...
Learn more about how I can help you save money and earn money by courageously improving your software quality.

Posting Type: 

Certified Scrum Master

Last week I attended a "Certified Scrum Master Training" in Linz (Austria). It was held by Christoph Mathis and Andreas Wintersteiger. Today I have completed the exam, and so now I am:

Certified Scrum Master badge

Posting Type: 

"The Success of MultiTouch is a Lie"

The Success of MultiTouch is a Lie by Josh Marinacci - very interesting reading. Like just about everything on Josh's blog. So everybody who doesn't read it yet: Read Josh on Design. It's great.

Posting Type: 

JAX London, here I come

I just booked the flight to London and the Hotel (Notting Hill Gate Hotel) for my Stay at London. I will arrave on 2010-02-17 and visit the JAX London on 2010-02-22 and 2010-02-23. Departure is on 2010-02-24. If somebody wants to meet me there: Feel free to cantact me - the details can be found on the main page.

Posting Type: 

JSXP 0.6 Released (or: Where is 0.5?)

JSXP 0.6 has been released today. The release contains some new features, like file uploads and application parameters. It also includes several bug fixes. The Javadoc Documentation is available here.

So, where is version 0.5, you might ask... We did not release one. While Oliver was already working on 0.6 we found some issues with the code which should have been 0.5, so we decided to skip 0.5 and fix all issues in 0.6.

Posting Type: 

Yet another mobile OS

Samsung is launching a new, open mobile operating system called Bada. It seems to be based on a proprietary OS they already have.

Is this the OS running on my YP-P2? If yes, it is definitely nice, but it would also need some improvements. For example, the touch screen handling (especially when scrolling) could definitely be improved.

Also, do we really need yet another mobile OS? We will see in 2010 if this really catches on.

Posting Type: 

Project Lombok

We are using Project Lombok in a large project, and I thought I should write a few lines about it. I think it is a really nice idea, but it also causes a lot of troubles. For those who don't know project lombok: It creates a lot of bytecode for you, you just have to annotate your java classes. For example, you can write a java class like:

@Data public class MyBean() {
    private final String foo;
    private String bar;
    private int foobar;

Project lombok will then create getters and setters for all private variables, a constructor to initialize all final fields, a nice toString() method and a correct hashCode() method. The cool thing is that it does not create any source code. Instead, project lombok hooks itself into the java compiler and creates the byte code for all these methods.

The bad thing about this is that it is an "ugly hack". They use undocumented features of the java compiler, and you need a special eclipse plugin to make compilation work in eclipse.

This eclipse plugin breaks some of useful features of eclipse:

  • It breaks CTRL+Shift+g: "References in Workspace" is a feature of eclipse I use really often. But since you don't have any get/set methods anymore, you can not invoke it from the code. Invoking this search from the quick outline (CTRL+o) doesn't seem to work either. You can invoke it from the outline view, but I normally don't have this view enabled, because my eclipse is already cluttered enough.
  • It breaks eclipse code generation: Generating code (like the serialVersionId or creating methods from an interface/abstract super class) doesn't work correctly anymore. All generated code is inserted before the beginning of the class.
  • It breaks refactoring: Refactoring is impossible. The only way you can change a lombok-property is by renaming the private variable, and then fixing all compiler errors where the old methods are called.
  • It breaks inheritance: A lombok @Data bean can not extend another @Data bean if the base class has final fields, because lombok doesn't create the correct constructor / super call in the derived class.

So, my conclusion is: While project lombok saves you from writing some boiler plate code, it causes more problems than it solves. Especially because I never write getters, setters, equals, hashCode or toString myselft: Eclipse does this for me, and it works fine.

Posting Type: 

Bad Justification

I don't like doing pointless things. Sometimes it's OK for me to do them anyway, for example when things which seem pointless to me are important to somebody else. Or when it is company policy to do things that way, and this policy could ne-ver be changed.

What really bugs me is when I talk to people who defined the way I have to do things, and their reaction is "I know it would be better to do it differently, but people would not get it right anyway". This is an insult to the people who have to do things, because you are basically saying that they are too dumb to do it right. And you are admitting that you don't even want to try. So, please don't say things like this.

Posting Type: 

Scrum Sprint

Yesterday, the second sprint of my current project started. It is my first scrum project, and I am really glad that I have the chance to work in one. I was always interested in Agile development, and scrum in particular, but so far I never had the chance to get hands-on experience. Now this is about to change - I am even considering to become a certified scrum master.

During the planning of the second sprint we had help from a well known scrum consultant: Andreas Wintersteiger. It's really helpful to have someone experienced who ansers all your questions. We now feel that we are much better prepared than during our first sprint. We now even have a task board:

Empty task board

This image is from friday, now the task board obviously looks completely different. In the first sprint we tried to manage the tasks with JIRA, which is quite good. But a real task board on the office wall is much better (more fun :) ). It's easier to see progress this way, and moving / resolving tasks is more communicative.

You might be also interested in...
Learn more about how I can help you save money and earn money by improving your implementation of Scrum.

Posting Type: 


My name is David Tanzer and I have been working as an independent software consultant since 2006. I help my clients to develop software right and to develop the right software by providing training, coaching and consultanting for teams and individuals.

Learn more...

Subscribe to RSS - David's Blog