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

Assert generation quick example #1

Open
jose opened this issue Mar 11, 2023 · 2 comments
Open

Assert generation quick example #1

jose opened this issue Mar 11, 2023 · 2 comments

Comments

@jose
Copy link

jose commented Mar 11, 2023

Hi @pengyunie,

Thanks for sharing this repository and congratulations for your ICSE'23 paper.

Any chance you could provide a quick example on how to generate assert statements for an assertless test case using TECO? I'm not interesting in training, fine-tuning, or evaluating TECO or any model as you did in the paper. I would like to just use TECO from a developer / end-user point of view. Any source code on how to instantiate and use TECO's model would be much appreciated.

For instance, assuming I have the following method under test in the Foo class

public int sum(int a, int b) {
    return a + b;
}

and the following assertless test case

@Test
public void testSumOfNegativeValue() {
    Foo foo = new Foo();
    int sum = foo.sum(3, -2);
    // Missing assert or perhaps any other code
}

how would one use TECO to generate the missing code, i.e., any missing assert statement?

Thanks in advance.

--
Best,
Jose

@jose
Copy link
Author

jose commented Mar 14, 2023

Kinda related, @pengyunie, could you please share the full TeCo model that one might get if he/she manages to follow all the steps described in the README.md file? Unfortunately, not all of us have access to 4 GTX 1080Ti GPUs and training the model on a CPU would take ages.

@neelofarhassan
Copy link

Hi, The trained model is available at https://huggingface.co/EngineeringSoftware/teco

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

No branches or pull requests

2 participants