Lune

ICSE2022顶会

Nalin: learning from Runtime Behavior to Find Name-Value Inconsistencies in Jupyter Notebooks

Jibesh Patra, Michael Pradel

摘要

Variable names are important to understand and maintain code. If a variable name and the value stored in the variable do not match, then the program suffers from a name-value inconsistency, which is due to one of two situations that developers may want to fix: Either a correct value is referred to through a misleading name, which negatively affects code understandability and maintainability, or the correct name is bound to a wrong value, which may cause unexpected runtime behavior. Finding name-value inconsistencies is hard because it requires an understanding of the meaning of names and knowledge about the values assigned to a variable at runtime. This paper presents Nalin, a technique to automatically detect name-value inconsistencies. The approach combines a dynamic analysis that tracks assignments of values to names with a neural machine learning model that predicts whether a name and a value fit together. To the best of our knowledge, this is the first work to formulate the problem of finding coding issues as a classification problem over names and runtime values. We apply Nalin to 106,652 real-world Python programs, where meaningful names are particularly important due to the absence of statically declared types. Our results show that the classifier detects name-value inconsistencies with high accuracy, that the warnings reported by Nalin have a precision of 80% and a recall of 76% w.r.t. a ground truth created in a user study, and that our approach complements existing techniques for finding coding issues.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • LExecutor: Learning-Guided Execution 引用了 LambdaNet: Probabilistic Type Inference using Graph Neural Networks
  • LExecutor: Learning-Guided Execution 引用了 Global Relational Models of Source Code
  • LExecutor: Learning-Guided Execution 引用了 Hoppity: Learning Graph Transformations to Detect and Fix Bugs in Programs
  • LExecutor: Learning-Guided Execution 引用了 Code Prediction by Feeding Trees to Transformers
  • TRACED: Execution-aware Pre-training for Source Code 引用了 LExecutor: Learning-Guided Execution
  • TRACED: Execution-aware Pre-training for Source Code 引用了 NeuDep: neural binary memory dependence analysis
  • Code Prediction by Feeding Trees to Transformers 引用了 Global Relational Models of Source Code
  • Beware of the Unexpected: Bimodal Taint Analysis 引用了 Code Prediction by Feeding Trees to Transformers
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper6

  1. The evolution of type annotations in python: an empirical studyLuca Di Grazia, Michael PradelFSE 2022 · 29 次引用
  2. TRACED: Execution-aware Pre-training for Source CodeYangruibo Ding, Benjamin Steenhoek, Kexin Pei, Gail E. Kaiser 等ICSE 2024 · 29 次引用
  3. LExecutor: Learning-Guided ExecutionBeatriz Souza, Michael PradelFSE 2023 · 16 次引用
  4. Beware of the Unexpected: Bimodal Taint AnalysisYiu Wai Chow, Max Schäfer, Michael PradelISSTA 2023 · 13 次引用
  5. NeuDep: neural binary memory dependence analysisKexin Pei, Dongdong She, Michael Wang, Scott Geng 等FSE 2022 · 8 次引用

它引用的 Paper16

  1. Global Relational Models of Source CodeVincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis 等ICLR 2020 · 252 次引用
  2. Hoppity: Learning Graph Transformations to Detect and Fix Bugs in ProgramsElizabeth Dinella, Hanjun Dai, Ziyang Li, Mayur Naik 等ICLR 2020 · 212 次引用
  3. Code Prediction by Feeding Trees to TransformersSeohyun Kim, Jinman Zhao, Yuchi Tian, Satish ChandraICSE 2021 · 179 次引用
  4. CC2Vec: distributed representations of code changesThong Hoang, Hong Jin Kang, David Lo, Julia LawallICSE 2020 · 169 次引用
  5. LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 次引用

相关 Paper

  1. When to Say What: Learning to Find Condition-Message InconsistenciesIslem Bouzenia, Michael PradelICSE 2023 · 5 次引用
  2. DyLin: A Dynamic Linter for PythonAryaz Eghbali, Felix Burk, Michael PradelFSE 2025 · 1 次引用
  3. A Context-based Automated Approach for Method Name Consistency Checking and SuggestionYi Li, Shaohua Wang, Tien N. NguyenICSE 2021 · 36 次引用
  4. Static Type Recommendation for PythonKe Sun, Yifan Zhao, Dan Hao, Lu ZhangASE 2022 · 6 次引用
  5. Learning to find naming issues with big code and small supervisionJingxuan He, Cheng-Chun Lee, Veselin Raychev, Martin T. VechevPLDI 2021 · 9 次引用
黄昏的海面,两侧是细线勾勒的悬崖