Skip to content

nvshaxie/prompt-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Simplified Test Plan Generator

An AI-powered test plan generation system that creates high-quality prompts for guiding AI assistants (ChatGPT, Claude, etc.) to generate targeted test plans and test cases.

๐Ÿš€ Key Features

๐Ÿ” Dual Analysis Modes

  • Source Code Mode: Automatically analyze project structure and codebase
  • Configuration Mode: Generate prompts from project configuration files (with automatic quality enhancement)

๐Ÿงช Comprehensive Test Types

  • Unit, Integration, Performance, Security testing
  • End-to-End, Stress, Mobile, API, Microservice, Database testing
  • Feature-specific and project-level test generation

๐ŸŽฏ Smart Template System

  • Intelligent template selection based on project type
  • Context-aware prompt generation
  • Support for multiple technology stacks

โšก Automatic Quality Enhancement

  • Smart inference engine for configuration completion
  • Domain knowledge base integration
  • No manual configuration required for config mode

๐Ÿ“ Project Structure

prompt_generator/
โ”œโ”€โ”€ analyzer/          # Project analysis and quality enhancement
โ”œโ”€โ”€ templates/         # Comprehensive prompt template library  
โ”œโ”€โ”€ generator/         # Template combination and prompt generation
โ”œโ”€โ”€ knowledge/         # Domain knowledge base
โ”œโ”€โ”€ config/           # Configuration templates and settings
โ””โ”€โ”€ main.py          # Main execution script

๐Ÿ› ๏ธ Installation

# Install dependencies
pip install -r requirements.txt

๐Ÿ“‹ Usage

Source Code Mode (Traditional)

Analyze existing projects with source code:

# Generate prompt by test type (recommended)
python main.py --project-path /path/to/project --test-type unit
python main.py --project-path /path/to/project --test-type integration
python main.py --project-path /path/to/project --test-type performance

# Generate test plan for specific feature
python main.py --project-path /path/to/project --create-test-plan-prompt --feature-name auth --test-type security

# Generate test cases from existing test plan
python main.py --project-path /path/to/project --create-test-case-prompt --test-plan-path plan.md

Configuration Mode (No Source Code)

For projects without accessible source code, using configuration files with automatic quality enhancement:

# Basic usage (automatic quality enhancement applied)
python main.py --config-file my_project_config.yaml --test-type unit
python main.py --config-file my_project_config.yaml --test-type integration --verbose

# Feature-specific testing
python main.py --config-file my_project_config.yaml --create-test-plan-prompt --feature-name user_auth --test-type security

Configuration Setup:

  1. Copy the template: cp config/project_config_template.yaml my_project_config.yaml
  2. Edit the configuration file with your project details
  3. Run with --config-file parameter

General Commands

# List all supported test types
python main.py --list-test-types

# List available prompt templates
python main.py --list-prompt-templates

# List project features (source code mode only)
python main.py --project-path /path/to/project --list-features

# Save analysis results
python main.py --project-path /path/to/project --test-type unit --save-analysis

# Verbose output
python main.py --config-file config.yaml --test-type unit --verbose

๐Ÿงช Supported Test Types

Category Test Types Description
Basic Tests unit, integration Core functionality testing
Performance performance, stress Load and stress testing
System Tests e2e, security End-to-end and security testing
Specialized mobile, api, microservice, database Technology-specific testing

๐ŸŽฏ Supported Project Types

  • Web Applications: Flask, Django, FastAPI, React, Vue, Angular
  • API Services: RESTful APIs, GraphQL, Microservices
  • Mobile Applications: iOS, Android, React Native
  • Machine Learning: TensorFlow, PyTorch, Scikit-learn
  • Federated Learning: NVFlare, PySyft
  • Database Systems: SQL, NoSQL, Data warehouses
  • Generic Projects: Any software project

๐Ÿ“Š Quality Enhancement Features

When using Configuration Mode, the system automatically applies:

๐Ÿง  Intelligent Inference Engine

  • Automatically infers missing project details
  • Suggests test scenarios based on technology stack
  • Identifies potential risk areas

๐Ÿ“š Domain Knowledge Base

  • Industry best practices integration
  • Technology-specific testing patterns
  • Quality metrics and standards

๐Ÿ” Quality Assessment

  • Multi-dimensional quality scoring
  • Completeness and specificity analysis
  • Confidence level evaluation

๐Ÿ’ก Example Workflow

Source Code Analysis

$ python main.py --project-path ./my-web-app --test-type integration

๐Ÿ” Analyzing project: ./my-web-app
โœ… Integration test prompt generated: prompt_result/test_plan_prompt_integration.md
๐Ÿ“ Test type: integration
๐Ÿ“„ Template used: integration_test_prompt

๐Ÿ’ก Usage suggestions:
   1. Copy prompt content to ChatGPT/Claude etc.
   2. AI will generate detailed integration test plan
   3. Ask follow-up questions about specific scenarios

Configuration-Based Generation

$ python main.py --config-file project_config.yaml --test-type unit --verbose

๐ŸŽฏ ๅฏ็”จ่ดจ้‡ๅขžๅผบๆจกๅผ...
โœ… ่ดจ้‡ๅขžๅผบๅฎŒๆˆ๏ผŒ่ฏ„ๅˆ†: 0.73
๐Ÿ“Š ๅบ”็”จ็š„ๅขžๅผบๆŠ€ๆœฏ: ๆ™บ่ƒฝๆŽจๆ–ญ, ้ข†ๅŸŸ็Ÿฅ่ฏ†ๅบ“
โœ… Unit test prompt generated: prompt_result/test_plan_prompt_unit_config.md
๐Ÿ”ง Mode: Configuration-based

๐Ÿ”ง Configuration Template

Create my_project_config.yaml based on config/project_config_template.yaml:

project_info:
  name: "My Web Application"
  description: "E-commerce platform with React frontend and Django backend"
  type: "web_application"

tech_stack:
  languages: ["Python", "JavaScript"]
  frameworks: ["Django", "React"]
  databases: ["PostgreSQL", "Redis"]

core_modules:
  - name: "User Authentication"
    description: "Login, registration, password reset"
  - name: "Product Catalog"
    description: "Product listing, search, filtering"
  - name: "Shopping Cart"
    description: "Add/remove items, checkout process"

๐Ÿ“ˆ Output Examples

Generated prompts are optimized for AI assistants:

โœ… Integration test prompt generated: prompt_result/test_plan_prompt_integration_config.md
๐Ÿ“ Test type: integration
๐Ÿ“„ Template used: integration_test_prompt
๐Ÿ”ง Mode: Configuration-based

๐Ÿ’ก Usage suggestions:
   1. Copy prompt content to ChatGPT/Claude etc. AI assistants
   2. AI assistants will generate detailed integration test plan
   3. You can ask follow-up questions about specific scenarios
   4. Generated test cases are based on configuration information

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Ready to generate high-quality test plans? Start with a simple command:

python main.py --config-file config/project_config_template.yaml --test-type unit

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages