当前位置: 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.)
Demystifying the adoption of behavior-driven development in open source projects
Information and Software Technology ( IF 3.8 ) Pub Date : 2020-03-19 , DOI: 10.1016/j.infsof.2020.106311
Fiorella Zampetti , Andrea Di Sorbo , Corrado Aaron Visaggio , Gerardo Canfora , Massimiliano Di Penta

Context:Behavior-Driven Development (BDD) features the capability, through appropriate domain-specific languages, of specifying acceptance test cases and making them executable. The availability of frameworks such as Cucumber or RSpec makes the application of BDD possible in practice. However, it is unclear to what extent developers use such frameworks, and whether they use them for actually performing BDD, or, instead, for other purposes such as unit testing. Objective:In this paper, we conduct an empirical investigation about the use of BDD tools in open source, and how, when a BDD tool is in place, BDD specifications co-evolve with source code. Method:Our investigation includes three different phases: (i) a large-scale analysis to understand the extent to which BDD frameworks are used in 50,000 popular open-source projects written in five programming languages; (ii) a study on the co-evolution of scenarios, fixtures and production code in a sample of 20 Ruby projects, through the Granger’s causality test, and (iii) a survey with 31 developers to understand how they use BDD frameworks. Results:Results of the study indicate that ≃ 27% of the sampled projects use BDD frameworks, with a prevalence in Ruby projects (68%). In about 37% of the cases, we found a co-evolution between scenarios/fixtures and production code. Specifically, changes to scenarios and fixtures often happen together or after changes to source code. Moreover, survey respondents indicate that, while they understand the intended purpose of BDD frameworks, most of them write tests while/after coding rather than strictly applying BDD. Conclusions:Even if the BDD frameworks usage is widespread among open source projects, in many cases they are used for different purposes such as unit testing activities. This mainly happens because developers felt BDD remains quite effort-prone, and its application goes beyond the simple adoption of a BDD framework.



中文翻译:

揭开在开源项目中采用行为驱动开发的神秘面纱

上下文:行为驱动开发(BDD)具有通过适当的特定于域的语言来指定验收测试用例并使它们可执行的能力。诸如Cucumber或RSpec之类的框架的可用性使BDD在实践中的应用成为可能。但是,尚不清楚开发人员在何种程度上使用此类框架,以及他们是否将其用于实际执行BDD或用于其他目的(例如单元测试)。目的:在本文中,我们对开放源代码中BDD工具的使用以及当使用BDD工具时BDD规范如何与源代码一起发展进行了实证研究。方法:我们的调查包括三个不同阶段:(i)进行大规模分析,以了解BDD框架在以五种编程语言编写的50,000个受欢迎的开源项目中的使用程度;(ii)通过格兰杰的因果关系测试对20个Ruby项目的示例中的场景,固定装置和生产代码进行联合演化的研究,以及(iii)与31个开发人员进行的调查,以了解他们如何使用BDD框架。结果:研究结果表明,≃27%的抽样项目使用BDD框架,其中Ruby项目(68%)盛行。在大约37%的案例中,我们发现场景/固定装置与生产代码之间存在共同进化。具体而言,对场景和固定装置的更改通常一起发生或在源代码更改之后发生。此外,受访者表示,尽管他们了解BDD框架的预期目的,但大多数人在编码时/编码后/之后编写测试,而不是严格应用BDD。结论:即使BDD框架在开源项目中广泛使用,在许多情况下,它们仍用于不同的目的,例如单元测试活动。这主要是因为开发人员认为BDD仍然很容易工作,并且其应用超出了BDD框架的简单采用。

更新日期:2020-03-19
down
wechat
bug