< Back to previous page


Test transplantation through dynamic test slicing

Book Contribution - Book Abstract Conference Contribution

Previous research has demonstrated that the test coverage of libraries can be expanded by using existing test inputs from their dependent projects. In this paper, we propose an algorithm for test transplantation based on test slicing. The algorithm extracts test inputs, isolates them by creating mocks, and then transplants the test code onto the test suite of the libraries. To achieve test slicing, we dynamically execute the tests in the dependent project and create its graph of histories. Then, we traverse back from the interesting object state and collect the corresponding edges. Finally, we reverse the collected edges and create a sequence of method calls to reconstruct the same object state. We have implemented a proof-of-concept in Pharo-Smalltalk, in this paper we discuss the lessons learned so far.
Book: 2022 IEEE 22nd International Working Conference on Source Code Analysis and Manipulation (SCAM), 03 October 2022, Limassol, Cyprus
Pages: 35 - 39
Keywords:P1 Proceeding