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

Generate test cases #111

Open
johnfercher opened this issue Nov 8, 2019 · 3 comments
Open

Generate test cases #111

johnfercher opened this issue Nov 8, 2019 · 3 comments

Comments

@johnfercher
Copy link

First of all, very nice your project. I would like to contribute too, and I have some questions.

Do you have plans to generate the test cases too? Would be difficult to do it?

Do you have plans to generate separated test functions instead of the table style?

@cweill cweill assigned cweill and unassigned cweill Nov 10, 2019
@cweill
Copy link
Owner

cweill commented Nov 10, 2019

@johnfercher Thank you for your kind words. Unfortunately, these days I mostly write Python, so you likely are getting more use out of this project than I am. Nevertheless, I'm happy to answer your questions:

Do you have plans to generate the test cases too? Would be difficult to do it?

I believe that generating test cases is more difficult than generating the test boilerplate. The latter can be done deterministically by parsing a method-under-test's signature and building its AST, then writing the boilerplate from it. Conversely, the former requires understanding the code being tested, and I'm not sure how you would do that in a way that isn't terribly complex.

If you have any suggestions, I'm open to hearing them. :)

Do you have plans to generate separated test functions instead of the table style?

The table-driven style is the one that the Go-team recommends. Of course, if you think it would be better to have a non-table-driven style, I'll accept a PR for that.

@Pissssofshit
Copy link

First of all, very nice your project. I would like to contribute too, and I have some questions.

Do you have plans to generate the test cases too? Would be difficult to do it?

Do you have plans to generate separated test functions instead of the table style?

Do you got any idea of how to generate the test case ? I'm very curious about that.

@cweill
Copy link
Owner

cweill commented Dec 26, 2020

The long-term vision for this project is for it to generate test code, including test cases, for you automatically based on the signature and high level description.

With OpenAI's recent release of GPT-3 on May 2020 which can generate high quality code that actually compiles, generating Golang test cases may actually be feasible! Here are some repos that use GPT-3 to generate code.

If anyone has ML expertise, and is looking for a cool project, I think this has a ton of potential. I just wish I had the cycles to work on it myself...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants