Commit graph

6497 commits

Author SHA1 Message Date
afik.cohen
e5adbc552b Add new FunctionInvocation dataclass for test results and use it throughout parsing and testing 2023-10-24 17:10:53 -07:00
afik.cohen
09b28d9d82 Parse test results and timing results from xmlrunner XML 2023-10-23 16:14:17 -07:00
afik.cohen
7606358f43 Use xmlrunner to save test results, and etree to read them back 2023-10-23 16:07:28 -07:00
afik.cohen
31d6c562d7 Added bubble sort implementation and unit tests for it, refactored argument name "--tests-root" to "--test-root", and made some minor code improvements. 2023-10-23 15:09:27 -07:00
afik.cohen
d9e487ebe9 Added a new workflow file for optimization, added a new math utility file, and made changes to the function context module to include type annotations in the context. 2023-10-22 23:05:52 -07:00
afik.cohen
0848e9b4f2 Get all function names and add sqlalchemy utils 2023-10-22 22:54:02 -07:00
afik.cohen
67b9053074 Add tests for code replacement/comparator 2023-10-22 22:45:54 -07:00
afik.cohen
5eb41961d7 Refactored code to support Python version < 3.9. 2023-10-22 22:37:09 -07:00
afik.cohen
a86b22595b Add comparator function to handle additional types and added support for numpy arrays 2023-10-22 22:23:30 -07:00
afik.cohen
9c3fb0c296 Generate and merge inspired unit tests 2023-10-22 22:21:07 -07:00
afik.cohen
7d860d6678 Fix node visitor 2023-10-22 22:14:54 -07:00
afik.cohen
ccd173cff4 Inject profiling into existing test with the given function name and root path. 2023-10-22 22:08:36 -07:00
afik.cohen
907dde6a1f Parse config file to find the pyproject.toml file, and modified main.py to parse command line arguments and use the parse_config_file function to get the project root and test root directories. 2023-10-22 22:02:18 -07:00
afik.cohen
a9917be937 Dynamically determine the number of times to run the tests based on the runtime of the tests. 2023-10-22 21:59:04 -07:00
afik.cohen
c50c9c5356 Inject perf/instrumentation for generated tests 2023-10-22 21:48:40 -07:00
afik.cohen
6158c38c02 Added a flag to track if at least one optimization was found, and added a cleanup step to remove test files if no optimizations were found. 2023-10-22 20:14:38 -07:00
afik.cohen
ffc3877770 Optimized code and added a minimum improvement threshold for runtime. 2023-10-22 20:10:47 -07:00
afik.cohen
783f6b66a6 Refactor verification_utils to add a function for parsing test return values from a binary file. 2023-10-22 18:27:58 -07:00
afik.cohen
78c6e494cc Add tests for get_code 2023-10-22 17:02:43 -07:00
afik.cohen
fd7002235b Add unittest discovery and instrumentation 2023-10-22 13:45:41 -07:00
afik.cohen
80dfb25d5d Constrain function context token length 2023-10-22 13:03:15 -07:00
afik.cohen
03d0c8e41a Add instrumentation for generated tests 2023-10-22 12:37:39 -07:00
afik.cohen
69b9b6842e Refactor get_git_diff function to include uncommitted changes as an optional parameter. 2023-10-20 19:15:23 -07:00
afik.cohen
9c6c24440d Add code replacer via libcst 2023-10-20 18:31:24 -07:00
afik.cohen
bb34411a04 Update deps & authors 2023-10-20 18:26:25 -07:00
afik.cohen
89e56d2c7b Add optimizer and print 2023-10-20 18:14:06 -07:00
afik.cohen
439d6618fc Refactored main function to limit the maximum time for running generated tests. 2023-10-20 18:11:10 -07:00
afik.cohen
ce7f53c363 Remove unused kwarg for diffing 2023-10-20 17:15:25 -07:00
afik.cohen
b6491df6aa Added test runner to run unit tests for generated code. 2023-10-20 17:00:50 -07:00
afik.cohen
d13c8715b1 Print optimized function for testing 2023-10-20 16:53:28 -07:00
afik.cohen
068bf4d153 Added a new function to generate a test file path based on function name and iteration. 2023-10-20 16:50:18 -07:00
afik.cohen
21fade5a34 Reformat 2023-10-20 16:46:31 -07:00
afik.cohen
e34c7c583f Added code to generate regression tests from a given function. 2023-10-20 16:45:03 -07:00
afik.cohen
036a6d8fa7 Add optimization package 2023-10-20 16:23:14 -07:00
afik.cohen
ad73a1bebe Added a new module for function context and modified the main script to use it to get function dependencies. 2023-10-20 16:22:27 -07:00
afik.cohen
10fc72c5ab Move code extractor to code utils package 2023-10-20 16:18:03 -07:00
afik.cohen
d4c46c9d3a Refactor main.py to include unit test discovery. 2023-10-20 16:05:21 -07:00
afik.cohen
bf4edfbbe2 Refactor get_functions_to_optimize to return all files and functions if optimize_all is True. 2023-10-20 15:58:29 -07:00
afik.cohen
2e8559092a Add libcst 2023-10-20 15:57:16 -07:00
afik.cohen
e9c38637cb Refactor get_git_diff function to remove unnecessary parameter and simplify code. 2023-10-20 15:49:12 -07:00
afik.cohen
8348d423da Get git diffs programmatically 2023-10-20 15:46:09 -07:00
afik.cohen
ebac82196c Add discovery of functions to optimize and main entrypoint 2023-10-19 21:17:00 -07:00
afik.cohen
2645a19be0 Add code extractor for functions/classes 2023-10-19 20:50:57 -07:00
afik.cohen
c9ed4cd1b6 Init poetry env 2023-10-19 20:01:34 -07:00
afik.cohen
be44463b57 verifier script from https://github.com/openai/openai-cookbook/blob/main/examples/Unit_test_writing_using_a_multi-step_prompt.ipynb 2023-10-19 20:00:25 -07:00
afik.cohen
e771a49922 Commit optimizer for single function 2023-10-19 17:16:52 -07:00
Afik
0a02774a8d
Initial commit 2023-10-18 16:19:56 -07:00