Yu Liu's research while affiliated with University of Texas at Austin and other places

What is this page?


This page lists the scientific contributions of an author, who either does not have a ResearchGate profile, or has not yet added these contributions to their profile.

It was automatically created by ResearchGate to create a record of this author's body of work. We create such pages to advance our goal of creating and maintaining the most comprehensive scientific repository possible. In doing so, we process publicly available (personal) data relating to the author as a member of the scientific community.

If you're a ResearchGate member, you can follow this page to keep up with this author's work.

If you are this author, and you don't want us to display this page anymore, please let us know.

Publications (8)


Generating Exceptional Behavior Tests with Reasoning Augmented Large Language Models
  • Preprint
  • File available

May 2024

·

1 Read

·

Yu Liu

·

Pengyu Nie

·

[...]

·

Milos Gligoric

Many popular programming languages, including C#, Java, and Python, support exceptions. Exceptions are thrown during program execution if an unwanted event happens, e.g., a method is invoked with an illegal argument value. Software developers write exceptional behavior tests (EBTs) to check that their code detects unwanted events and throws appropriate exceptions. Prior research studies have shown the importance of EBTs, but those studies also highlighted that developers put most of their efforts on "happy paths", e.g., paths without unwanted events. To help developers fill the gap, we present the first framework, dubbed EXLONG, that automatically generates EBTs. EXLONG is a large language model instruction-tuned from CodeLlama and embeds reasoning about traces that lead to throw statements, conditional expressions that guard throw statements, and non-exceptional behavior tests that execute similar traces. We compare EXLONG with the state-of-the-art models for test generation (CAT-LM) and one of the strongest foundation models (GPT3.5), as well as with analysis-based tools for test generation (Randoop and EvoSuite). Our results show that EXLONG outperforms existing models and tools. Furthermore, we contributed several pull requests to open-source projects and 23 EBTs generated by EXLONG were already accepted.

Download
Share



pytest-inline: An Inline Testing Tool for Python

May 2023

·

37 Reads

We present pytest-inline, the first inline testing framework for Python. We recently proposed inline tests to make it easier to test individual program statements. But, there is no framework-level support for developers to write inline tests in Python. To fill this gap, we design and implement pytest-inline as a plugin for pytest, the most popular Python testing framework. Using pytest-inline, a developer can write an inline test by assigning test inputs to variables in a target statement and specifying the expected test output. Then, pytest-inline runs each inline test and fails if the target statement's output does not match the expected output. In this paper, we describe our design of pytest-inline, the testing features that it provides, and the intended use cases. Our evaluation on inline tests that we wrote for 80 target statements from 31 open-source Python projects shows that using pytest-inline incurs negligible overhead, at 0.012x. pytest-inline is integrated into the pytest-dev organization, and a video demo is at https://www.youtube.com/watch?v=pZgiAxR_uJg.




Inline Tests

September 2022

·

9 Reads

Unit tests are widely used to check source code quality, but they can be too coarse-grained or ill-suited for testing individual program statements. We introduce inline tests to make it easier to check for faults in statements. We motivate inline tests through several language features and a common testing scenario in which inline tests could be beneficial. For example, inline tests can allow a developer to test a regular expression in place. We also define language-agnostic requirements for inline testing frameworks. Lastly, we implement I-Test, the first inline testing framework. I-Test works for Python and Java, and it satisfies most of the requirements. We evaluate I-Test on open-source projects by using it to test 144 statements in 31 Python programs and 37 Java programs. We also perform a user study. All nine user study participants say that inline tests are easy to write and that inline testing is beneficial. The cost of running inline tests is negligible, at 0.007x--0.014x, and our inline tests helped find two faults that have been fixed by the developers.


Citations (3)


... Second, memory infection at either the infection or propagation observation point could potentially help inform new test cases. This can be achieved by introducing source-code oracles [16], inline tests [29,30], using mocking frameworks to monitor the behavior of the object under test, or by creating a new test case that replicates the arguments passed into the mutated method with new assertions. ...

Reference:

Ripples of a Mutation — An Empirical Study of Propagation Effects in Mutation Testing
Extracting Inline Tests from Unit Tests
  • Citing Conference Paper
  • July 2023

... Second, memory infection at either the infection or propagation observation point could potentially help inform new test cases. This can be achieved by introducing source-code oracles [16], inline tests [29,30], using mocking frameworks to monitor the behavior of the object under test, or by creating a new test case that replicates the arguments passed into the mutated method with new assertions. ...

Inline Tests
  • Citing Conference Paper
  • January 2023

... The total time to run all inline tests is almost constant when we duplicate each inline test 10 or 100 times, but that time grows greatly when we duplicate 1000 times. This dramatic growth suggests that regression testing techniques [7], [9], [15], [16], [29] will be needed to reduce inline testing costs. pytest-inline can be the basis on which to build those regression testing techniques. ...

Comparing and combining analysis-based and learning-based regression test selection
  • Citing Conference Paper
  • July 2022