Pragmatic source code reuse via execution record and replay. Issue 8 (10th May 2016) - Armaly, Ameer; McMillan, Collin
Abstract: A key problem during copy–paste source code reuse is that, to reuse even a small section of code from a program as opposed to an API, a programmer must include a huge amount of additional source code from elsewhere in the same program. This additional code is notoriously large and complex, and portions can only be identified at runtime. In this paper, we propose execution record/replay as a solution to this problem. We describe a novel reuse technique that allows programmers to reuse functions from a C or C++ program, by recording the execution of the program and selectively modifying how its functions are replayed. We have implemented our technique and evaluated it in an empirical study in which eight programmers used our tool to complete four tasks over four hours each. The participants found our technique to be easier than manually reusing the code as part of their project. We also found that the resulting code was smaller and less complex than it would have been had the participants manually reused the code. Copyright © 2016 John Wiley & Sons, Ltd. Abstract : Instead of copy‐pasting code into a new program, Flashback makes it possible to reuse functions from previously recorded executions. The two main advantages are (i) the new program can be made much smaller; and (ii) there is no need to port legacy code during reuse.