Author(s): Kruif, Cato de (2022)
Abstract:
Dead code is any code in a computer program which does not affect the application. It is prevalent in computer programs, can be harmful and pose significant risks. This research aims to detect and eliminate dead code. To do this, we used a newly introduced data structure, called d-NFG, derived from the Program Dependency Graph (PDG). To fulfil our objective, we created a d-NFG for each commit of a code repository and then identified two types of dead code: unreachable code and unused variables. This was done by using an altered Breadth-First Search (BFS) and by analyzing the graph’s data and name flow.We have found that d-NFGs are useful in the detection of revived code and can be helpful in future projects. For standard dead code detection, a simple PDG is sufficient.
Document(s):
deKruif_BA_EEMCS.pdf