Are Unreachable Methods Harmful? Results from a Controlled Experiment — Simone Romano

Unreachable code. So bad! Or is it?

First: what is unreachable code? Unreachable code is code that never will be executed. It differs slightly from dead code, which code which is executed but whose result is never used in any other computation.

The author of this study did a previous one, where they found that system have between 5 and 10% of unreachable code.

2016-05-17 17.07.29

Simone wanted to know, so he did a controlled study. In wanted to know whether unreachable code impacted modifiability of familiar code. The design of the study was simple:one factor with two groups: with (treatment) and without unreachable code (control). They measured correctness and effort.

Participants had to fill out a questionnaire, and then comprehend and modify source code.

The results show that developers understood source code without unreachable code way better

Capture

However, there was no impact on time and on modification.

Capture

Simone has several goals for future research on the topic of unreachable code.

  • What do developers think of it?
  • How do they deal with unreachable code?
  • When are unreachable methods introduced?

Interesting work!