Testing Logs Revisited
Whilst moving my old blogs to github I reviewed one I did on testing logs and I thought it good timing to present a refactored implementation and in my current language of choice, Scala.
Developer with passion to learn
Whilst moving my old blogs to github I reviewed one I did on testing logs and I thought it good timing to present a refactored implementation and in my current language of choice, Scala.
Low latency application developers need to think carefully about how they log; In this blog I will describe the problems and provide a possible solution that allows loggers to be used without overly impacting the applications performance.
Recently I had a few issues with code that I thought was fully covered with unit tests. It turns out that the problem was with an incorrect value I had assigned to a class annotation. This led me on a search for a suitable Hamcrest annotation matcher to immediately fix up the lack of coverage.
One of the issues that really gnawed at me in the past was how to effectively unit test logging calls. Good and effective logs are important to test and using the TDD mantra that code is only ever written to make a failing test pass, makes it obligatory
Whenever you manipulate collection of objects, its important to test thoroughly to ensure the expectations of the code is met.