development

Patterns for Dealing with Legacy Code: ServiceLoader

Legacy code is code that was not developed according to current standards of software development, is no longer maintained, and often is not or insufficiently documented. However, external, proprietary closed-source libraries often meet these criteria too. Often, this code is still operated and needs to be adapted from time to time, e.g., to comply with regulatory requirements. Legacy code often comes in the form of CLOBs. An undefined mass of lines of code, of which no one knows anymore what it does.

Continue reading

Mixins with Java

Mixins refer to additional functionality that can be added to a class. They are a special form of multiple inheritance, where properties or behaviors are inherited from several “parents.” Mixins can solve two problem areas: One wants to offer many optional features for a class. One wants to offer a specific feature for many different classes. With the help of mixins, domain models can be kept simple by defining only the essential properties and optional properties can be added via mixins.

Continue reading

Exponential Growth of LoC is Not a Sign of Increased Productivity

One of the essential cornerstones of agile software development is its transparency. Teams continuously report on their progress, completed tasks, obstacles, team events, and the quality of their work. The capture of metrics is as much a part of the craft as targeted improvements that can be demonstrated with the help of these metrics - what gets measured, gets managed. Capturing code metrics is largely automated today with tools such as PMD, Findbugs, Sonarqube, and Code Coverage, and thanks to code versioning systems like CVS, SVN, or Git, it can be seamlessly tracked.

Continue reading

Multi-Module Integration Test Coverage with Jacoco and Sonar

In this article I describe how to setup jacoco for Maven multi-module projects so that integration test coverage can be calculated for the entire code base and analyzed using Sonarqube.

Continue reading

Mutation Testing

End of January I attended the OOP2015 conference in Munich. Among the load of interesting sessions was one that left a mark. It was the workshop conducted by Filip van Laenen and Markus Schirp about Mutation Testing (slides here), which I’d like to summarize in this post.

Continue reading