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

Go-Oracle:面向Go并发缺陷的自动化测试预言

Go-Oracle: Automated Test Oracle for Go Concurrency Bugs

University of Edinburgh(爱丁堡大学);Bytedance(字节跳动)

Foivos Tsimpourlas, Chao Peng, Carlos Rosuero, Ping Yang, Ajitha Rajan

AI总结:

针对Go程序并发缺陷测试预言缺失的问题,提出Go-Oracle工具,通过采集执行轨迹、编码后用transformer模型分类测试结果,在有限数据集下仍有高准确率,获工业界开发者认可。

摘要:

Go编程语言在软件开发中,尤其是各类基础设施系统的开发中,已获得广泛应用。然而,并发缺陷已成为Go语言中的普遍问题,由于该语言同时具备通信顺序进程与共享内存这两种并发机制,这类缺陷带来了独特的挑战。检测并发缺陷并准确将程序执行结果分类为通过或失败,即使对于领域专家而言也是一项巨大的挑战。我们对字节跳动的资深开发者开展了一项调研,证实了这一挑战的存在。本工作旨在解决Go程序的测试预言问题,即自动对测试执行结果进行通过或失败的分类。由于Go语言独特的编程模型,现有文献尚未针对Go程序研究过这一问题。\n我们的方法包括从多个被测Go程序中收集通过和失败的执行轨迹。我们使用Go原生的执行追踪器捕获全面的执行事件序列。随后,我们对这些轨迹进行预处理和编码,再训练一个基于transformer的神经网络,以有效将轨迹分类为通过或失败。我们对该方法的评估涵盖了来自GoBench仓库的8个被测程序,这些被测程序是工业场景中常用的基准程序。令人鼓舞的是,我们的测试预言工具Go-Oracle即使在数据集有限的情况下也展现出了高准确率,证明了我们方法的有效性与潜力。字节跳动的开发者们强烈认同,相较于当前人工检查的方式,他们更愿意使用Go-Oracle工具来对Go程序的测试结果进行通过或失败的分类。

英文摘要:

The Go programming language has gained significant traction for developing software, especially in various infrastructure systems. Nonetheless, concurrency bugs have become a prevalent issue within Go, presenting a unique challenge due to the language's dual concurrency mechanisms-communicating sequential processes and shared memory. Detecting concurrency bugs and accurately classifying program executions as pass or fail presents an immense challenge, even for domain experts. We conducted a survey with expert developers at Bytedance that confirmed this challenge. Our work seeks to address the test oracle problem for Go programs, to automatically classify test executions as pass or fail. This problem has not been investigated in the literature for Go programs owing to its distinctive programming model. Our approach involves collecting both passing and failing execution traces from various subject Go programs. We capture a comprehensive array of execution events using the native Go execution tracer. Subsequently, we preprocess and encode these traces before training a transformer-based neural network to effectively classify the traces as either passing or failing. The evaluation of our approach encompasses 8 subject programs sourced from the GoBench repository. These subject programs are routinely used as benchmarks in an industry setting. Encouragingly, our test oracle, Go-Oracle, demonstrates high accuracies even when operating with a limited dataset, showcasing the efficacy and potential of our methodology. Developers at Bytedance strongly agreed that they would use the Go-Oracle tool over the current practice of manual inspections to classify tests for Go programs as pass or fail.

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

↑