Unit testing in C++ with compiler instrumentation and friends

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, ext...

Teljes leírás

Elmentve itt :
Bibliográfiai részletek
Szerzők: Márton Gábor
Porkoláb Zoltán
Dokumentumtípus: Cikk
Megjelent: 2017
Sorozat:Acta cybernetica 23 No. 2
Kulcsszavak:Programozási nyelv - C++, Informatika, Számítástechnika
Tárgyszavak:
doi:10.14232/actacyb.23.2.2017.14

Online Access:http://acta.bibl.u-szeged.hu/50094
LEADER 01966nab a2200241 i 4500
001 acta50094
005 20220620152747.0
008 180213s2017 hu o 0|| eng d
022 |a 0324-721X 
024 7 |a 10.14232/actacyb.23.2.2017.14  |2 doi 
040 |a SZTE Egyetemi Kiadványok Repozitórium  |b hun 
041 |a eng 
100 1 |a Márton Gábor 
245 1 0 |a Unit testing in C++ with compiler instrumentation and friends  |h [elektronikus dokumentum] /  |c  Márton Gábor 
260 |c 2017 
300 |a 659-686 
490 0 |a Acta cybernetica  |v 23 No. 2 
520 3 |a 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. 
650 4 |a Természettudományok 
650 4 |a Számítás- és információtudomány 
695 |a Programozási nyelv - C++, Informatika, Számítástechnika 
700 0 1 |a Porkoláb Zoltán  |e aut 
856 4 0 |u http://acta.bibl.u-szeged.hu/50094/1/actacyb_23_2_2017_14.pdf  |z Dokumentum-elérés