Inline Tests
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
引用它的顶会 Paper1
它引用的 Paper3
- A study on the lifecycle of flaky testsWing Lam, Kivanç Muslu, Hitesh Sajnani, Suresh ThummalapentaICSE 2020 · 107 次引用
- No Strings Attached: An Empirical Study of String-related Software BugsAryaz Eghbali, Michael PradelASE 2020 · 17 次引用
- Unifying execution of imperative generators and declarative specificationsPengyu Nie, Marinela Parovic, Zhiqiang Zang, Sarfraz Khurshid 等OOPSLA 2020 · 7 次引用
相关 Paper
- Block TestsKevin Guan, Pengyue Jiang, Milos Gligoric, Owolabi LegunsenOOPSLA 2026
- Extracting Inline Tests from Unit TestsYu Liu, Pengyu Nie, Anna Guo, Milos Gligoric 等ISSTA 2023 · 7 次引用
- PyNose: A Test Smell Detector For PythonTongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li 等ASE 2021 · 44 次引用
- Improving Testing Behavior by Gamifying IntelliJPhilipp Straubinger, Gordon FraserICSE 2024 · 5 次引用
- Efficient Detection of Test Interference in C ProjectsFlorian Eder, Stefan WinterASE 2024 · 2 次引用
