Skip to content

Assert generation quick example #1

@jose

Description

@jose

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions