2017
DOI: 10.14232/actacyb.23.2.2017.14
|View full text |Cite
|
Sign up to set email alerts
|

Unit Testing in C++ with Compiler Instrumentation and Friends

Abstract: In C++, test code is often interwoven with the unit we want to test. During the test development process we often have to modify the public interface of a class to replace existing dependencies; e.g. a supplementary setter or constructor function is added for dependency injection. In many cases, extra template parameters are used for the same purpose. All existing solutions have serious detrimental effects on the code structure and sometimes on the run-time performance as well. In this paper, we overview exist… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1
1

Citation Types

0
9
0

Year Published

2019
2019
2022
2022

Publication Types

Select...
2

Relationship

0
2

Authors

Journals

citations
Cited by 2 publications
(9 citation statements)
references
References 6 publications
(9 reference statements)
0
9
0
Order By: Relevance
“…Compared to existing compile-time instrumentation solutions, our technique does not require the modification or even the recompilation of the intercepted functions, which is a possible advantage in case of legacy code, system libraries, third-party shared libraries or in situations when we have to avoid library interposing. We have created a prototype implementation using the LLVM/Clang compiler infrastructure, which is publicly available at [14].…”
Section: Discussionmentioning
confidence: 99%
See 4 more Smart Citations
“…Compared to existing compile-time instrumentation solutions, our technique does not require the modification or even the recompilation of the intercepted functions, which is a possible advantage in case of legacy code, system libraries, third-party shared libraries or in situations when we have to avoid library interposing. We have created a prototype implementation using the LLVM/Clang compiler infrastructure, which is publicly available at [14].…”
Section: Discussionmentioning
confidence: 99%
“…These replacement functions behave as a proxy; they forward each function call on a given Turtle instance to a corresponding test double (lines [17][18][19][20][21][22]. The way we get the reference for a relevant test double is pretty simple in this test: we return a reference to a static instance of the MockTurtle class (lines [12][13][14][15]. We can use this simplification because we know that there is only one Turtle object over the lifetime of our test-case.…”
Section: Figure 25: a Legacy Graphics Programmentioning
confidence: 99%
See 3 more Smart Citations