Classifying BDD Software Tests Using Machine Learning and NLP Techniques - Brandão, David Ferreira; Rodrigues, Cleyton Mário de Oliveira; Santos, Wylliams Barbosa (Anais do Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), 2025)
The increasing complexity and volume of Behavior-Driven Development (BDD) test scripts have made manual validation time-consuming, error-prone, and difficult to standardize. To address these challenges, this study proposes an automated approach for analyzing BDD scenarios through a hybrid solution that combines Natural Language Processing (NLP) and Machine Learning (ML) techniques. The solution consists of two components: an NLP-based validator that detects structural and linguistic inconsistencies in Gherkin steps, and a supervised ML classifier that assigns each step to one of three functional roles: Precondition, Action, or Expected Result independent of the original Gherkin keywords. The methodology includes the development and evaluation of a classification model trained on a labeled dataset of 1,500 synthetic BDD steps. Performance was validated using accuracy, precision, recall, and F1-score metrics, and further confirmed with real-world test data. The proposed system provides near-instant feedback per step, enabling efficient integration into real-time development workflows. This research demonstrates the feasibility of combining rule-based validation and machine learning classification to improve the quality, consistency, and maintainability of BDD test artifacts.