Posts tagged "Testing"
Mutation Testing badge with PIT and Stryker Dashboard
Earlier, I wrote about integrating PIT with the Stryker Mutator Dashboard. The setup for that was pretty complicated, with some shell scripting that extracted the JSON payload for the report from a JavaScript file. Today, I’m introducing a much simpler approach to that: the Stryker Mutator Dashboard reporter for PIT.
— Read more... →Mutation Testing badge with Pitest and Stryker Dashboard
Over the years, badges have become a way for open source maintainers to show the state of their product. Badges can give a quick overview of the code quality, test coverage or build health of an open-source product. The problem with code coverage is, however, that a high coverage doesn’t mean the tests are any good. If only there was a way to show the quality of the test suite…
— Read more... →Reports from Devoxx PL
From yesterday until tomorrow I’m attending Devoxx Poland (or Devoxx PL for short). It’s the second largest conference in the Devoxx family with around 2700 people attending. The conference is held in the ICE Kraków Congress Centre, a large venue with an amazing primary room.
The main reason I’m here is to give a talk about GraalVM on Wednesday morning. Apart from that, it’s a nice opportunity to network, meet old friends and make new ones. And of course to attend other talks to learn something new.
— Read more... →Verify logging with Logback
Sometimes you have a piece of logging that is very important, maybe even part of a business requirement. In that case, you might want to verify that in a unit test, so you can rest assured that this requirement is actually met. How to do that?
Mock it away
A first approach might be to just mock your logging framework in a unit test and verify it was called as you expected.
It might sound tempting, and easy to do, but not everybody likes it.
And in fact, you might run into some issues when walking this path, because some libraries tend to make classes and/or methods final so they can’t always be mocked away.
Also, a lot of people tend to create a logger by doing private static final Logger LOG = ...
, which makes it even harder to mock it away.
Making your logger an instance variable just so you can test it? Nah…