This is my fist time to develop a SNMP connector for a client and to take a real task, I've created the write/read parameters and now I'm asked to write unit test to make sure the connector is working as expected, but Qactions has no functions to test and I can't imagine what kind of tests I should create to make sure the connector is working as expected, can anyone help me on how to analyze tests that need to be created for a SNMP connector only has read/write parameters, groups and timers?
Hi,
As Edib mentioned, unit tests are meant to ensure that small parts of your code do what is expected. This makes it easier to pinpoint the problem in a complex solution in case something goes wrong.
Since your SNMP connector consists mostly of polling and possibly a few actions on the XML side, it is not very suitable for unit testing.
Apart from Edib's suggestion of a thorough QA process, you could look into Integration Testing or Regression Testing, which would be similar to what we do at Skyline when we test the entire software.
You could either via connection with a real device or an SNMP simulation have a testing element created on your Development/Staging/QA environment and then use something like an automation script that goes and reads certain parameters from the element and verifies they contain the expected value.
This typically is a more complex process but if you would really like to have automated testing for your new connector then it is something you can look into.
Hi Mohamed,
You should be unit testing only the code you've written, and based on your post I don't think you've written any code in this particular case. If you are using just the protocol.xml, you can just rely on it working as expected. What you could do is some QA work, in order to make sure you've implemented everything correctly.
I this case I don't think unit testing makes sense unless you wrote some QActions as well, did you?
Cheers
I'm working in a team and creating parameters distributed between us and now we've finished and unit testing is my task, and the protocol.xml has the default 2 Qactions which has LogException, LogResponseError and Run functions only, So what can be written in c# and what needs to be tested?
I don't think there is anything you could unit test in that case. Just thorough QA should suffice.
Thanks a lot
Okay thanks a lot