当前位置: X-MOL 学术Inf. Softw. Technol. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Supporting refactoring of BDD specifications—An empirical study
Information and Software Technology ( IF 3.8 ) Pub Date : 2021-08-20 , DOI: 10.1016/j.infsof.2021.106717
Mohsin Irshad 1, 2 , Jürgen Börstler 1 , Kai Petersen 1
Affiliation  

Context:

Behavior-driven development (BDD) is a variant of test-driven development where specifications are described in a structured domain-specific natural language. Although refactoring is a crucial activity of BDD, little research is available on the topic.

Objective:

To support practitioners in refactoring BDD specifications by (1) proposing semi-automated approaches to identify refactoring candidates; (2) defining refactoring techniques for BDD specifications; and (3) evaluating the proposed identification approaches in an industry context.

Method:

Using Action Research, we have developed an approach for identifying refactoring candidates in BDD specifications based on two measures of similarity and applied the approach in two projects of a large software organization. The accuracy of the measures for identifying refactoring candidates was then evaluated against an approach based on machine learning and a manual approach based on practitioner perception.

Results:

We proposed two measures of similarity to support the identification of refactoring candidates in a BDD specification base; (1) normalized compression similarity (NCS) and (2) similarity ratio (SR). A semi-automated approach based on NCS and SR was developed and applied to two industrial cases to identify refactoring candidates. Our results show that our approach can identify candidates for refactoring 6o times faster than a manual approach. Our results furthermore showed that our measures accurately identified refactoring candidates compared with a manual identification by software practitioners and outperformed an ML-based text classification approach. We also described four types of refactoring techniques applicable to BDD specifications; merging candidates, restructuring candidates, deleting duplicates, and renaming specification titles.

Conclusion:

Our results show that NCS and SR can help practitioners in accurately identifying BDD specifications that are suitable candidates for refactoring, which also decreases the time for identifying refactoring candidates.



中文翻译:

支持重构 BDD 规范——一项实证研究

语境:

行为驱动开发 (BDD) 是测试驱动开发的一种变体,其中规范是用结构化的、特定于领域的自然语言来描述的。尽管重构是 BDD 的一项重要活动,但关于该主题的研究很少。

客观的:

通过 (1) 提出半自动化方法来识别重构候选者,从而支持从业者重构 BDD 规范;(2) 为 BDD 规范定义重构技术;(3) 在行业背景下评估提议的识别方法。

方法:

使用 Action Research,我们开发了一种方法,用于基于两个相似性度量确定 BDD 规范中的重构候选者,并将该方法应用于大型软件组织的两个项目。然后根据基于机器学习的方法和基于从业者感知的手动方法评估用于识别重构候选者的措施的准确性。

结果:

我们提出了两种相似性度量来支持在 BDD 规范库中识别重构候选者;(1) 归一化压缩相似度 (NCS) 和 (2) 相似度比 (SR)。开发了一种基于 NCS 和 SR 的半自动化方法,并将其应用于两个工业案例以识别重构候选者。我们的结果表明,我们的方法可以比手动方法快 6o 倍地识别重构的候选者。我们的结果进一步表明,与软件从业者的手动识别相比,我们的措施准确地识别了重构候选者,并且优于基于 ML 的文本分类方法。我们还描述了适用于 BDD 规范的四种重构技术;合并候选、重组候选、删除重复项和重命名规范标题。

结论:

我们的结果表明,NCS 和 SR 可以帮助从业者准确识别适合重构的 BDD 规范,这也减少了识别重构候选者的时间。

更新日期:2021-08-26
down
wechat
bug