Refactoring the D Koans with metaprogramming

馃挕 The problem Welcome back, it鈥檚 been quite a long time since my last ramblings on the D Programming Language! This post is born from a necessity. An old project of mine, the D Koans, was using an external library to simplify unit testing, which is more or less the core of the whole project. Unfortunately, the library started giving some deprecation warnings when compiled with recent D versions. Since the D Language already has an internal unit testing framework, I thought it would be nice to remove the single dependency and rely only on the standard library. Initially, with some global search/replace, I managed to convert all the tests to unittest blocks. ...

May 21, 2025 路 Andrea Manzini

How much code are you testing ? (2)

鈻讹笍 Intro On the previous post we started our journey with a very simple scenario, and we used a nice feature of the Go programming language to get a measure of how much % of the target program our test is exercising. This time I am going to experiment a Proof of Concept about how we can obtain a test code coverage metric estimation for a normal binary program, without any recompilation. ...

March 30, 2025 路 Andrea Manzini

How much code are you testing ? (1)

鈽傦笍 Intro When your code includes a suite of unit tests, code coverage is an important metric to measure the test effectiveness and it鈥檚 rather easy to obtain; there are plenty of tools around. Image credits to: Nataliya Vaitkevich On the other hand, often we also need to do integration or E2E testing, as in our QA journey we are mostly running real world programs instead of single well-chosen functions. Let鈥檚 start with a basic use case, and prepare a simple program tailored for this purpose. ...

February 23, 2025 路 Andrea Manzini

Systemd Socket Activation Explained

馃挱 What ? Imagine a web server that only starts when someone actually tries to access it. Or a database that spins up only when a query comes in: this is the magic of socket activation. The concept is not new, as old-school sysadmins may are used to see something like inetd or xinetd for on-demand service activation in the past. As some cool projects like cockpit have already started using this little-known feature, in this blog post we鈥檒l see the basics and try to get familiarity with the tooling. ...

February 2, 2025 路 Andrea Manzini