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.
翻译:随着现代工具更加软件定义,它开始作出重大努力,避免软件设计出现严重倒退。这是因为汽车软件设计师主要依靠对代码的手工审查,以发现偏离特定设计原则的情况。这种方法既效率低下,又容易出错。最近几天,在源代码方面经过预先培训的神经语言模型开始用于使各种编程任务自动化。在这项工作中,我们扩大应用这种编程语言模型(PLM)来自动评估设计合规情况。我们使用一个PLM,建立一个系统来评估一套查询程序是否符合主计长-Handler,这是确保汽车控制软件中硬件抽象化的一种特定设计模式。评估的基础,是衡量从PLM中提取的查询程序嵌入的几何类安排是否符合一套已知的编程任务。在这项工作中,我们将调整的程度转化为可解释的合规度。我们使用一个控制实验,我们的技术决定了92%的精确度。此外,我们利用专家审查来校准自动评估,我们从自动评估中选择了一个有价值的设计结果,我们引入了一项程序,以便确定最终确定一个程序的性质。