Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor UnitTestGenerator to split into Generator & Validator #170

Open
coderustic opened this issue Oct 5, 2024 · 0 comments
Open

Refactor UnitTestGenerator to split into Generator & Validator #170

coderustic opened this issue Oct 5, 2024 · 0 comments
Assignees
Labels
platform Underlying platform (code) changes refactor Refactoring the code to make it better

Comments

@coderustic
Copy link
Contributor

coderustic commented Oct 5, 2024

UnitTestGenerator has too much functionality. From generating tests to validating. We should decompose the class into two separate classes. Say UnitTestGenerator and UnitTestValidator.

Let the UnitTestGenerator continue to return the generated tests to CoverAgent and let CoverAgent iterate the generated tests one-by-one and validate them.

Also we could move run_coverage into a UnitTestValidator as the generator does not use the coverage. Ideally, running coverage + processing coverage could be split into separate class which then can be used across CoverAgent, initialization of Validator and also while validating each test, but that could be a different issue.

@EmbeddedDevops1 EmbeddedDevops1 added refactor Refactoring the code to make it better platform Underlying platform (code) changes labels Oct 6, 2024
coderustic added a commit to coderustic/cover-agent that referenced this issue Nov 10, 2024
Issue Codium-ai#170 aims to tackle the refactor of UnitTestGenerator and
this is an attempt to split UnitTestGenerator into generator and
validator. This PR is a first of a series of refactoring we can
apply to UnitTestGenerator.

* Created a new class `UnitTestValidator` by copying running,
  validating and processing coverage from `UnitTestGenerator`

* Doesn't include any cleanup or optimization and kept the PR
  to be minimal structural changes.

* Use prompt from UnitTestGenerator when storing a failed test
  into the database.
coderustic added a commit to coderustic/cover-agent that referenced this issue Nov 10, 2024
Issue Codium-ai#170 aims to tackle the refactor of UnitTestGenerator and
this is an attempt to split UnitTestGenerator into generator and
validator. This PR is a first of a series of refactoring we can
apply to UnitTestGenerator.

* Created a new class `UnitTestValidator` by copying running,
  validating and processing coverage from `UnitTestGenerator`

* Doesn't include any cleanup or optimization and kept the PR
  to be minimal structural changes.

* Use prompt from UnitTestGenerator when storing a failed test
  into the database.
EmbeddedDevops1 pushed a commit that referenced this issue Nov 10, 2024
Issue #170 aims to tackle the refactor of UnitTestGenerator and
this is an attempt to split UnitTestGenerator into generator and
validator. This PR is a first of a series of refactoring we can
apply to UnitTestGenerator.

* Created a new class `UnitTestValidator` by copying running,
  validating and processing coverage from `UnitTestGenerator`

* Doesn't include any cleanup or optimization and kept the PR
  to be minimal structural changes.

* Use prompt from UnitTestGenerator when storing a failed test
  into the database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Underlying platform (code) changes refactor Refactoring the code to make it better
Projects
Status: No status
Development

No branches or pull requests

2 participants