Connascence metric has its own website https://connascence.io/ where you can find detailed descriptions and examples. In this post, we will show why connascence is a very important metric. We will visualize, condense, and summarize the concepts so they are fast and easy to comprehend.
Table of Contents
What is Connascence?
Before we can understand the importance of connascence, let’s understand what it is. Connascence is a software quality metric that describes different levels and dimensions of coupling. It is a more descriptive and complete metric than coupling on its own. Coupling is a connection between presumably independent things, so that if one thing changes, the other needs to change as well in order to maintain correctness.
Simple example, given we have two functions and we change the implementation of one of them, for example, input parameter type. If we need to change the implementation of the other function to keep the code running correctly, we have coupling between the two functions. Coupling will describe how bad the coupling between the functions impacts overall code quality.
The lower the coupling, the higher the code quality.
Levels of Connascence
There are nine levels of connascence being identified so far. The levels are grouped into two sets: static and dynamic. Static connascence levels are based on code and can be identified just by looking at the code. Dynamic connascence levels are based on execution and appear when code runs. The diagram below shows all the levels ordered from lowest on the top to highest on the bottom. Note that any dynamic connascence is worse than any static. The higher level of connascence, the harder and riskier it is to introduce changes to code.

Properties of Connascence
There are three identified properties of connascence:
- Strength. The higher the level of connascence, the higher the strength. For example, the strength of connascence of Name is lower than the strength of connascence of Algorithm.
- Locality. It describes how close the coupled components are. The higher the concentration locality, the better. Coupled methods that are in different modules are much worse than coupled methods within the same module.
- Degree. It describes how many components are coupled. For example, if we change the implementation of one component, how many other components do we need to change?
Connascence = Strength x Degree / Locality

Why Connascence is so important for us?
We live in a world that changes every day. Business processes adjust to new realities. New and better ways of doing things are discovered. New technologies and methodologies become available. Therefore, software needs to change to stay current with reality.
High connacence undermines the ability of software to change. The higher the connacence, the more code we need to change, and the costlier and more time-consuming the change becomes. But it’s not only about time and money; the more severe the level of connacence, the higher the probability of introducing new bugs while changing code, and therefore the risk of change is higher.
Code with higher conciseness is harder to reason about and understand, therefore hard and dissatisfying to maintain. Teams that have to deal with highly conciseness code are less likely to attract new talent, making the hiring process harder and employee retention lower.
It’s much easier to prevent high concurrency than improve it after the fact. Therefore, we always need to keep concurrency in mind while creating architectures, designing components, writing, refactoring, and reviewing code. When we are faced with multiple design options, concurrency should be considered as one of the driving forces that influence our decision.
However, if we already inherited code that has high cohesion, we can get guidance on how to improve the code quality. Lowering the level of cohesion, localizing coupled components, and reducing their number are the ways to improve cohesion, hence code quality.
Summary
Connascence is a software quality metric that describes different levels and dimensions of coupling, which is the connection between independent components. It is important because high connascence undermines software’s ability to change, making it more costly, time-consuming, and prone to bugs. Lowering connascence improves code quality, maintainability, and team satisfaction.
2 thoughts on “Connascence, why is it so important?”