| Journal of Smart Sensors and Computing
Received: 22 September 2026; Revised: 03 November 2026; Accepted: 04 November 2026; Published Online: 06 November 2026.
J. Smart Sens. Comput., 2026, 2(4), 26218 | Volume 2 Issue 4 (December 2026) | DOI: https://doi.org/10.64189/ssc.25218
© The Author(s) 2026
This article is licensed under Creative Commons Attribution NonCommercial 4.0 International (CC-BY-NC 4.0)
Test Case Generation Using Small Language Models:
Architecture and Experimental Evaluation
Rinku Ashish Badgujar
*
and Prerna Pareek
School of Computer Science, Nirwan University, Jaipur, Rajasthan, 303305, India
*Email: rinku.badgujar@gmail.com (Rinku Ashish Badgujar)
Abstract
Designing test cases manually for banking software is still a time-consuming endeavour that frequently finds it
hard to match the pace of modern agile development processes and changing regulatory requirements. Recent
progress in artificial intelligence research showed some promising results in automation of various phases of
the testing life cycle. However, most of such solutions use cloud-based models, require large amounts of data, or
generate unstructured output, which makes them challenging to implement in an audit-proof way. In this paper,
a framework for automated generation of testing scenarios and test cases based on small language models is
presented. The solution comprises of a requirement extraction module (SLM-1), which extracts structured
testing attributes from user stories and uses deterministic logic rules to ensure that the extracted information
complies with the problem domain. The next stage involves validating the output of the requirement extraction
phase, followed by the generation of a test scenario and individual steps of testing. Each generated test case in
this framework will be traceable to a specific requirement label from user stories. The experiments conducted
showed that the approach was able to deliver high production-level extraction performance and provided a
structure and reviewable output. Results indicate that a hybrid approach using small language models, trained
on particular domains, combined with deterministic test generation algorithms may serve as a feasible and
implementable approach to support AI-based testing in highly regulated software domains. The research
provides important insights into building enterprise-scale automated testing workflows for advanced banking
applications.
Keywords: Artificial intelligence in software testing; Automated test case generation; Requirement extraction; Small
language models; Banking software testing.
1. Introduction
               













                




            

 
            



              











                









              
    
       

               
         







            

  

           

                

            




            









               



                
        

     











 
     

         
             
              











 
             




Fig. 2: NLP-based processing pipeline for extracting structured information from use case specifications.
[18]

           



            


         



              











  

          
              
















  
                
             









  




           




Fig. 3: Proposed hybrid architecture for requirement-driven test case generation.
[10]

            
            
               
           

            

            

             


















  





Table 1: Core components of the proposed test generation pipeline
Component
Function
Output
SLM-1 Requirement
Extractor
Extracts structured testing attributes from user
stories
Feature type, operation, entities,
constraints
SLM-2 Quality Gate
Validates predictions and detects
inconsistencies
Verified requirement labels
Scenario Generator
Generates structured testing scenarios based on
requirement labels
Scenario templates
SLM-3 Test Case
Generator
Produces detailed test cases with steps and
expected results
Structured test cases
            


   
              

          

       
           








Table 2: Requirement feature taxonomy used for test generation
Feature Category
Description
Example
Feature Type
Functional area of the system
Payment Processing
Operation
Action performed by the user or system
Transfer Funds
Entities
System components or actors involved
Customer Account
Constraints
Conditions or limitations on system behavior
Daily transaction limit
Transition Intent
Expected system state change

Behavioral Effects
Expected outcome of the operation
Balance updated


       
                 

            







            


Table 3: Requirement validation rules
Purpose
Detects contradictory requirement constraints
Ensures valid number of system entities
Identifies regulatory or compliance-related terms
Flags predictions with low model confidence







          



Table 4: Scenario categories generated by the framework
Scenario Type
Description
Positive Scenario
Valid user action producing expected result
Negative Scenario
Invalid input or constraint violation
Edge Case Scenario
Boundary conditions and limit testing
Security Scenario
Authorization and access validation
Constraint Scenario
Validation of system rules or policies






            
             
                

Table 5: Generated test case structure
Field
Description
Requirement ID
Identifier of source requirement
Scenario ID
Identifier of generated scenario
Preconditions
System state required before execution
Test Steps
Ordered sequence of testing actions
Test Data
Input values used during execution
Expected Result
Expected system response
Traceability Label
Mapping to requirement attributes




             
               



Table 6: Example requirement-to-test traceability mapping
Requirement Feature
Generated Scenario
Test Case Step
Operation: Transfer Funds
Positive transaction scenario
Initiate transfer request
Constraint: Daily Limit
Constraint validation scenario
Enter amount exceeding limit
Behavioral Effect: Balance Update
Positive scenario
Verify updated account balance

















             


 

           


Table 7: Implementation environment and tools
Component
Technology Used
Programming Language
Python
Machine Learning Framework
PyTorch
Transformer Library
HuggingFace Transformers
Data Processing
Pandas, NumPy
User Interface
Streamlit
Model Training Environment
CPU-based local workstation
Storage
JSON and CSV structured datasets
            





           

             


              

Table 8: Dataset composition
Dataset Category
Number of User Stories
Initial Training Dataset
95
Expanded Dataset
152
Target Dataset Size
200
Test Dataset
15
Extended Evaluation Dataset
20
   
             










  
             







Table 9: Multi-head prediction tasks for requirement extraction
Prediction Head
Task
Feature Type
Identify functional module category
Operation
Detect user or system action
Transition Intent
Identify state transitions
Entities
Extract system actors or objects
Prediction Head
Task
Constraints
Detect system rules or limits
Behavioral Effects
Identify expected outcomes









Table 10: Validation rules implemented in SLM-2
Validation Rule
Description
Entity Count Check
Ensures that predicted entities fall within acceptable limits
Constraint Conflict Detection
Identifies contradictory constraint combinations
Domain Keyword Detection
Detects regulatory terms such as AML or KYC
Confidence Threshold Rule
Flags predictions with low confidence scores
              


              



             


Table 11: Scenario generation templates
Scenario Type
Purpose
Positive Flow
Valid system interaction
Negative Flow
Invalid input handling
Edge Case
Boundary condition testing
Security Validation
Access control verification
Constraint Validation
Rule or policy enforcement
Fig. 4: Generated Scenarios view within the Streamlit interface displaying rule-based scenarios for the Card
Activation user story, categorised by type and priority with traceability tags to SLM-1 attributes.
    
               


            
         


           









             

Table 12: Generated test case format
Field
Description
Test Case ID
Unique identifier
Scenario Reference
Scenario that generated the test case
Preconditions
Required system state
Test Steps
Ordered sequence of actions
Test Data
Input values
Expected Result
Expected system behavior
Traceability Link
Reference to requirement attributes
Fig. 5: Generated test cases view in the framework interface showing a fully expanded test case for the successful
Card Activation scenario, including preconditions, ordered test steps, expected result, and test data.

















1. Input user story parsing and ingestion
2. Extraction of requirement attributes via SLM-1
3. Validating those attributes via SLM-2
4. Scenarios creation via deterministic templates
5. Test cases creation via structured templates
6. Traceability mapping for the generated test artifacts
Fig. 6: End-to-end execution pipeline for automated test case generation




Fig. 7: Implementation interface of proposed multi-SLM test case Generation system









Fig. 8: Processing of banking user stories and acceptance criteria within proposed framework.
              



           

           

Fig. 9: SLM-1 requirement extraction output for card activation user story showing extracted feature type, operation,
transition, entities, constraints, and behavioural effects with associated confidence scores.

              





               
             



Table 13: Banking user stories used for pipeline evaluation
Story Category
Example Functionality
Card Management
Card blocking and activation
Compliance
KYC verification
Account Management
Account closure
Lending
Loan eligibility validation
Payments
Transaction processing


               


              


     




             


           


              


𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 =
   
   

𝐹1 = 2 ×
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑅𝑒𝑐𝑎𝑙𝑙
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑅𝑒𝑐𝑎𝑙𝑙

Table 14: SLM-1 Requirement extraction performance
Prediction Head
Metric
Test Dataset (n=15)
Extended Dataset (n=20)
Feature Type
Accuracy
1.00
0.95
Operation
Accuracy
0.93
0.90
Transition Intent
Accuracy
0.88
0.86
Entities
F1 Score
0.91
0.88
Constraints
F1 Score
0.74
0.79
Behavioral Effects
F1 Score
0.71
0.76


                


          




            




                

              
             





Table 15: SLM-3 test case quality evaluation
Scenario Type
BLEU-4
ROUGE-L
Expert Score (/5)
Positive Scenarios
0.52
0.65
4.2
Negative Scenarios
0.44
0.58
3.9
Security Scenarios
0.38
0.52
3.6
Constraint Scenarios
0.41
0.57
4.0
Edge Case Scenarios
0.33
0.48
3.4
Overall Average
0.41
0.58
3.82
Fig. 10: Test Cases sheet from the exported Excel workbook showing structured test cases with preconditions,
ordered test steps, test data, expected results, and coverage tags for the Card Activation user story.




                 





   


              
            
             

        




      


Table 16: User stories used in end-to-end evaluation
Use Case
Description
Card Blocking
Customer blocks a lost debit card
KYC Verification
System validates customer identity
Account Closure
Customer requests account termination
Loan Eligibility
System evaluates loan approval criteria
Payment Processing
Customer initiates fund transfer



Table 17: End-to-end pipeline evaluation results
Metric
Manual Testing
Proposed System
Average Scenarios per Story
9.2
10.4
Scenario Coverage
89%
Generation Time
~6 minutes
1.8 seconds
Expert Quality Rating
Acceptable with minor review
Fig. 11: Summary sheet of the exported Excel output for the Card Activation user story, showing total test case count
and breakdown by scenario type and priority level.
             















Fig. 12: SLM-1 requirement extraction output for card activation user story showing extracted feature type,
operation, transition, entities, constraints, and behavioural effects with associated confidence scores.

        


             

     




 



               

              















            



             
            



              
                


              




















CRediT Author Contribution Statement
Rinku Ashish Badgujar: Conceptualization, Data Curation, Formal analysis; Investigation; Methodology;
Validation; Visualization; Writing Original draft; Writing Review & editing. Prerna Pareek: Data curation;
Formal analysis; Investigation; Project administration; Resources; Software; Supervision; Validation; Writing
Review & editing.
Funding Declaration
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-
profit sectors.
Data Availability Statement
No data were generated or analysed during the current study. Therefore, data sharing is not applicable to this
article.









M. F. Granda, O. Parra, M. F. Alba-Sarango, Towards a Model-Driven Testing Framework for GUI Test
Cases Generation from User Stories, 16th International Conference on Evaluation of Novel Approaches
to Software Engineering (ENASE 2021), 2021, 453460, doi: 10.5220/0010499004530460.

H. Hourani, A. Hammad, M. Lafi, The Impact of Artificial Intelligence on Software Testing, 2019 IEEE
Jordan International Joint Conference on Electrical Engineering and Information Technology (JEEIT),
2019, 565570, doi: 10.1109/JEEIT.2019.8717439.

Z. Khaliq, S. U. Farooq, D. A. Khan, Artificial Intelligence in Software Testing: Impact, Problems,
Challenges and Prospect, arXiv preprint, 2022, doi: 10.48550/arXiv.2201.05371.

A. Ramadan, H. Yasin, B. Pektas, The Role of Artificial Intelligence and Machine Learning in Software
Testing, arXiv preprint, 2024, arXiv:2409.02693, doi: 10.48550/arXiv.2409.02693.

H. V. Pandhare, From Test Case Design to Test Data Generation: How AI Is Redefining QA Processes,
International Journal of Engineering and Computer Science, 2024, 13, doi: 10.18535/ijecs.v13i12.4956.

M. Islam, F. Khan, S. Alam, M. Hasan, Artificial Intelligence in Software Testing: A Systematic Review,
2023 IEEE Region 10 Conference (TENCON), 2023, 524529, doi:
10.1109/TENCON58879.2023.10322349.

H. Ayenew, M. Wagaw, Software Test Case Generation Using Natural Language Processing (NLP): A
Systematic Literature Review, Artificial Intelligence Evolution, 2024, 110, doi:
10.37256/aie.5120243220.

I. K. Raharjana, D. Siahaan, C. Fatichah, User Stories and Natural Language Processing: A Systematic
Literature Review, IEEE Access, 2021, 9, 5381153826, doi: 10.1109/ACCESS.2021.3070606.

H. Mollah, P. van den Bos, From User Stories to End-to-End Web Testing, 2023 IEEE International
Conference on Software Testing, Verification and Validation Workshops (ICSTW), IEEE, 2023, 140148,
doi: 10.1109/ICSTW58534.2023.00036.

C. Wang, F. Pastore, A. Goknil, L. C. Briand, Automatic Generation of Acceptance Test Cases from Use Case
Specifications: An NLP-Based Approach, IEEE Transactions on Software Engineering, 2022, 48, 585616,
doi: 10.1109/TSE.2020.2998503.

M. Baqar, R. Khanda, The Future of Software Testing: AI-Powered Test Case Generation and Validation,
Intelligent Computing, 2025,1424, doi: 10.1007/978-3-031-92605-1_18.

M. Tufano, D. Drain, A. Svyatkovskiy, S. K. Deng, N. Sundaresan, Unit Test Case Generation with
Transformers and Focal Context, arXiv preprint, 2020, doi: 10.48550/arXiv.2009.05617.

W. C. Ouédraogo, A. K. Kaboré, H. Tian, Y. Song, A. Koyuncu, J. Klein, D. Lo, T. F. Bissyandé, Large-Scale,
Independent and Comprehensive Study of the Power of LLMs for Test Case Generation, arXiv preprint,
2024, doi: 10.48550/arXiv.2407.00225.

F. S. Manzoni, R. Rodrigues, A. C. O. Rocha, Exploring the Use of ChatGPT for the Generation of User Story
Based Test Cases: An Experimental Study, Proceedings of the 27th International Conference on
Enterprise Information Systems (ICEIS 2025), 2025, doi: 10.5220/0013398700003929.

M. Brunetto, G. Denaro, L. Mariani, M. Pezzè, On Introducing Automatic Test Case Generation in Practice:
A Success Story and Lessons Learned, Journal of Systems and Software, 2021, 176, 110933,
doi:10.1016/j.jss.2021.110933.

J. G. Santos, R. S. P. Maciel, AutomTest 3.0: An Automated Test-Case Generation Tool from User Story
Processing Powered with LLMs, Simpósio Brasileiro de Engenharia de Software (SBES), 2024, 769774,
doi: 10.5753/sbes.2024.3603.

C. Tao, J. Gao, T. Wang, Testing and Quality Validation for AI SoftwarePerspectives, Issues, and
Practices, IEEE Access, 2019, 7, 120164120175, doi: 10.1109/ACCESS.2019.2937107.

M. Olsthoorn, More Effective Test Case Generation with Multiple Tribes of AI, Proceedings of the
ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings, 2022,
286290, doi: 10.1145/3510454.3517066.

S. Alagarsamy, C. Tantithamthavorn, A. Aleti, A3Test: Assertion-Augmented Automated Test Case
Generation, Information and Software Technology, 2024, 176, 107565, doi:
10.1016/j.infsof.2024.107565.

S. Qazi, M. Zafar, N. Aslam, M. Khan, Software Quality Assurance Using Artificial Intelligence Techniques:
A Survey of the Software Industry of Pakistan, Journal of Hunan University Natural Sciences, 2023, 50,
89106, doi: 10.55463/issn.1674-2974.50.12.1.

M. Bagherzadeh, N. Kahani, L. Briand, Reinforcement Learning for Test Case Prioritization, IEEE
Transactions on Software Engineering, 2022, 48, 28362856, doi: 10.1109/TSE.2021.3070549.

A. Agarwal, P. Lohia, S. Nagar, K. Dey, D. Saha, Automated Test Generation to Detect Individual
Discrimination in AI Models, arXiv preprint, 2018, arXiv:1809.03260, doi: 10.48550/arXiv.1809.03260.

A. Arcuri, RESTful API Automated Test Case Generation, 2017 IEEE International Conference on
Software Quality, Reliability and Security (QRS), 2017, 920, doi: 10.1109/QRS.2017.11.

Y. Bajaj, M. K. Samal, Accelerating Software Quality: Unleashing the Power of Generative AI for
Automated Test-Case Generation and Bug Identification, International Journal for Research in Applied
Science and Engineering Technology, 2023, 11, 345350, doi: 10.22214/ijraset.2023.54628.

A. Bandi, H. S. T. Nukala, B. Tatavarthi, A. Boggavarapu, Automated Test Case Generation for Software
Testing Using Generative AI, International Conference on Computers and Their Applications, 2025, 2435,
doi: 10.1007/978-3-031-92178-0_7.

J. Wang, B. Suleiman, M. J. Alibasa, Automated Unit Test Case Generation: A Systematic Literature Review,
CoRR, arXiv preprint arXiv:2504.20357, 2025, doi: 10.48550/arXiv.2504.20357.

S. Bhatia, T. Gandhi, D. Kumar, P. Jalote, Unit Test Generation Using Generative AI: A Comparative
Performance Analysis of Autogeneration Tools, Proceedings of the 1st International Workshop on Large
Language Models for Code, 2024, 5461, doi: 10.1145/3643795.3648396.

M. Lafi, T. Alrawashed, A. M. Hammad, Automated Test Cases Generation from Requirements
Specification, 2021 International Conference on Information Technology (ICIT), 2021, 852857, doi:
10.1109/ICIT52682.2021.9491761.
Publisher Note: The views, statements, and data in all publications solely belong to the authors and
contributors. GR Scholastic is not responsible for any injury resulting from the ideas, methods, or products
mentioned. GR Scholastic remains neutral regarding jurisdictional claims in published maps and institutional
affiliations.
Open Access
This article is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, which
permits the non-commercial use, sharing, adaptation, distribution and reproduction in any medium or format,
as long as appropriate credit to the original author(s) and the source is given by providing a link to the Creative
Commons License and changes need to be indicated if there are any. The images or other third-party material
in this article are included in the article's Creative Commons License, unless indicated otherwise in a credit line
to the material. If material is not included in the article's Creative Commons License and your intended use is
not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly
from the copyright holder. To view a copy of this License, visit: https://creativecommons.org/licenses/by-
nc/4.0/
© The Author(s) 2026