Dienstag, Dezember 28, 2004

Slides of Talk: Refactorings in Large Projects

Here are the slides of my talk "Refactorings in großen Softwareprojekten" ("Refactorings in Large Software Projects") which I gave at the XP Days in Karlsruhe. Since the talk was given in german the slides are german also.

Post bewerten

Sonntag, Dezember 26, 2004

Managing Module Dependencies in Large Systems

In larger projects it is nearly impossible to avoid degeneration of large scale structures without tool support. It is far too easy to import missing packages with one key-stroke in modern IDEs like Eclipse or IDEA.
My experience is that almost every projectwith more than 500 classes has unwanted dependencies between its modules (module = coherent set of packages). Often even cycles between modules occur.
There are some Open-Source solutions that help to avoid unwanted dependencies in Java projects or at least discover them early:
  • Put every module in its own JAR file. An ANT build script can then discover unwanted depdencies during compilation and generation of the JAR files.
  • If Eclipse is used: Define an Eclipse project for every module and let Eclipse manage the dependencies.
  • The use of the Eclipse plugin model allows even finer control but brings some overhead with it.
  • Define the allowed dependencies in a Fitnesse test. There is an easy to use solution named JDependFixture. Especially when you use Fitnesse already the your project JDependFixture may be a convenient solution.
  • XRadar is also based on JDepend and checks dependencies between modules (in XRadar modules are called subsystems). XRadar uses a XML definition of modules and dependencies and creates a graphical representation of the existing dependencies. XRadar is especially convenient when a nightly build process is in place, for example based on Cruise-Control.

Post bewerten

Mittwoch, Dezember 08, 2004

Book: Refactorings in Large Projects

Martin Lippert and I wrote a book about Refactorings in Large Projects that is out now for review. We are very interested in your feedback. Simply write an email to stefanATstefanroockDOTde.

Post bewerten

Taxonomy of code smells

There is a new taxonomy of code smells.

Post bewerten

Sonntag, November 21, 2004

Large Refactorings at XP-Days Karlsruhe

I will talk about Large Refactorings at the XP-Days 2004 in Karlsruhe.

Post bewerten

Sonntag, November 14, 2004

Distributed Computation@home

SETI @ home was the first software for distributed computing at home: CPU time not used by the user is used for a really large distributed computation project. The experiences with SETI @ home were used to create a content independent platform for distributed computing: BOINC.
There are additional public projects for distributed computation using BOINC available at the BOINC link given above.

Post bewerten

Freitag, November 05, 2004

Rich Client Patterns

Martin Fowlers book "Pattern of Enterprise Application Architecture" lacks patterns for rich client applications. On his website Martin Fowler has collected first patterns for rich client applications.

Post bewerten

Samstag, Oktober 30, 2004

Multiple Customers in XP

Ron Jeffries has written a short but interesting article about how to deal with multiple customers: Petition the King. He uses the metapher of villagers coming to the king regularly (one a month or one every two weeks) to explain their requests. The king has limited resources and decides about the usage of the resources.
In XP the king is not a developer since decisions about distributing resources is a bussiness decision not a technical desicion. Therefore king is a kind of super customer, head of marketing for a product company or something similar.

Post bewerten

Freitag, Oktober 22, 2004

Design in Agile Methods

One of the most controverse aspects of agile methods is the role of design. In eXtreme Programming the practice is stated explicitly: Simple Design.
Buzz words describing simple design are:
  • You ain't gonna need it (the YAGNI principle).
  • Keep it simple, stupid (the KISS principle).
  • Design for Today.
  • No Big Design Upfront (BDUF).

Two articles (available online) about the topic give further insights:

Post bewerten

Sonntag, September 19, 2004

Paper on Pair-Programming

There is a new paper on Pair-Programming online - only in german.

Post bewerten

Donnerstag, September 16, 2004

Managing ANT scripts

In larger Java projects the ANT scripts tend to become complicated and hard to handle. Too often the ANT scripts produce incomplete results or need too much runtime. Eric M. Burke wrote down useful best practices for ANT scripts.
And he wrote a little tool that visualizes the dependencies of ANT targets: AntGraph.

Post bewerten

Dienstag, August 31, 2004

How to write unmaintainable code

Funny and true article: http://mindprod.com/unmain.html

Post bewerten

Visibility of Automatic Build

There is a cool kit for making the results of automatic builds (e.g. with Cruise-Control) visible: Bubble, Bubble, Build's In Trouble. And it costs less than 100 USD.

Post bewerten

Donnerstag, August 26, 2004

XRadar: Structural Analysis for Java projects

We startet to use XRadar in a larger project for structural analysis, e.g. dependency checks between subsystems and packages.

XRadar is open source and combines a lot of useful small tools like JDepend and PMD to form a complete analysis suite. We integrated XRadar into our Cruise-Control build process and got helpful results about the structure of our system.

Post bewerten

Dienstag, August 17, 2004

Time Travel Pattern Language

I just discovered a paper describing the Time Travel pattern language for objects that change. The patterns address objects that have a browsable history of modifications where the modifications can have effects in the past and the future. These problems often arise with contracts where the time of making the modification can differ from the time where the modification takes effect.
Example: One week ago I buyed a new car. Now I send a notice to my insurance company. While the contract is modified tomorrow when my notice reaches the insurance company, the modification has to take effect one week ago in the past.
Once I was in a project at an insurance company and we had exactly the same problems. At the end we came to very similar solutions. Had we known the Time Travel pattern language we could have saved a lot of time, not only to find the solutions but more important to communicate the problems and the solutions.

Post bewerten

Montag, August 16, 2004

Unit Test Smells

The term smell was taken from the refactoring discussion. There a code smell comes from an ugly piece of source code that should be restructured (refactored) as soon as possible. Typical code smells are duplication of code, unneccessary indirections etc.
The term smell can be transferred to a lot of other “domains”, e.g. to the wide area of testing. This article is a first attempt to collect smells for the area of unit tests.

Post bewerten

Freitag, August 06, 2004

C-JDBC: open-source inexpensive DB clustering

When searching for techniques to create Java enterprise applications without buying and using heavyweight products one should take a look at C-JDBC. C-JDBC is an open-source product that supports the RAIDb concept (Redundant Array of Inexpensive Databases): C-JDBC encapsulates several database instances behind a regular JDBC api. To introduce C-JDBC into a project existing code needn't be modified as long as all database access is handled via JDBC.

Post bewerten

Donnerstag, August 05, 2004

Modular Software with PicoContainer

Most OO systems claim to be modular but very few really are. Normally OO systems have cycles between they modules. Even if there are no cycles the dependencies between the so called modules are chaotic and inflexible. A typical result is that developers can't instantiate a small set of classes for unit testing without having the rest of the system.
PicoContainer is an open-source project that provides a IoC-Container (IoC = Inversion of Control) that is very useful for defining and managing the dependencies between modules.

I collegue asked me once when I would PicoContainer into a project:
  • Right from the beginning?
  • Even for prototyping?
  • When the system exceeds a certain size?
I think that projects should use PicoContainer right from the beginning and even for prototypes. Even for very small prototypes PicoContainer pays off measured in Lines of Code and it adds very small overhead to the project.
Adding PicoContainer later to a project results in refactoring and will therefore often not done.

Post bewerten

Sonntag, August 01, 2004

Do You like to Eat an Elephant?

There is an funny and interesting article about EJB out there, called "Don't Make me Eat the Elephant Again". The autor argues that for most project EJB ist just too big and suggests some lightweight approaches to building Java Enterprise Applications.
I like the article very much since I know the suffer the author describes from my programming and consulting experience. It is the time for a change!

There is a very interesting book about the topic: Bruce Tate, Justin Gehtland: "Better, Faster, Lighter Java".

Post bewerten

Samstag, Juli 31, 2004

SCRUM Master

I participated the SCRUM Master training in Karlsruhe held by Joseph Pelrine. That was fun and now I'm a certified SCRUM Master.
BTW: A collegue of mine said that "SCRUM Master" sounds like something evil. I try to be not too evil :-)

Post bewerten

Funny GridBagLayout

Its always a highlight when profession meets fun. A very funny and striking description of Java's GridBagLayout is available as an interactive weblog.

Post bewerten

Donnerstag, Juli 15, 2004

JMigrator 0.4.0 released

I released the first version of JMigrator at Source-Forge as an Eclipse 3 plugin.
If anybody is interested in participating at the further development, please contact me.

Post bewerten

Montag, Juli 05, 2004

Trashcan Frameworks

Application specific frameworks often degenerate and become Trascan Frameworks. I have written my thoughts in a short article "Trashcan Frameworks".

Post bewerten

Sonntag, Juli 04, 2004

Large Refactorings and Fitnesse at Java Forum Stuttgart

Martin Lippert and I held a lalk about Refactorings in large Projects at the Java Forum Stuttgart. The slides are here (german). I submitted a presentation about aceptance testing with Fitnesse. This was accepted as a failover presentation. Since no other presentation was cancelled, the presentation wasn't held. But the slides are here for download although (german).

Post bewerten

Freitag, Juni 25, 2004

Refactoring Example for Beginners

I found a small code example that could be used by refactoring beginners.
  • What smells are in the code?
  • What refactorings can be used to remove the smells?
  • How small can the new solution be? (If you send me your refactored solution I may publish it here.)

P.S.: The code in C# but it should be easy to convert it to Java.
P.P.S.: If someone has the code in Java, please send me a link.

Post bewerten

Samstag, Juni 19, 2004

Customer related blog of Chris Matts

Chris Matts was a panelist at XP2004 conference. He works as a consultant for customers using Agile Methods. He has some very interesting things to say - a lot of these can be found at his blog.

Post bewerten

Book: Agile Software Development in the Large

First hand experiences from and guidances for doing large agile projects are very rare. Jutta provides helpful insights into large projects in general and the special challenges of doing large projects with agile methods like eXtreme Programming, Scrum or Crystal.

Jutta Ecksteins book "Agile Software Development in the Large: Diving into the Deep" (Dorset House Publishing) is published now. A german translation was published under the title "Agile Softwareentwicklung im Großen" (dpunkt Verlag).

Post bewerten

Donnerstag, Juni 17, 2004

Master Thesis with Empirical Data about Agile Methods

The master thesis of Carsten Dogs and Timo Klimmer provides some interesting empirical data about agile methods like eXtreme Programming.

Post bewerten

Samstag, Juni 12, 2004

Refactorings in großen Softwareprojekten

Martin Lippert and I have written a book about doing Refactorings in large projects. The book is available in german now from dpunkt. The english translation should be available in a few months.

Post bewerten

XP 2004: Agile Project Controlling

Henning Wolf and I have given a talk about Agile Project Controlling at the XP 2004 conference.

Post bewerten

Mittwoch, Mai 26, 2004

Some Research Questions

I am interested in some research questions but as far as I can see I won’t have the time to do the research. If you have the time feel free to pick a research question. I would be happy to get feedback if someone did some work on the research questions. Then I can publish references to the results on my web site.

Research Questions

Post bewerten

Sonntag, Mai 16, 2004

Open Source Technology Stack for Java Projects

Open-Source tools for Java development have reached a maturity that often goes far beyond commercial tools. A lot of Java projects doing business applications can come along with Open-Source tools. Here is a list of my current favorites.


  • Eclipse - the Open-Source IDE
  • CVS - the Open-Source revision control system
  • Ant - the Java make
  • JUnit - the unit test tool for Java
  • Fitnesse - for acceptance tests
  • Jemmy [desktop frontends]- testing Swing UIs
  • HTTPUnit [web frontends] - testing Web UIs
  • JMeter [server side code] - for load tests of server side code
  • NoUnit - finding untested methods
  • Integration-Guard - server side test execution before/after checkin in CVS
  • DoxyGen - similar to JavaDoc but supports different output formats
  • PMD - identifies problems and smells in Java code
  • Eclipse Profiler Plugin - Profiler for Eclipse
  • XDoclet - generates data from Java meta tags; used for Hibernate, JBoss and others


  • log4j - for logging (more powerful and widespread than the logging facilities of JDK 1.4
  • Struts [web frontends] - framework for web applications
  • Eclipse Plugin Model [client side code] - the Eclipse plugin model can be used without the Eclipse IDE to implement a client side component model for Java
  • JFreeChart - generates business charts
  • JFreeReport, JasperReports - printing from Java


  • mySQL, PostgreSQL, SapDB - Databases
  • Hibernate - OR mapper with transparent persistence (requires XDoclet); if an existing database schema has to be used, Torque with its code generation approach may be more suitable


  • Apache Web Server - if a lot of static web pages exist or non-Java application logic has to be executed at the server
  • Jakarta Tomcat [web frontends] - if only a web interface is required
  • JBoss [server side code and desktop frontends] - if a desktop interface is required and server side code is neccessary (I recommend to use XDoclet to generate most of the EJB stuff)
  • MockEJB [server side code] - a local container for session beans; supports testing session beans and allows the execution of the system stand alone without an application server


  • XPlanner - Managing and planning of stories
  • JSPWiki - a simple Wiki web based on Java Server Pages
  • Open-Office - for external documents and project tracking


There are promising tools which I haven't had the opportunity to use until now:

Post bewerten

Freitag, April 30, 2004

New version of JFreeProfilingCenter

I released a new version of JFreeProfilingCenter at Source-Forge: a tool for performance and load tests of Java programs . I corrected some minor bugs in the UI and did some refactorings to make the code more simple. A very short overview documentation is now available also.

Post bewerten

Eclipse Shortcuts and Key Bindings

To be really fast with an IDE developers need to be able to use the common IDE functions without the mouse. The functions used most often must be accessible with the keyboard only. Jesper Kamstrup Linnet has created a list of the Eclipse default key bindings. The default key bindings can be configured in Windows->Preferences->Workbench->Keys.

Post bewerten

Mittwoch, April 21, 2004

Large Refactorings at Java Forum Stuttgart

I will talk together with Martin Lippert about Large Refactorings at the Java Forum Stuttgart at 1st of july.

Post bewerten

JUnit speaks

Sebastian Sanitz developed an Eclipse plugin which gives JUnit a voice - e.g. the voice of Homer Simpson. The plugin can be downloaded here.
The plugin needs Eclipse 3.0M8 and JDK 1.4.2.

Post bewerten

Do You Speak Java?

Here is a code snippet I found somewhere. Can you figure out what it does? Try code reading first and if that doesn't work, write a unit test. Is there a way to refactor the code to be more readable without loosing performance?

public int doSomething ( final int v[] ) {
int i = 0, j = v.length - 1;
for ( ; !( v[i] >= v[j--] && i++ == ++j ); );
return v[j];

Post bewerten

Sonntag, April 18, 2004

Article Directory about Agile Methods

The Agile Alliance provides access to a lot of good articles about agile methods: http://www.agilealliance.org/articles/index

Post bewerten

Samstag, April 17, 2004


Projects using EJB have a common problem: EJBs are necessary for some reason (e.g. scalability) but using EJBs does harm the development process and the flexibility of the application:

  • The turn-around times (edit-compile-deploy-execute) are much longer with an application server than within a stand alone rich client application.
  • If unit tests fail, there are two possible reasons: The code is broken or the application server is not available. It can cost some efforts to figure out what the reason really was.
  • Some application servers consume a lot of memory and are therefore not usable on developer PCs. Then parallel tests of developers may influence each other in an unintended way.
  • Sometimes there is the requirement that the same application must be runnable with and without an application server. That's especially true for off-the-shelf products.

These problems are solvable through architecture. It is possible to introduce abstractions that allow to execute the application with and without an application server. On the downside these abstractions introduce a lot of complexity which often irritate developers.

With MockEJB there is the alternative to solve the mentioned problems with technology. MockEJB provides a local container for session beans (entity beans are not supported yet). That enables the application to simply use EJBs without further abstractions while being executable without an application server.


Post bewerten

Freitag, April 09, 2004

General Level Exception Handling Considered Harmful

Exception handling is somewhat awesome for developers. Therefore some projects come to a point where they catch exceptions at a general level. A short article with some demo code illustrates the risks of catching exceptions at a general level (catching Exception in Java).
I recommend following the "Crash Early" tip described in The Pragmatic Programmer (p. 120).

Post bewerten

Names in source code are important

Nearly everybody would agree that giving communicating names to packages, classes, methods and fields is important. But when non-communicating names are in place developers often argue that naming is not that much important. The pragmatic programmers Andrew Hunt and David Thomas have a strong argument for the importance of naming on their web site (stroop effect).

Post bewerten

Mittwoch, April 07, 2004

Online Pattern Catalogs

Some useful online catalogs of patterns, refactorings etc.:

Post bewerten

Freitag, April 02, 2004

SWT vs. Swing: API

Today two major and incompatible UI libraries are available for Java developers: SUN's Swing and IBM's SWT (which is used for the Eclipse platform). Often it is claimed that SWT is the faster and more stable solution. Since in our projects Swing was fast and stable enough a point of major interest was the API: What is easier and more flexible to program. I did a little experiment based on the very good SWT tutorial "Using the Eclipse GUI outside the Eclipse Workbench, Part 1: Using JFace and SWT in stand-alone mode" from Adrian Van Emmenis. I took the SWT file explorer consisting mainly of a tree and a table from the tutorial and programmed an equivalent Swing file explorer. The code can be downloaded for the SWT-File-Explorer and the Swing-File-Explorer.
The main differences between the two explorers:
  • The Swing explorer needs with 249 LOC about 30% more lines of code than the SWT explorer with 192 LOC.
  • Setting the properties of SWT widgets is follows the C style with expressions like SWT.HORIZONTAL SWT.NULL. Since the properties are simply integers there is a (small) lack of type safety.
One (subjective) word about performance: When using the two explorers I can hardly notice any difference. Only when directories contain very many files the SWT explorer seems to be a bit faster.

Post bewerten

Donnerstag, April 01, 2004

JUnit vs. Fitnesse

JUnit is for unit testing, Fitnesse for acceptance and functional testing. But in projects we have detected that sometimes JUnit and Fitnesse tests overlap. Sometimes Fitnesse tests are smaller and easier to comprehend than JUnit tests - even for single classes.
I did some very simple experiments to get a better feeling when to use JUnit and when to use Fitnesse tests. The sample code can be downloaded and the results of the experiments are documented in a small article.

Post bewerten

Montag, März 29, 2004

Acceptance Testing with Fitnesse

Fitnesse is an open-source acceptance testing framework based on FIT and a Wiki web. It is one of the best tools I have seen in the last years. It works with Java, C# and some other programming languages. Tests are defined with HTML tables (creating HTML tables with the Fitnesse wiki is quite easy) and connected to the application under test with so called fixtures. The fixtures have to be programmed by the developers - the effort is small. After having the tables with the test data and the fixtures the tests can be run from Fitnesse directly. The fixtures are simply classes that call other classes of the application under test. If core functional classes or UI classes are called (perhaps with a library like Jemmy) is the decision of the developers. Similar to JUnit tests can be combined to suites.
Fitnesse is suitable to let customers or business experts/analysts define the tests - test first for acceptance tests is enabled.


Post bewerten

Interesting Material about Agile Methods and OO

Some of the material is english, some is german:

Post bewerten

Freitag, März 12, 2004

Eric Evans: "Domain Driven Design"

Really good books about how to design the core domain model of an application are very rare. Eric Evans has written one.
Domain modeling is handled from the very small (entities, value objects, associations) to the very large (components, layers). Evans argues that creating a ubiquitous language shared by domain experts and developers is essential for the success of domain modelling. While the book refers to agile methods it is applicable for agile and non-agile methods.

The book is written in a pattern style and can therefore be read from start to end or be used as a handbook to answer specific questions at hand.

I strongly recommend "Domain Driven Design" to every OO designer and programmer.

There is a website related to the book which provides additional information and discussions of the topic.

Post bewerten

Donnerstag, März 11, 2004

Test Java Unit Tests with Jester (Open-Source)

Some months ago I heard of Jester a tool for testing Java unit tests. How do you test a test? The Jester approach is very simple but powerful: Jester modifies the tested source code and runs the tests after the modification. If the test fails, the test is OK. If the test passes, the test is incomplete.
The modifications to the code are based on very simple algorithms like incrementing integer constants by one, reverse conditions in if statements etc.
If contributed some minor extensions to Jester myself.
And Jester shares one attractive property with many other simple, but powerful tools: it is Open Source software.

Jester at Source-Forge

Post bewerten

Dependencies of XP Practices

Kent Beck shows the influences of the XP practices in his book and there are a lot of influences. The shown tangle isn't very useful when it comes to introducing the XP practices into a project. Then the essential depedencies are impotant: Which XP practice does require other XP practices to work.
I have put together the essential dependencies here.

Post bewerten

Mittwoch, März 10, 2004

Agile Project Controlling

Henning Wolf and I wrote an article about Agile Project Controlling which was accepted for the XP 2004 conference. See you there!

Post bewerten

WebLog active

Now even I try to use a WebLog (in fact Blogger). I integrated the parts of my old site via the link section on the left of the page. The old parts are still in the old layout. Therefore they don't look pretty, but at least they are there. I promise to work on the layout in the future.

Thats me:

Post bewerten