Category: Code Metrics
Our posts on creating, testing, and evaluating code metrics
Business Complexity vs. Implementation Complexity
It is good software design practice to make sure that methods can be entirely viewed in the code editor that typically shows 30 to 45 lines at a time. The...
Answers to arguments against 100% coverage
I’ve been enthusiast about 100% coverage for more than a decade. The large code base of NDepend we are working on will reach soon 90% overall coverage. Most classes tested...
SOLID Design: The Dependency Inversion Principle (DIP)
After having covered the Open-Close Principle (OCP), the Liskov Substitution Principle (LSP), the Single Responsibility Principle (SRP) and the Interface Segregation Principle (ISP) let’s talk about the Dependency Inversion Principle (DIP)...
SOLID Design: The Interface Segregation Principle (ISP)
After having covered The Open-Close Principle (OCP), The Liskov Substitution Principle (LSP) and the Single Responsibility Principle (SRP) let’s talk about the Interface Segregation Principle (ISP) which is the I...
Are SOLID principles Cargo Cult?
My last post about SOLID Design: The Single Responsibility Principle (SRP) generated some discussion on reddit. The discussion originated from a remark considering SOLID principles as a Cargo Cult. Taking...
SOLID Design: The Single Responsibility Principle (SRP)
After having covered The Open-Close Principle (OCP) and The Liskov Substitution Principle (LSP) let’s talk about the Single Responsibility Principle (SRP) which is the S in the SOLID acronym. The...
Continuing Our Clean Architecture Example in C#
After a somewhat long delay, it’s time to finally continue our series on clean architecture. This is the second post in the inner series in which we show you a...
How to Measure Lines of Code? Let’s Count the Ways
There are a few ways to count lines of code, and they each have their advantages and disadvantages. Much of the differences come down to defining what a “line” is....
Functional Programming Makes Your Code Not OO…And That’s It
Over the course of the fall and winter, I’ve been gaining momentum with code research posts. Today, I bring that momentum to bear on the subject of functional programming. Or...
Unit Tests Correlate With Desirable Codebase Properties
Today, I give you the third post in a series about how unit tests affect codebases. The first one wound up getting a lot of attention, which was fun. In...
The Unit Test Effect Study, Refined
About a month ago, I wrote a post about how unit tests affect (and apparently don’t affect) codebases. That post turned out to be quite popular, which is exciting. You...
Lack of Cohesion of Methods: What Is This And Why Should You Care?
Lack of cohesion of methods (sometimes abbreviated LCOM) is one of those things that occurs fairly high up on the software hierarchy of needs. What’s the “software hierarchy of needs?” ...
Unit Testing Doesn’t Affect Codebases the Way You Would Think
I’ve just wrapped up another study. (The last one was about singletons, if you’re interested.) This time, I looked at unit testing and the impact it has on codebases. It...
CRAP Metric Is a Thing And It Tells You About Risk in Your Code
I won’t lie. As I thought about writing this post, I took special glee in contemplating the title. How should I talk about the CRAP metric? *Snicker* I guess that...
The Singleton Design Pattern: Impact Quantified
This post has been about a month in the offing. Back in August, I wrote about what the singleton pattern costs you. This prompted a good bit of discussion, most...
Get Smart — Go Beyond Cyclomatic Complexity in C#
Recently, I wrote a post explaining the basics of cyclomatic complexity. You can read that for a deep dive, but for our purposes here, let’s be brief about defining it. ...
Understanding Cyclomatic Complexity
Wander the halls of an enterprise software outfit looking to improve, and you’ll hear certain things. First and foremost, you’ll probably hear about unit test coverage. But, beyond that, you’ll...