Automated Test Pyramid Generation: From User Stories to Code-Level Testing
This document outlines RoostGPT's comprehensive testing framework that establishes complete traceability from business requirements to implementation-level tests through a guided, user-driven workflow. Our methodology transforms Jira user stories into a multi-layered test suite where users create, verify, and build upon each testing phase sequentially.
The RoostGPT Framework Flow:
Starting with business requirements captured in Jira stories, users work through RoostGPT to create a complete testing ecosystem. Each phase requires user verification before proceeding to the next level:
- Functional Tests - Generated directly from Jira business requirements, creating comprehensive test scenarios along with API specifications and Gherkin feature files that serve as foundational artifacts for subsequent phases
- Unit Tests - Users implement code using Test Driven Development principles based on functional requirements, then create unit tests from the resulting code
- API Tests - Users generate tests from the validated API specifications, verify their accuracy, then use these tested contracts as input for integration testing
- Integration Tests - Created using verified feature files and API specs as inputs, with user validation before proceeding to ensure end-to-end functionality coverage
RoostGPT Testing Framework: Process Flow
Let's demonstrate the first phase of the RoostGPT workflow: transforming a Jira business requirement into a comprehensive functional test plan.
For this example, we'll walk through:
- Taking a Jira user story as input
- Creating structured functional test scenarios in RoostGPT
- Generating the foundational test plan that will serve as input for subsequent API and integration test phases
To proceed with this demonstration, please provide:
- A sample Jira ticket/user story you'd like to use
Lets consider this Jira Ticket
We'll demonstrate using a Jira ticket containing a credit card lifecycle user story as our business requirement input.
Action: Navigate to RoostGPT and initiate the functional test creation workflow.
Select our Jira Ticket
Trigger Functional Test Creation: Once the Jira ticket is selected, initiate RoostGPT's functional test generation process.
Generated Results: Upon completion, RoostGPT produces three foundational artifacts:
- Functional Test Scenarios - Comprehensive test cases derived from business requirements
- Gherkin Feature File - Behavior-driven development scenarios in gherkin feature format.
- API Specification - Technical contract definitions for service interactions

Test-Driven Development and Unit Test Generation
Test-Driven Development Implementation: Using the verified functional test cases as your guide, implement the required code functionality following Test-Driven Development principles. The functional test scenarios provide clear requirements for what your code needs to accomplish.
Code Generation Foundation: The API specification file serves as the single source of truth for generating initial source code structure using the OpenAPI Generator as a helping tool. The OpenAPI Generator serves as a productivity aid that accelerates development by creating standardized code scaffolding and reducing manual setup effort.
openapi-generator generate -i functional_tests/ZBIO-5213.yaml -g spring -o . --additional-properties=javaVersion=1.8
VS Code Integration: Once your code implementation is complete, generate comprehensive unit tests directly within your development environment. Simply right-click on your code file and select "Generate Test using RoostGPT" from the context menu.
Framework Preferences: Configure your testing setup by selecting your preferred dependency management tools and testing frameworks. RoostGPT will adapt the generated tests to match your technology stack and project requirements.
Trigger Generation: Initiate the unit test creation process.
And Voila!! Test Generation is in progress for user written code based on functional test.
Code-Lens Integration: Alternatively, you can generate targeted unit tests using RoostGPT's code-lens functionality. Interactive action items appear above your Package, Class, and Function declarations, allowing for granular test generation at any code level.
Java Structure Preservation: Generated unit tests are automatically organized in the test folder while maintaining the original Java package structure, ensuring seamless integration with your existing project architecture.
Dependency Management: RoostGPT automatically adds all required testing dependencies to your pom.xml file, eliminating manual configuration overhead.
Automated Test Execution: Upon generation, RoostGPT executes the unit tests and generates comprehensive execution reports along with detailed code coverage analysis.
Coverage Analysis: View detailed coverage metrics to understand how thoroughly your tests validate the implemented code.
Intelligent Error Resolution: If any generated tests fail to compile, RoostGPT automatically iterates over the problematic Java files, analyzing compilation errors and attempting to resolve them programmatically.
Fallback Mechanism: After reaching the maximum iteration limit without resolution, RoostGPT changes the file extension to "*.java.invalid" to prevent project-wide compilation issues while preserving the problematic code for manual review.
Iterative Refinement: Use the feedback mechanism to enhance test quality and coverage, ensuring the unit tests meet your exact testing standards and business requirements.

API Test Generation from Specification
Swagger Integration: Navigate to your Swagger/OpenAPI specification file within VS Code. This specification was generated in Phase 1 as part of the functional test creation process.
RoostGPT Integration: Right-click on your Swagger specification file and select "Generate Test using RoostGPT" from the context menu, then choose "API tests using API Spec file" to initiate API test creation.
Output Framework Selection: Choose your preferred API testing framework from the available options. RoostGPT will generate tests compatible with your selected framework and project structure.
Live Server Integration: Configure your testing environment by providing live server details if available for real-time API validation. This allows tests to run against your actual API endpoints for comprehensive verification.
Mock Server Alternative: If no live server is available, RoostGPT automatically provisions a Prism mock server to simulate API responses, ensuring your tests can be executed and validated immediately.
Karate Test Creation: RoostGPT generates comprehensive Karate API tests organized in a dedicated project folder structure. Each test suite includes detailed documentation and execution instructions and also its data csv for different cases.
Integration Test Generation Using API Spec and Feature Files
API Specification Context: Right-click on the Swagger API specification file that was generated during the functional test creation phase. This serves as the foundation for your integration test structure.
RoostGPT Integration Menu: From the context menu, select "Generate test using RoostGPT" then choose "Integration Test using API spec and gherkin feature" to initiate the integration test generation workflow.
Output Framework Selection: Choose your preferred integration testing framework from the available options. RoostGPT will structure the generated tests according to your selected framework's conventions and best practices.
Gherkin Feature Location: When prompted, navigate to and select the Gherkin feature file location. This feature file was generated alongside the functional tests in Phase 1 and contains the behavior-driven development scenarios.
Scenario Processing: RoostGPT triggers the integration test creation process by parsing the selected feature file and extracting individual test scenarios. Each scenario is analyzed for its specific testing requirements and data needs.
Organized Test Output: The generation process creates a comprehensive test suite with separate files for each scenario identified in the feature file. Additionally, corresponding CSV test data files are automatically generated to support data-driven testing for each scenario.

Conclusion: Complete Testing Ecosystem Achievement
RoostGPT Workflow Summary
Through this comprehensive four-phase workflow, RoostGPT transforms a single Jira business requirement into a complete, multi-layered testing ecosystem. Starting with user stories and ending with validated code implementation, every aspect of your application is thoroughly tested and traceable back to original business needs.
Achieved Test Coverage:
- ✅ Functional Tests - Business requirement validation and acceptance criteria verification
- ✅ Unit Tests - Component-level code validation following TDD principles
- ✅ API Tests - Service contract and endpoint functionality verification
- ✅ Integration Tests - End-to-end workflow and system interaction validation
Key Workflow Benefits Realized:
Complete Requirements Traceability: Every generated test directly maps back to your original Jira business requirements, ensuring no functionality gaps.
Seamless Development Integration: VS Code integration enables developers to generate tests contextually without leaving their development environment.
Framework Flexibility: Support for multiple testing frameworks ensures compatibility with your existing technology stack.
Data-Driven Testing: Automated CSV generation provides comprehensive test data coverage for thorough validation.
Quality Assurance: User verification at each phase ensures accuracy and alignment with business expectations.