论文标题
使用神经语言模型测量设计合规性 - 汽车案例研究
Measuring design compliance using neural language models -- an automotive case study
论文作者
论文摘要
随着现代车辆变得更加定义,它开始付出巨大的努力来避免软件设计中的严重回归。这是因为汽车软件架构师在很大程度上依赖对代码的手动审查来发现与指定设计原理的偏差。这种方法既低效又容易出错。最近几天,通过源代码预先培训的神经语言模型开始使用各种编程任务自动化。在这项工作中,我们扩展了这种编程语言模型(PLM)的应用以自动化设计合规性的评估。使用PLM,我们构建了一个系统,该系统评估一组查询程序是否符合控制器Handler,这是一种设计模式,以确保汽车控制软件中的硬件抽象。该评估是基于衡量从PLM提取的查询程序嵌入的几何布置是否与该模式的一组已知实现相一致。然后,对齐水平随后转化为可解释的合规性度量。使用对照实验,我们证明我们的技术决定了对92%的精度的遵守。此外,使用专家审查来校准自动评估,我们引入了一项协议,以确定违规的性质,以帮助最终进行重构。这项工作的结果表明,神经语言模型可以为人类建筑师评估和修复汽车软件设计违规行为提供宝贵的帮助。
As the modern vehicle becomes more software-defined, it is beginning to take significant effort to avoid serious regression in software design. This is because automotive software architects rely largely upon manual review of code to spot deviations from specified design principles. Such an approach is both inefficient and prone to error. In recent days, neural language models pre-trained on source code are beginning to be used for automating a variety of programming tasks. In this work, we extend the application of such a Programming Language Model (PLM) to automate the assessment of design compliance. Using a PLM, we construct a system that assesses whether a set of query programs comply with Controller-Handler, a design pattern specified to ensure hardware abstraction in automotive control software. The assessment is based upon measuring whether the geometrical arrangement of query program embeddings, extracted from the PLM, aligns with that of a set of known implementations of the pattern. The level of alignment is then transformed into an interpretable measure of compliance. Using a controlled experiment, we demonstrate that our technique determines compliance with a precision of 92%. Also, using expert review to calibrate the automated assessment, we introduce a protocol to determine the nature of the violation, helping eventual refactoring. Results from this work indicate that neural language models can provide valuable assistance to human architects in assessing and fixing violations in automotive software design.