Hi,

I'm working on adding the ability to test C#/.NET code used with edge.js
(GPII-2672 [1]).  But, I've started to wonder about whether this should
be done or not.  This is a way of thinking out loud and seeing what
others have to say.

The issue started when some of my ProcessReporter C# code caused
exceptions or worse.  Antranig remarked (paraphrase), that the more C#
and edge.js we use, the more we need to run unit tests on the C# code
itself.  That seems like a pretty obvious and indisputable conclusion.

But, it occurred to me that something analogous is happening on the
Linux side and we don't test there.

The purpose of C# + edge is to get at Windows native OS specific
features that are not directly available from nodejs, and to allow
calling on them from nodejs + JavaScript.  By comparison, in the case of
Linux, we use C++ to build node add-ons to provide the same kind
interface between nodejs and Linux native OS features.  We do not unit
test the C++ code.

But, it's not the case that we do not test anything with respect to the
Linux node add-ons.  What we do on Linux is export certain key functions
from the C++ code that define the interface between node and the
add-on.  Everything behind that on the C++ side of the interface is a
black box.  We write unit tests for the exported functions using nodejs
and jqUnit.  For example there is a "nodepackagekit_test.js" [2] that
tests the C++ interface functions.  But, there are no tests for any of
the supporting C++ functions defined within the add-on that are
"private" to it.

By that logic, we should do the same thing with C# on Windows.  We
should just test the interface functions.

On the other hand, there is the argument that the more you test, the
better you are in terms of finding bugs, detecting regressions, and so
on.  This line of thought leads to actual C# testing (and, on Linux, C++
testing).

Thoughts?

[1] https://issues.gpii.net/browse/GPII-2672

[2]
https://github.com/GPII/linux/blob/master/gpii/node_modules/packagekit/nodepackagekit/nodepackagekit_test.js

-- 
;;;;joseph.

'Call me hobophobic, but I don't think two vagrants should be allowed to marry.'
                               - J. Tiedrich -

_______________________________________________
Architecture mailing list
[email protected]
https://lists.gpii.net/mailman/listinfo/architecture

Reply via email to