Unit testing in C++ with compiler instrumentation and friends

Márton Gábor; Porkoláb Zoltán: Unit testing in C++ with compiler instrumentation and friends. In: Acta cybernetica, (23) 2. pp. 659-686. (2017)

[thumbnail of actacyb_23_2_2017_14.pdf]
Előnézet
Cikk, tanulmány, mű
actacyb_23_2_2017_14.pdf

Letöltés (461kB) | Előnézet

Absztrakt (kivonat)

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 existing dependency replacement techniques of C++ and we evaluate their advantages and disadvantages. We introduce our non-intrusive, compiler instrumentation based testing approach that does not have such disadvantages. All non-intrusive testing methods (including our new method) require access to an object’s internal state in order to setup a test. Thus, to complement our new solution, we also present different approaches to conveniently access private members in C++. To evaluate these techniques, we created a proof-of-concept implementation which is publicly available for further testing.

Mű típusa: Cikk, tanulmány, mű
Befoglaló folyóirat/kiadvány címe: Acta cybernetica
Dátum: 2017
Kötet: 23
Szám: 2
ISSN: 0324-721X
Oldalak: pp. 659-686
Nyelv: angol
Kiadás helye: Szeged
Befoglaló mű URL: http://acta.bibl.u-szeged.hu/50022/
DOI: 10.14232/actacyb.23.2.2017.14
Kulcsszavak: Programozási nyelv - C++, Informatika, Számítástechnika
Megjegyzések: Bibliogr.: p. 683-686. ; összefoglalás angol nyelven
Szakterület: 01. Természettudományok
01. Természettudományok > 01.02. Számítás- és információtudomány
Feltöltés dátuma: 2018. feb. 13. 10:39
Utolsó módosítás: 2022. jún. 20. 15:27
URI: http://acta.bibl.u-szeged.hu/id/eprint/50094
Bővebben:
Tétel nézet Tétel nézet