We present BERTiMuS, an approach that uses CodeBERT to generate mutants for Simulink models. BERTiMuS converts Simulink models into textual representations, masks tokens from the derived text, and uses CodeBERT to predict the masked tokens. Simulink mutants are obtained by replacing the masked tokens with predictions from CodeBERT. We evaluate BERTiMuS using Simulink models from an industrial benchmark, and compare it with FIM -- a state-of-the-art mutation tool for Simulink. We show that, relying exclusively on CodeBERT, BERTiMuS can generate the block-based Simulink mutation patterns documented in the literature. Further, our results indicate that: (a) BERTiMuS is complementary to FIM, and (b) when one considers a requirements-aware notion of mutation testing, BERTiMuS outperforms FIM.
翻译:本文提出BERTiMuS方法,该方法利用CodeBERT为Simulink模型生成变异体。BERTiMuS将Simulink模型转换为文本表示形式,对衍生文本中的标记进行掩码处理,并利用CodeBERT预测被掩码的标记。通过将掩码标记替换为CodeBERT的预测结果,即可获得Simulink变异体。我们使用工业基准测试中的Simulink模型对BERTiMuS进行评估,并将其与Simulink前沿变异工具FIM进行对比。研究表明,仅依赖CodeBERT的BERTiMuS能够生成文献中记载的基于模块的Simulink变异模式。此外,我们的结果表明:(a) BERTiMuS与FIM具有互补性;(b) 当采用需求感知的变异测试概念时,BERTiMuS的性能优于FIM。