arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.07668cs.SE
收藏

代码混淆对人类程序理解的影响

The Effect of Code Obfuscation on Human Program Comprehension

University of Texas at Dallas(达拉斯大学)

Anh H. N. Nguyen, Jack Le, Ilse Lahnstein Coronado, Tien N. Nguyen

AI总结:

研究探讨了代码混淆对人类程序理解的影响,发现混淆增加推理时间并降低准确性,但不同编程语言表现各异,且编程经验在语言内有较强影响。

摘要:

我们通过一个输出预测任务研究代码混淆如何影响人类对程序的理解。为了研究这种影响,我们构建了多个层次的混淆,从未混淆的代码到涉及标识符重命名、对抗性误导标识符、控制流修改以及这些技术的组合。这些转换应用于用Python和JavaScript编写的函数级程序。参与者被要求预测程序输出,同时我们记录了正确性、响应时间和自我报告的编程经验。我们的结果表明,混淆通常会增加理解和推理代码所需的时间,并倾向于降低预测准确性。然而,混淆强度与性能之间的关系并非严格单调,并且在不同编程语言中有所不同。JavaScript表现出预期的模式,即随着混淆强度增加难度也增加,而Python则呈现出更复杂的趋势,其中某些重命名转换可以与或偶尔优于未混淆的基线。响应时间分析进一步表明,混淆使参与者从快速的启发式推理转向较慢和更仔细的推理过程。性能在响应时间的中等范围内最高,表明仔细的推理可以提高准确性,而极长的响应时间往往对应于困惑。最后,编程经验主要在给定语言中预测性能,跨语言的转移有限,表明混淆挑战语言特定的熟悉度比通用编程能力更多。

英文摘要:

We investigate how code obfuscation influences human understanding of programs through an output-prediction task. To study this effect, we construct multiple levels of obfuscation, ranging from unobfuscated code to transformations involving identifier renaming, adversarially misleading identifiers, control-flow modifications, and combinations of these techniques. These transformations are applied to function-level programs written in Python and JavaScript. Participants were asked to predict program outputs while we recorded correctness, response time, and self-reported programming experience. Our results show that obfuscation generally increases the time required to reason about code and tends to reduce prediction accuracy. However, the relationship between obfuscation strength and performance is not strictly monotonic and varies across programming languages. JavaScript exhibits the expected pattern of increasing difficulty with stronger obfuscation, whereas Python displays a more complex trend in which certain renaming transformations can perform comparably to, or occasionally better than, the unobfuscated baseline. Response-time analyses further suggest that obfuscation shifts participants away from rapid, heuristic reasoning toward slower and more deliberate reasoning processes. Performance appears highest within a moderate range of response times, indicating that careful deliberation can improve accuracy, while extremely long response times often correspond to confusion. Finally, programming experience predicts performance primarily within a given language, with limited transfer across languages, suggesting that obfuscation challenges language-specific familiarity more than general programming ability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑