Lune

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • TOGA: A Neural Method for Test Oracle Generation cites On learning meaningful assert statements for unit test cases
  • exLong: Generating Exceptional Behavior Tests with Large Language Models cites TOGA: A Neural Method for Test Oracle Generation
  • exLong: Generating Exceptional Behavior Tests with Large Language Models cites On learning meaningful assert statements for unit test cases
  • exLong: Generating Exceptional Behavior Tests with Large Language Models cites Learning Deep Semantics for Test Completion
  • Automated Assertion Generation via Information Retrieval and Its Integration with Deep learning cites On learning meaningful assert statements for unit test cases
  • Learning Deep Semantics for Test Completion cites TOGA: A Neural Method for Test Oracle Generation
  • Learning Deep Semantics for Test Completion cites On learning meaningful assert statements for unit test cases
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

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

Builds on7

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

Related papers

  1. Block TestsKevin Guan, Pengyue Jiang, Milos Gligoric, Owolabi LegunsenOOPSLA 2026
  2. Inline TestsYu Liu, Pengyu Nie, Owolabi Legunsen, Milos GligoricASE 2022 · 10 citations
  3. State Field Coverage: A Metric for Oracle QualityFacundo Molina, Nazareno Aguirre, Alessandra GorlaASE 2025 · 1 citation
  4. MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic TestingCongying Xu, Songqiang Chen, Jiarong Wu, Shing-Chi Cheung et al.ASE 2024 · 6 citations
  5. Perfect is the enemy of test oracleAli Reza Ibrahimzada, Yigit Varli, Dilara Tekinoglu, Reyhaneh JabbarvandFSE 2022 · 23 citations
Dusk over the sea between two cliffs drawn in fine vertical lines