首页|期刊导航|计算机应用与软件|基于数据流分析的冗余空值检查检测方法

基于数据流分析的冗余空值检查检测方法OA

DETECTING REDUNDANT NULL CHECKS BASED ON DATA FLOW ANALYSIS

中文摘要英文摘要

冗余空值检查会导致死代码,降低代码的可理解性和效率,并且预示程序可能有错.提出一种基于数据流分析的冗余空值检查的检测方法RedDetector.这种方法增强了数据流分析,并且能够找到更多冗余空值检查.搜集35 个GitHub热门项目,并人工搜集其中的冗余空值检查作为数据集.在这个数据集上,对比最先进工具,RedDetector的不可达空值检查语句查全率提升了83.7 百分点,查准率提升了54.4 百分点;而必可达空值检查语句的查全率提升了75.4 百分点,查准率提升了44.7 百分点.

Redundant null check can result in dead code,hinder code comprehension and efficiency,and indicate that the program may contain bugs.This paper proposes RedDetector,an approach to detect redundant null checks based on data flow analysis.This approach could detect more redundant null checks by enhancing dataflow analysis.We collected 35 popular GitHub projects and manually collected their redundant null checks into a data set.Based on the data set,compared with a state-of-the-art tool,the precision and recall of the unreachable null check statements detected by RedDetector increased by 83.7 and 54.4 percentage points respectively.The precision and recall of the certainly-reachable null check statements detected by RedDetector increased by 75.4 and 44.7 percentage points.

谢东方;黄凯锋;陈碧欢;赵文耘

复旦大学计算机科学技术学院 上海 200438上海市数据科学重点实验室 上海 200438复旦大学计算机科学技术学院 上海 200438上海市数据科学重点实验室 上海 200438

信息技术与安全科学

死代码数据流分析空值检查

Dead codeDataflow analysisNull check

《计算机应用与软件》 2026 (1)

1-8,32,9

国家自然科学基金项目(61802067).

10.3969/j.issn.1000-386x.2026.01.001

评论