SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

It Depends

Add to Technorati Favorites Add to Google
 

More Code Per Module = More Bugs, But More Complex Code <> More Bugs?

By Andy Warren in It Depends | 03-28-2008 1:25 PM | Categories: Filed under:
Rating: (not yet rated) |  Discuss | 1,911 Reads | 118 Reads in Last 30 Days |no comments

SDTimes has an article up about Debunking Cyclomatic Complexity that talks about the results of some research that supports what I suspect most of agree with - more lines of code per module/method leads to more bugs. Object oriented program has done a great job in leading away from procedures that have 500 lines of code down to 50 or less (we're nowhere close to winning that battle in TSQL!). But the interesting part was that more complex code didn't correlate to more bugs, and speculates on some ideas about why not - I'll leave that for you to read.

Seriously, on the TSQL side you see what are relatively trivial procs on one side (which are fine and useful), and on the opposite extreme you see almost entire programs written in the context of a single proc. There is real value in breaking up those monoliths that are easier to read, test, and possibly even reuse.

Comments
There are no comments on this post
Leave a Comment
Only members of SQLServerCentral may leave comments. Register now for your free account or Sign-In if you are already a member.