Friday, July 27, 2007

Stats

Percentage Used Methods Covered: 0.2572512

Of the system methods used in the wild, about 75% of them are uncovered/ no unit tests.

Top10 Frequent Uncovered Methods:

System.Type.GetTypeFromHandle(runtimetypehandle)[9666],
System.Runtime.InteropServices.UCOMIConnectionPoint.Unadvise (int)[5629],
System.Runtime.InteropServices.UCOMIConnectionPoint.Advise (object,int&)[5509],
System.String.get_Length ()[4866],System.Object.GetType ()[2976],
System.Runtime.InteropServices.GCHandle.Alloc (object,gchandletype)[2744],
System.Runtime.InteropServices.GCHandle.AddrOfPinnedObject ()[2708],
System.String.get_Chars (int)[1751],System.Type.get_FullName ()[1706],
System.Data.DataRow.get_Item (string)[1590]

Top10 Types Used:

System.Windows.Forms.Control: 39031,
System.String: 37039,
System.Collections.ArrayList: 33015,
System.Threading.Monitor: 29379,
System.Type: 15596,
System.Collections.IEnumerator: 12835,
System.Runtime.InteropServices.UCOMIConnectionPoint: 11138,
System.Collections.Hashtable: 10776,
System.Delegate: 10191,
System.Runtime.InteropServices.GCHandle: 10056

2 comments:

lupus said...

As they say, 83% of all the statistics is wrong, or something like that:)
This applies to at least your Top10 uncovered method list.
4 of them are inlined by the jit, so even if they are present in the test, they won't show up in the coverage data (GetType(), GetTypeFromHandle(), get_Length(), get_Chars()).

I have no idea where you got your data from, but this is the first time I see UCOMIConnectionPoint used: basically no program uses it, so 2 of the methods in the list are completely bogus (or your data is not representative of the real world programs).

System.Type.get_FullName() looks a bit bogus as well as the GCHandle entries (their asserted frequency doesn't match real world usage).

So you might want to fix the source of the data you're using to build your stats, they don't seem to represent real world usage of the methods.

Chris said...

Yes, I figure that they are second order methods not directly used by the user. I'm not sure of the mechanism for be generated in the exe.