If you have never heard of "Cyclomatic Complexity" a good place to start is here. I decided to grab the Reflector Addin by Peli which will examine an assembly's methods and produce a list of code metrics for each given method, one of which is the Cyclomatic Complexity and run it on "mscorlib.dll" and some of the results are actually quite alarming.
Just in this one DLL there are 24 methods that score 50 or higher, the highest being DateTimeParse.ParseByFormat() which scores at 98. Now if you look at Table 4 in the article I linked above you will notice that they state that "greater than 50 - untetsable program (very hight risk)"
I would love to see the code coverage report on these methods. How much of these top methods are actually being testing? How thorough is their process for getting these "untestable" methods tested. I would also like to see the number of bug reports for each method > 50 in the framework and compare those to those < 50...
I decided to dig a bit deeper than just mscorlib.dll. Here are some of the things I found...
System.dll has 20 methods > 50 with the worst at 178
HttpRequestCacheValidator.FetchCacheControl(String, Boolean) : Void
System.Data.dll has 14 methods > 50 with the worst at 118
BinaryNode.EvalBinaryOp(Int32, ExpressionNode, ExpressionNode, DataRow, DataRowVersion, Int32) : Object
System.Drawing.dll has NO methods > 50, with the worst at 29
Icon.Initialize(Int32, Int32) : Void
System.Web.dll has 19 methods > 50, with the worst at 184
BrowserCapabilitiesFactory.UpProcess(NameValueCollection, HttpBrowserCapabilities) : Boolean
System.Windows.Forms.dll has 35 methods > 50, with the worst at 169
DataGridView.GetClipboardContent() : DataObject
System.Configuration.dll has 3 methods > 50, with the worst at 89
ConfigurationElement.DeserializeElement(XmlReader, Boolean) : Void
System.Security.dll has NO methods > 50, with the worst at 35
Reference.CalculateHashValue(XmlDocument, CanonicalXmlNodeList) : Byte
and the all time worst method for Cyclomatic Complexity is...
System.Xml.dll has 15 methods > 50, with the worst at 224
XmlSchemaInference.InferSimpleType(String, Boolean&) : Int32
Also, it has 1557 instructions, 31 locals..
How can anyone test this accurately?
I have had about 5 people ask me about Visual Studio .NET 2003/2005 and Windows Vista, so I thought I would just post it up.
The core links to refer to are:
Visual Studio on Windows Vista
Visual Studio 2005 SP1 Beta and Visual Studio support for Vista
Visual Studio 2005 Service Pack 1 (SP1)
Visual Studio 2005 Service Pack 1 Update for Windows Vista Beta
Some key points to take note:
1. Some changes in Vista will impact Visual Studio and thus we're unable to
support Visual Studio .NET 2002 or Visual Studio .NET 2003 on Windows
Vista. Its about time to upgrade anyways. Check out the Web Application Projects if you hate the way 2005 does its default project structure.
2. Your existing .NET Framework 1.1 and 2.0 based
applications will continue to work on Windows Vista, and will be able
to take advantage of many of the new features available to Windows
3. For developers using Visual Studio 2005 on Windows Vista, Microsoft is
in current development on an update to Service Pack 1 called the
‘Visual Studio 2005 SP1 Vista Refresh Beta’. This update builds on the
improvements made in SP1 and delivers a first class experience for
developers wanting to take advantages of the new features in Windows
Vista. The Visual Studio 2005 SP1 Update for Windows Vista is expected
to ship after the consumer availability of Windows Vista in Q1 of 2007
and is now available in beta. [DOWNLOAD: Visual Studio 2005 Service Pack 1 Update for Windows Vista Beta]