in reply to testing with mock objects
Perhaps you will find the Test::MockObject module by [id://chromatic] useful. You may also find the nodes Mock Objects and Automated software testing: emulation of interfaces using Test::MockObject helpful.