Home » Archives for Gualtiero Testa

Author Archives: Gualtiero Testa

Gualtiero is a software analyst, architect and developer in the Health, Insurance, Government and Banking domains. Test Driven Development, software testing and code quality are his main interests.

Unit testing Java data classes immutability with the Mutability Detector

In all our project, we use data classes which, by definition, contain data (fields) but no (business) logic. According to the best coding practices, a data class should preferably be immutable because immutability means thread safety. Main reference here is Joshua Bloch’s Effective Java book; this Yegor Bugayenko’s post is also very interesting reading. An immutable class has several interesting ...

Read More »

Java EE schedulers

java-interview-questions-answers

Java EE application servers have native scheduling support and, in most of the applications, there is no need to include external dependencies like the famous Quartz scheduler library. The Java EE 6 Timer Service, available on Java EE 6 and 7 full profile, give us many options to define the scheduling interval and what’s happen if we stop and restart ...

Read More »

The 5 Java logging rules

Logging is a critical factor that should be always kept into account during the software development. When something bad happens in production, the log files are usually the starting point of our fault analysis. And, often, they are the only information in our hands to understand what is happened and which is the root cause of the problem. It is ...

Read More »

Tutorial: logging during tests

Logging is a popular solution to show what the software is doing while it is running. But what happens to the logging when we are unit testing our application with jUnit/TestNG ? During the automated tests execution, we are usually not interested to see the logging messages because our main interest is the test results. It would be nice to ...

Read More »