Abstract

In C/C++, during the test development process we often haveto modify the public interface of a class to replace existing dependencies;e.g. supplementary setter or constructor functions or extra template pa-rameters are added for dependency injection. These solutions may haveserious detrimental effects on the code structure and sometimes on therun-time performance as well. We introduce a new technique that makesdependency replacement possible without the modification of the produc-tion code, thus it provides an alternative way to add unit tests. Our newcompile-time instrumentation technique enables us to intercept functioncalls and replace them in runtime. Contrary to existing function call in-terception (FCI) methods, we instrument the call expression instead ofthe callee, thus we can avoid the modification and recompilation of thefunction in order to intercept the call. This has a clear advantage in caseof system libraries and third party shared libraries, thus it provides analternative way to automatize tests for legacy software. We created a pro-totype implementation based on the LLVM compiler infrastructure whichis publicly available for testing.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.