Understanding and Characterizing Mock Assertions in Unit Tests
Mock assertions provide developers with a powerful means to validate program behaviors that are unobservable to test assertions. Despite their significance, they are rarely considered by automated test generation techniques. Effective generation of mock assertions requires understanding how they are used in practice. Although previous studies highlighted the importance of mock assertions, none provide insight into their usages. To bridge this gap, we conducted the first empirical study on mock assertions, examining their adoption, the characteristics of the verified method invocations, and their effectiveness in fault detection. Our analysis of 4,652 test cases from 11 popular Java projects reveals that mock assertions are mostly applied to validating specific kinds of method calls, such as those interacting with external resources and those reflecting whether a certain code path was traversed in systems under test. Additionally, we find that mock assertions complement traditional test assertions by ensuring the desired side effects have been produced, validating control flow logic, and checking internal computation results. Our findings contribute to a better understanding of mock assertion usages and provide a foundation for future related research such as automated test generation that support mock assertions.
Wed 25 JunDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
11:00 - 12:30 | Software TestsJournal First / Demonstrations / Research Papers at Pirsenteret 150 Chair(s): Tien N. Nguyen University of Texas at Dallas | ||
11:00 10mTalk | pytest-ranking: A Regression Test Prioritization Tool for Python Demonstrations Runxiang Cheng University of Illinois at Urbana-Champaign, Kaiyao Ke University of Illinois Urbana-Champaign, Darko Marinov University of Illinois at Urbana-Champaign | ||
11:10 20mTalk | The Effects of Computational Resources on Flaky Tests Journal First Denini Silva Federal University of Pernambuco, Martin Gruber BMW Group, Satyajit Gokhale Northeastern University, Ellen Arteca Northeastern University, Alexi Turcotte CISPA, Marcelo d'Amorim North Carolina State University, Wing Lam George Mason University, Stefan Winter LMU Munich, Jonathan Bell Northeastern University DOI File Attached | ||
11:30 20mTalk | Prioritizing Speech Test Cases Journal First Zhou Yang Singapore Management University; University of Alberta, Jieke Shi Singapore Management University, Muhammad Hilmi Asyrofi School of Computing and Information Systems, Singapore Management University, Bowen Xu North Carolina State University, Xin Zhou Singapore Management University, Singapore, DongGyun Han Royal Holloway, University of London, David Lo Singapore Management University | ||
11:50 20mTalk | Automated Unit Test Refactoring Research Papers Yi Gao Zhejiang University, Xing Hu Zhejiang University, Xiaohu Yang Zhejiang University, Xin Xia Zhejiang University DOI | ||
12:10 20mTalk | Understanding and Characterizing Mock Assertions in Unit Tests Research Papers Hengcheng Zhu The Hong Kong University of Science and Technology, Valerio Terragni University of Auckland, Lili Wei McGill University, Shing-Chi Cheung Hong Kong University of Science and Technology, Jiarong Wu , Yepang Liu Southern University of Science and Technology DOI Pre-print |
This room is located outside Clarion Hotel
This room is located in the Pirsenteret (The Pier Center) convention center. It is just outside the hotel, on the back, towards the fjord.
You should be able to go through the emergency exit at Clarion, just on the side of the Cosmos 3 wing, which will be bring you close to Pirsenteret.
The entrance to the center is from here:
https://maps.app.goo.gl/dU3qH6kAimXGBNHe7
Once inside, go all straight and you will find signage to reach the room. The room is known as room 150 inside the center.