The STUDIA UNIVERSITATIS BABEŞ-BOLYAI issue article summary

The summary of the selected article appears at the bottom of the page. In order to get back to the contents of the issue this article belongs to you have to access the link from the title. In order to see all the articles of the archive which have as author/co-author one of the authors mentioned below, you have to access the link from the author's name.

 
       
         
    STUDIA INFORMATICA - Issue no. 1 / 2018  
         
  Article:   COMPILE-TIME FUNCTION CALL INTERCEPTION FOR TESTING IN C/C++.

Authors:  G. MÁRTON, ZOLTÁN PORKOLÁB.
 
       
         
  Abstract:  
DOI: 10.24193/subbi.2018.1.02

Published Online: 2017-06-19
Published Print: 2017-06-25
pp. 17-32
VIEW PDF: Compile-Time Function Call Interception for Testing in C/C++

Abstract. In C/C++, during the test development process we often have to modify the public interface of a class to replace existing dependencies; e.g. supplementary setter or constructor functions or extra template parameters are added for dependency injection. These solutions may have serious detrimental effects on the code structure and sometimes on the run-time performance as well. We introduce a new technique that makes dependency replacement possible without the modification of the production code, thus it provides an alternative way to add unit tests. Our new compile-time instrumentation technique enables us to intercept function calls and replace them in runtime. Contrary to existing function call interception (FCI) methods, we instrument the call expression instead of the callee, thus we can avoid the modification and recompilation of the function in order to intercept the call. This has a clear advantage in case of system libraries and third party shared libraries, thus it provides an alternative way to automatize tests for legacy software. We created a prototype implementation based on the LLVM compiler infrastructure which is publicly available for testing.
2010 Mathematics Subject Classification. 68N15.
1998 CR Categories and Descriptors. D.3.3 [Software]: PROGRAMMING LANGUAGES { Languages Constructs and Features.
Key words and phrases. C++ programming language, unit testing, function call interception, compiler instrumentation.
 
         
     
         
         
      Back to previous page