Programming Chi

Tomasz Fijałkowski's programming blog.

10 Practical ArchUnit Tests for Spring Applications

The illustration shows a city in which a bridge is being built

To efficiently develop software, it is crucial to control its quality, particularly the architecture and code structure. In Java, ArchUnit, a library for testing certain aspects of architecture and design, can help. In this article, I’ll present ten practical ArchUnit tests based on my experiences with developing a Spring Framework-based application.

read more

The Mandelbrot nature of modularization

The illustration of a fractal tree

In the world of software, modularization is crucial for maintaining flexibility, scalability, and code readability. I have participated in many discussions about the ideal size of a module. These discussions often feature extreme opinions, ranging from “it’s better to have a few large modules” to “the smaller the modules, the better”. The truth, as always, lies somewhere in between, and in this post, I will point out how to pinpoint it.

read more

Modularization and Architecture Testing

The illustration shows a technical drawing of solids symbolizing modules with marked dimensions

Modularization in projects is one of the key techniques that allows for maintaining code readability, scalability, and ease of maintenance. As projects evolve, especially those with a larger scope, it becomes an important element ensuring order and transparency in the code structure. However, as the project progresses and new changes are introduced, and developers come and go, it’s easy to forget the initial architecture assumptions. Automated tests come to the rescue.

read more

The Dark Sides of the Open-Closed Principle

The illustration shows a tangled arrow as a metaphor for overengineering

The Open-Closed Principle, described in SOLID, ensures project flexibility, but does it always lead to optimal, future-ready code? It sounds promising - open for extension, closed for modification. Let’s take a closer look.

read more

Mental Monolith: End-to-End Tests

The illustration shows a head with a large monolith inside it instead of a brain

In recent years, service architectures, especially microservices, have gained enormous popularity, yet the approach to end-to-end (E2E) testing often remains unchanged. We hear that tests verifying the operation of the entire system are crucial in the software development process, especially with distributed architectures.

read more

Documentation is not a Requirement

The illustration shows a man trying to support piles of documents that are about to fall

In this post, I’d like to present my three-point approach to tasks and problems related to documentation.

read more

Additional Checks in Checkstyle

A  Formatting string emerging from a code block

Checkstyle is a powerful library that not only allows standardizing code formatting in a project but also catching some program errors (e.g., whether the equals method is implemented along with the hashCode method) and code design issues (e.g., maximum method size or cyclomatic complexity).

read more

About How Introducing Clean Code Tripled Memory Usage

A  Formatting string emerging from a code block

This post is a brief story of how good intentions can lead to disaster when forgetting about JVM’s internal mechanisms and how, once again, Kent Beck’s approach - “Make it work, Make it right, Make it fast” - came into play.

read more

Metrics as Public Variables, Is it Bad?

The illustration shows a terrified person surrounded by charts, metrics and terms such as metrics, public variables, getter and setter

On this blog, I sometimes touch upon taboo subjects like in post Optional as a Field and what are you going to do to me about it? This time, it’s about static public variables. Much has already been said about the harm their usage has inflicted on the world. In this post, I’d like to analyze a specific case of their usage, namely metrics…

read more

About LocalDateTime Locality

The illustration shows a sundial showing three o'clock

It ain’t what you don’t know that gets you into trouble. It’s what you know for sure that just ain’t so. – Will Rogers

read more