Is it possible to get Code Coverage Analysis on an Interop Assembly? -
i've asked question on over msdn forums , haven't found resolution:
http://forums.microsoft.com/msdn/showpost.aspx?postid=3686852&siteid=1
the basic problem here see interop assembly doesn't contain il can instrumented (except maybe few delegates). so, although can put test project exercises interop layer, can't sense how many of methods , properties i'm calling.
plan b go , write code generator creates library of rcwws (runtime callable wrapper wrappers), , instrument purposes of code coverage.
edit: @franci penov,
yes that's want do. com components delivered constitute library of dozen dlls containing approx. 3000 types. consume library in our application , charged testing interop layer, since group delivering libraries minimal testing. code coverage allow ensure interfaces , coclasses exercised. that's i'm attempting do. have separate test projects exercise our own managed code.
yes, ideally com server team should testing , analyzing own code, don't live in ideal world , have deliver quality product based on work. if can produce test report indicating i've tested 80% of code interfaces , 50% of don't work advertised, can fixes done fixes need done, , not workaround problems.
the mock layer mentioned useful, wouldn't achieving goal of testing interop layer itself, , not want maintaining hand -- @ mercy of com guys in terms of changes interfaces.
like mentioned above -- next step generate wrappers wrappers , instrument testing purposes.
to answer question - it's not possible instrument interop assemblies code coverage. contain metadata, , no executable code mention yourself.
besides, don't see point in trying code coverage interop assembly. should measuring code coverage of code write.
from mdn forums thread mention, seems me want measure how code uses com component. unless code's goal enumerate , explicitly call methods , properties of com object, don't need measure code coverage. need unit/scenario testing ensure code calling right methods/properties @ right time.
imho, right way write mock layer com object , test calling methods/properties expected.
Comments
Post a Comment