medieval software construction putlogging
Tue, Feb 14, 2012
Quite often in Spring injection, beans don’t have getters for their injected objects as they only really need setters to get them passed in but that means the injectees are difficult to get at and test. In cases like these you can use putlog holes in your soon to be injected classes to let you test them in-situ with integration tests.
‘The inconsequential size and the spacing of the holes meant that they did not affect the solidity of the walls’ and this also applies to put holes in classes. The odd protected method designed to be accessed from a test case in the same package greatly increases the test surface and lets you get that bit deeper into the architecture to shift things around at runtime.
Put holes were used to anchor the scaffolding which allowed the building to be constructed to the highest standards. Put holes in classes let you anchor your test framework against their walls to allow you to build robustly tested software.