testgenie-py 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.3
2
+ Name: testgenie-py
3
+ Version: 0.2.3
4
+ Summary: Automated unit test generation tool for Python.
5
+ Author: cjseitz
6
+ Author-email: charlesjseitz@gmail.com
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: ConfigArgParse (==1.7)
14
+ Requires-Dist: astor (==0.8.1)
15
+ Requires-Dist: atheris (==2.3.0)
16
+ Requires-Dist: coverage (==7.6.4)
17
+ Requires-Dist: docker (>=7.1.0,<8.0.0)
18
+ Requires-Dist: klara (==0.6.3)
19
+ Requires-Dist: pygraphviz (>=1.14,<2.0)
20
+ Requires-Dist: pytest (>=8.3.5,<9.0.0)
21
+ Requires-Dist: staticfg (>=0.9.5,<0.10.0)
22
+ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
23
+ Requires-Dist: typed-ast (==1.5.5)
24
+ Requires-Dist: z3-solver (==4.13.3.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # TestGenie
28
+
29
+ **TestGenie** is an automated unit test generation tool for Python that supports multiple test generation strategies, including static AST analysis, fuzz testing, feedback-directed random testing, and reinforcement learning.
30
+ Built with a modular Pipe and Filter architecture, it analyzes Python source code to extract function metadata, generates meaningful test cases, and outputs executable test suites in formats like Unittest, PyTest, or Doctest.
31
+ The system can also measure and report code coverage and safely execute tests in Docker containers.
32
+ TestGenie aims to reduce manual testing effort, improve coverage, and explore the potential of learning-based approaches for optimizing test generation.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ Make sure you have **Python 3.10+** and **Poetry** installed.
39
+
40
+ Install dependencies:
41
+
42
+ ```bash
43
+ poetry install
44
+ ```
45
+
46
+ Activate the virtual environment:
47
+
48
+ ```bash
49
+ poetry shell
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Running the CLI
55
+
56
+ To invoke the test generator, run:
57
+
58
+ ```bash
59
+ poetry run python -m testgen.main <file_path> [options]
60
+ ```
61
+
62
+ **Required Argument:**
63
+ - `<file_path>`: Path to the Python module you want to analyze.
64
+
65
+ ---
66
+
67
+ ## Command-Line Options
68
+
69
+ | Command/Flag | Description |
70
+ |:---|:---|
71
+ | `--output, -o <path>` | Path to output directory for generated test files (default: `./tests`) |
72
+ | `--generate-only, -g` | Only generate test code, skip running tests and measuring coverage |
73
+ | `--test-mode <mode>` | Set the test analysis strategy: `ast` (default), `random`, `fuzz`, or `reinforce` |
74
+ | `--test-format <format>` | Set the test output format: `unittest` (default), `pytest`, or `doctest` |
75
+ | `--safe` | Run test generation inside a Docker container for isolation and safety |
76
+ | `--query, -q` | Query the database for test cases, coverage data, and test results for a specific file |
77
+ | `--db <db_path>` | Path to SQLite database file (default: `testgen.db`) |
78
+ | `--reinforce-mode <mode>` | Set mode for reinforcement learning: `train` (default) or `collect` |
79
+ | `--visualize, -viz` | Visualize generated test coverage graphs using Graphviz |
80
+ | `--debug` | Enable debug logging output |
81
+ | `--log-file <path>` | Save logs to the specified file instead of only printing to the console |
82
+
83
+ ---
84
+
85
+ ## Examples
86
+
87
+ Generate and run unit tests for a Python module:
88
+
89
+ ```bash
90
+ poetry run python -m testgen.main mymodule.py
91
+ ```
92
+
93
+ Generate tests using fuzzing strategy and output to a custom directory:
94
+
95
+ ```bash
96
+ poetry run python -m testgen.main mymodule.py --test-mode fuzz --output generated_tests/
97
+ ```
98
+
99
+ Run reinforcement learning-based test generation:
100
+
101
+ ```bash
102
+ poetry run python -m testgen.main mymodule.py --test-mode reinforce
103
+ ```
104
+
105
+ Query previously generated test results from the database:
106
+
107
+ ```bash
108
+ poetry run python -m testgen.main mymodule.py --query
109
+ ```
110
+
111
+ Safely generate tests inside a Docker container:
112
+
113
+ ```bash
114
+ poetry run python -m testgen.main mymodule.py --safe
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Features
120
+ - Static analysis using Python AST
121
+ - Fuzz testing using randomized input generation
122
+ - Feedback-directed random testing
123
+ - Reinforcement learning-based test case optimization
124
+ - Supports Unittest, PyTest, and Doctest formats
125
+ - Code coverage measurement and reporting
126
+ - Docker sandboxing for safe test execution
127
+ - SQLite database integration for tracking tests and results
128
+ - CLI visualization of test coverage graphs
129
+
130
+ ---
131
+
132
+ ## Requirements
133
+
134
+ - Python 3.10+
135
+ - Poetry
136
+ - (Optional) Docker (for safe mode execution)
137
+
138
+ ---
139
+
@@ -61,7 +61,7 @@ testgen/util/z3_utils/branch_condition.py,sha256=N9FNR-iJmxIC62NpDQNVZ1OP14rXXqY
61
61
  testgen/util/z3_utils/constraint_extractor.py,sha256=RXJLpmk6dAvHZ27839VXKXNtdy9St1F-17-pSEFu4bM,1285
62
62
  testgen/util/z3_utils/variable_finder.py,sha256=dUh3F9_L_BDMz1ybiGss09LLcM_egbitgj0FT5Nh9u4,245
63
63
  testgen/util/z3_utils/z3_test_case.py,sha256=yF4oJOrXMLzOwDUqXdoeg83MOTl3pvc_lYaZcS01CuQ,4983
64
- testgenie_py-0.2.2.dist-info/METADATA,sha256=gqB_l7Y9ELHsTmydKcJDaTeVKbEmgNltEhL7Si0Ll18,885
65
- testgenie_py-0.2.2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
66
- testgenie_py-0.2.2.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
67
- testgenie_py-0.2.2.dist-info/RECORD,,
64
+ testgenie_py-0.2.3.dist-info/METADATA,sha256=2-QroI89cQjovRoy2sgGDE1KiNVX4na87b-9K-35jck,4350
65
+ testgenie_py-0.2.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
66
+ testgenie_py-0.2.3.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
67
+ testgenie_py-0.2.3.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: testgenie-py
3
- Version: 0.2.2
4
- Summary:
5
- Author: cjseitz
6
- Author-email: charlesjseitz@gmail.com
7
- Requires-Python: >=3.10,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.10
10
- Classifier: Programming Language :: Python :: 3.11
11
- Classifier: Programming Language :: Python :: 3.12
12
- Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: ConfigArgParse (==1.7)
14
- Requires-Dist: astor (==0.8.1)
15
- Requires-Dist: atheris (==2.3.0)
16
- Requires-Dist: coverage (==7.6.4)
17
- Requires-Dist: docker (>=7.1.0,<8.0.0)
18
- Requires-Dist: klara (==0.6.3)
19
- Requires-Dist: pygraphviz (>=1.14,<2.0)
20
- Requires-Dist: pytest (>=8.3.5,<9.0.0)
21
- Requires-Dist: staticfg (>=0.9.5,<0.10.0)
22
- Requires-Dist: tabulate (>=0.9.0,<0.10.0)
23
- Requires-Dist: typed-ast (==1.5.5)
24
- Requires-Dist: z3-solver (==4.13.3.0)
25
- Description-Content-Type: text/markdown
26
-
27
-