Skip to content
Prev 11742 / 21312 Next

[Bioc-devel] writing unit tests for functions in an initializer

I agree with Kasper. You are better off just leaving initialize() to
its default implementation. Violating that abstraction for the purpose
of testing is only going to put your software more at risk, defeating
the purpose of testing.

Overriding initialize() makes it do more than just set slots, but then
there's no simple way to just initialize an object with specific slot
values.

Put another way, if you think of software as an onion of abstraction
layers, initialize() is at the bottom, and making it do more raises it
up a level, which is disruptive.

Michael

On Thu, Sep 28, 2017 at 10:00 AM, Kasper Daniel Hansen
<kasperdanielhansen at gmail.com> wrote: