← Latest papers
💻 computer science

The Influence of Code Smells in Efferent Neighbors on Class Stability

This study investigates how code smells in a class's efferent neighbors, particularly when compounded by smell interrelation and interaction, influence the stability of the dependent class by analyzing one year of commit history from 100 top-starred GitHub projects.

Original authors: Zushuai Zhang, Elliott Wen, Ewan Tempero

Published 2026-02-17
📖 4 min read☕ Coffee break read

Original authors: Zushuai Zhang, Elliott Wen, Ewan Tempero

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are the manager of a busy restaurant. Your goal is to keep the kitchen running smoothly so you can serve food quickly and without mistakes. In the world of software, the "kitchen" is the code, and the "dishes" are the features or fixes developers are trying to add.

This paper is about understanding why some parts of a restaurant (or a software program) seem to break down or require constant, messy renovations, even when the chef working in that specific area is doing a great job.

Here is the breakdown of the study using simple analogies:

1. The Core Problem: The "Ripple Effect"

Usually, when a dish tastes bad, you blame the chef who cooked it. In software, if a piece of code (a "class") is messy and hard to fix, we call it "smelly." We know smelly code is unstable and gets changed a lot.

But here is the twist: Sometimes, a perfectly clean, well-organized chef (a clean piece of code) keeps getting forced to stop cooking and redo their work. Why? Because the suppliers they rely on are unreliable.

In the paper, these suppliers are called "Efferent Neighbors."

  • The Analogy: Imagine your chef (Class A) needs tomatoes from a supplier (Class B). If the supplier is chaotic, late, or keeps changing the type of tomato they send, your chef has to constantly stop and adjust their recipe, even though the chef themselves is perfect.
  • The Study's Question: Does a clean chef become unstable just because their messy suppliers keep causing trouble?

2. The Two Types of "Bad Neighbors"

The researchers looked at two specific ways these "bad neighbors" cause trouble:

A. The "Bad Connection" (Code Smell Interrelation)

Sometimes, the messy supplier and the clean chef are just generally connected.

  • The Analogy: The supplier sends tomatoes to the chef, but the supplier's warehouse is a mess (a "God Class" smell). Every time the supplier reorganizes their warehouse, the chef has to wait.
  • The Study: They wanted to see if having any messy neighbor makes the clean chef less stable.

B. The "Direct Handoff" (Code Smell Interaction)

This is even worse. It happens when the messy part of the supplier is directly connected to the messy part of the chef.

  • The Analogy: Imagine the supplier's specific bad tomato-sorting machine (a "Feature Envy" smell) is directly wired to the chef's specific chopping knife (a "Brain Method" smell). If the machine jams, the knife jams instantly. They are tangled together.
  • The Study: They wanted to see if this "tangled mess" between two specific parts causes even more chaos than just having general bad neighbors.

3. How They Tested It

The researchers didn't just guess; they went on a massive digital scavenger hunt.

  • The Data: They looked at 100 of the most popular open-source software projects on GitHub (like the "Michelin-starred" restaurants of the coding world).
  • The Timeframe: They watched these projects for one year, tracking every single change (commit) made to the code.
  • The Method:
    1. They identified the "clean" chefs (classes without smells).
    2. They checked who those chefs depended on (their neighbors).
    3. They counted how many times the chefs had to change their recipes because their neighbors changed.
    4. They used math (statistical models) to prove that the messiness of the neighbors actually caused the clean chefs to become unstable.

4. What They Found (The "Aha!" Moment)

The study confirms that you are only as stable as your worst supplier.

  • The Ripple Effect: Even if your own code is perfect, if the code you depend on is "smelly" (messy, complex, or poorly designed), your code will likely have to change more often and in bigger chunks.
  • The Tangled Mess: The problem gets significantly worse when the specific messy parts of two different pieces of code are directly connected. It's like having a direct phone line between two people who are both prone to panic; one panic attack triggers the other immediately.

5. Why This Matters

For a long time, software managers thought, "If I fix the messy code inside a specific file, that file will be stable."

This paper says: "Not so fast!"
If you fix the messy file but leave the messy files it depends on alone, you haven't solved the problem. The clean file will still be dragged down by the instability of its neighbors.

The Takeaway: To keep your software stable, you can't just look at the code in isolation. You have to look at the whole network. If your "clean" code is surrounded by "smelly" code, you need to clean up the neighbors, too, or the ripple effects will keep breaking your system.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →