<div dir="ltr"><span id="gmail-docs-internal-guid-011f9b94-d11f-d900-b9bb-18d40efc992b"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Hello,</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I work on a project which highly uses plugins. The plugin developers always complain that it is very hard to understand how the plugins are really used by the system and testing plugins while developing them always require running an instance of the whole system, restarting it to apply changes to the plugins, etc. To make the developer’s life easier I was thinking on providing a framework for testing the plugins.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Different plugins must behave the same under given circumstances so I think it will be even possible to have a battery of tests that after a simple configuration e.g. the plugin class name and a few parameters will be ready to use. The tests will need to execute the logic in the same way as the system does so I think I will write unit tests - there will be no need to integrate them with the classes from the system. Some of the tests will be able to call and test a single methods of the plugins - nice. But most of them will need to perform a sequence of calls to different methods before we get to the method that we want to test - not so nice. And last but not least, the plugin works with the real hardware (instrumentation equipment).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I would like to cover the following requirements:</span></p><ul style="margin-top:0pt;margin-bottom:0pt"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Using the framework allows TDD of the plugins</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Tests help developers to understand how the system uses the plugins.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Tests are easily parameterizable.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Given tests can be easily repeated multiple times - stress testing.</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Tests do time and memory profiling (I was thinking about using profile and memory_profiler modules)</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The most complex tests, the ones that execute the whole action involving calls to many methods of the plugins, support hook mechanism (execute an arbitrary code between the calls to the plugin).</span></p></li></ul><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I would appreciate any feedback on the conceptual level and any hint on the technical level e.g. libraries that could help me (I worked only with the python’s unittest module up to now and in our project we have already developed a decorator for easy insertion of the parameterizable tests to the TestCase class).</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I’m also looking for other project that have done something similar? Do you know any?</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Many thanks in advance for sharing your experience!</span></p><span style="font-size:11pt;font-family:arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Zibi</span></span>
</div>