Testing testing

tagg on 2003-05-09T07:36:40

Hm. My Log::Dispatch::SNMP module is coming along nicely, but it'll be a bitch to test. My problem is whether I should just test my own bits (the interfaces to Log::Dispatch and Net::SNMP), or to do actual end-to-end testing.

End-to-end testing would mean starting up an SNMP trap receipient, send some log messages, and verify that they make it though the chain as expected. And then start changing parameters, exploring the whole parameter space.

My current development setup uses snmptrapd from Net-SNMP (not to be confused with Net::SNMP). But I really hate relying on external programs for testing.

Maybe I should just do whatever selfcontained testing I can, and leave the end-to-end stuff in a separate directory.

Or maybe I can concoct a trap receipient using some simplistic UDP server code with a bit of Convert::BER tacked on, but I'm afraid that down that road lies madness...


A word of advice

jonasbn on 2003-05-09T08:00:30

If we look at your complete setup I would recommend trusting the 3rd. party components, which would leave us with a sort of 'blackbox' test. It would be easy to implement and would bring you a long way.

Start using your module somewhere and if you encounter problems/bugs start writing tests that show produce the bugs and then let these tests drill all the way have a 'whitebox' test approach.

This was also the conclusion on the discussion after my test strategy presentation at the SPW.