This paper presents and implements the re-usability of scenarios within scenarios for behavior-driven development (BDD) Gherkin test scripts in the Cucumber Java framework. Though the focus of the presented work is on scenario re-usability through an implementation within the Cucumber BDD Java framework, the paper also dives a little into the limitations of Cucumber single-threaded scenario execution model. This implementation increases the modularity and efficiency of the test suite. The paper also discusses VSCode step definition auto-completion integration, simplifying the test script writing process. This functionality is handy to Quality Assurance(QA) test writers, allowing instant access to relevant step definitions. In addition, the use of these methods in a popular continuous integration and delivery platform Jenkins as a Maven Java project is discussed. This integration with Jenkins, facilitates for more efficient test automation for continuous deployment scenarios. Empirical research and practical applications reveal significant improvements in the speed and efficiency of test writing, which is especially valuable for large and complex software projects. Integrating these methods into traditional sequential BDD practices paves the way towards more effective, efficient, and sustainable test automation strategies.
翻译:本文提出并实现了在Cucumber Java框架的行为驱动开发(BDD)Gherkin测试脚本中实现场景内场景的复用。尽管本研究的核心在于通过Cucumber BDD Java框架实现场景复用,但本文也深入探讨了Cucumber单线程场景执行模型的局限性。该实现提升了测试套件的模块化程度与效率。本文还讨论了VSCode步骤定义自动补全集成功能,简化了测试脚本编写流程。该功能对质量保证(QA)测试编写人员尤为实用,使其能够即时访问相关步骤定义。此外,本文还论述了如何在主流持续集成与交付平台Jenkins中以Maven Java项目形式运用这些方法。与Jenkins的集成有助于为持续部署场景实现更高效的测试自动化。实证研究与实际应用表明,测试编写的速度与效率得到显著提升,这对大型复杂软件项目尤其具有价值。将这些方法融入传统顺序式BDD实践,为构建更高效、更可持续的测试自动化策略开辟了道路。