Lune

ISSTA2023顶会

Extracting Inline Tests from Unit Tests

Yu Liu, Pengyu Nie, Anna Guo, Milos Gligoric, Owolabi Legunsen

摘要

We recently proposed inline tests for validating individual program statements; they allow developers to provide test inputs, expected outputs, and test oracles immediately after a target statement. But, existing code can have many target statements. So, automatic generation of inline tests is an important next step towards increasing their adoption. We propose ExLi, the first technique for automatically generating inline tests. ExLi extracts inline tests from unit tests; it first records all variable values at a target statement while executing unit tests. Then, ExLi uses those values as test inputs and test oracles in an initial set of generated inline tests. Target statements that are executed many times could have redundant initial inline tests. So, ExLi uses a novel coverage-then-mutants based reduction process to remove redundant inline tests. We implement ExLi for Java and use it to generate inline tests for 718 target statements in 31 open-source programs. ExLi reduces 17,273 initially generated inline tests to 905 inline tests. The final set of generated inline tests kills up to 25.1% more mutants on target statements than developer written and automatically generated unit tests. That is, ExLi generates inline tests that can improve the fault-detection capability of the test suites from which they are extracted.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • TOGA: A Neural Method for Test Oracle Generation 引用了 On learning meaningful assert statements for unit test cases
  • exLong: Generating Exceptional Behavior Tests with Large Language Models 引用了 TOGA: A Neural Method for Test Oracle Generation
  • exLong: Generating Exceptional Behavior Tests with Large Language Models 引用了 On learning meaningful assert statements for unit test cases
  • exLong: Generating Exceptional Behavior Tests with Large Language Models 引用了 Learning Deep Semantics for Test Completion
  • Automated Assertion Generation via Information Retrieval and Its Integration with Deep learning 引用了 On learning meaningful assert statements for unit test cases
  • Learning Deep Semantics for Test Completion 引用了 TOGA: A Neural Method for Test Oracle Generation
  • Learning Deep Semantics for Test Completion 引用了 On learning meaningful assert statements for unit test cases
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Ripples of a Mutation - An Empirical Study of Propagation Effects in Mutation TestingHang Du, Vijay Krishna Palepu, James A. JonesICSE 2024 · 6 次引用
  2. exLong: Generating Exceptional Behavior Tests with Large Language ModelsJiyang Zhang, Yu Liu, Pengyu Nie, Junyi Jessy Li 等ICSE 2025 · 2 次引用

它引用的 Paper7

  1. On learning meaningful assert statements for unit test casesCody Watson, Michele Tufano, Kevin Moran, Gabriele Bavota 等ICSE 2020 · 96 次引用
  2. TOGA: A Neural Method for Test Oracle GenerationElizabeth Dinella, Gabriel Ryan, Todd Mytkowicz, Shuvendu K. LahiriICSE 2022 · 92 次引用
  3. Revisiting the Relationship Between Fault Detection, Test Adequacy Criteria, and Test Set SizeYiqun T. Chen, Rahul Gopinath, Anita Tadakamalla, Michael D. Ernst 等ASE 2020 · 48 次引用
  4. Learning Deep Semantics for Test CompletionPengyu Nie, Rahul Banerjee, Junyi Jessy Li, Raymond J. Mooney 等ICSE 2023 · 45 次引用
  5. Automated Assertion Generation via Information Retrieval and Its Integration with Deep learningHao Yu, Yiling Lou, Ke Sun, Dezhi Ran 等ICSE 2022 · 42 次引用

相关 Paper

  1. Block TestsKevin Guan, Pengyue Jiang, Milos Gligoric, Owolabi LegunsenOOPSLA 2026
  2. Inline TestsYu Liu, Pengyu Nie, Owolabi Legunsen, Milos GligoricASE 2022 · 10 次引用
  3. State Field Coverage: A Metric for Oracle QualityFacundo Molina, Nazareno Aguirre, Alessandra GorlaASE 2025 · 1 次引用
  4. MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic TestingCongying Xu, Songqiang Chen, Jiarong Wu, Shing-Chi Cheung 等ASE 2024 · 6 次引用
  5. Perfect is the enemy of test oracleAli Reza Ibrahimzada, Yigit Varli, Dilara Tekinoglu, Reyhaneh JabbarvandFSE 2022 · 23 次引用
黄昏的海面,两侧是细线勾勒的悬崖