On the Validated Usage of the C++ Standard Template Library

The C++ Standard Template Library (STL) is the most well-known and widely used library that is based on the generic programming paradigm. The STL takes advantage of C++ templates, so it is an extensible, effective but flexible system. Professional C++ programs cannot miss the usage of the STL because it increases quality, maintainability, understandability and efficacy of the code. However, the usage of C++ STL does not guarantee error-free code. Contrarily, incorrect application of the library may introduce new types of problems. Unfortunately, there is still a large number of properties that are tested neither at compilation-time nor at runtime. It is not surprising that in implementation of C++ programs so many STL-related bugs may occur. It is clearly seen that the compilation validation is not sophisticated enough to detect subtle misusages of this library. In this paper, we propose different approaches for the validation of the C++ STL's usage. We take advantage of aspect-oriented programming paradigm, metaprogramming techniques, static analysis, and automated debugging tool as well. We compare the presented approaches comprehensively, the pros and cons of these techniques are considered, evaluated and highlighted.

[1]  Norbert Pataki,et al.  Static Analysis Toolset with Clang , 2018 .

[2]  Bruno Cardoso Lopes,et al.  Getting Started with LLVM Core Libraries , 2014 .

[3]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[4]  Matthew H. Austern Generic programming and the STL - using and extending the C++ standard template library , 1999, Addison-Wesley professional computing series.

[5]  Andrei Alexandrescu,et al.  Modern C++ design: generic programming and design patterns applied , 2001 .

[6]  Norbert Pataki SAFE ITERATOR FRAMEWORK FOR THE C++ STANDARD TEMPLATE LIBRARY , 2012 .

[7]  Hiromasa Shin,et al.  ARVE: Aspect-Oriented Runtime Verification Environment , 2007, RV.

[8]  Bjarne Stroustrup,et al.  Runtime concepts for the C++ standard template library , 2008, SAC '08.

[9]  Zoltán Porkoláb Functional Programming with C++ Template Metaprograms , 2009, CEFP.

[10]  Gábor Horváth,et al.  Detecting Misusages of the C++ Standard Template Library , 2018 .

[11]  Norbert Pataki,et al.  Analysis of Include Dependencies in C++ Source Code , 2017, FedCSIS.

[12]  Norbert Pataki,et al.  Measuring the Overhead of C++ Standard Template Library Safe Variants , 2011, Electron. Notes Theor. Comput. Sci..

[13]  Norbert Pataki COMPILE-TIME ADVANCES OF THE C++ STANDARD TEMPLATE LIBRARY , 2012 .

[14]  Mads Torgersen The Expression Problem Revisited , 2004, ECOOP.

[15]  Bjarne Stroustrup,et al.  The C++ programming language (3. ed.) , 1997 .

[16]  Leor Zolman An STL message decryptor for visual C , 2001 .

[17]  Zoltán Porkoláb,et al.  Towards a General Template Introspection Library , 2004, GPCE.

[18]  Norbert Pataki,et al.  Clang matchers for verified usage of the C++ Standard Template Library , 2015 .

[19]  Norbert Pataki,et al.  Source language representation of function summaries in static analysis , 2016, ICOOOLPS@ECOOP.

[20]  Olaf Spinczyk,et al.  The design and implementation of AspectC++ , 2007, Knowl. Based Syst..

[21]  Mads Torgersen The expression problem revisited: Four new solutions using generics , 2004 .

[22]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[23]  Norbert Pataki ADVANCED FUNCTOR FRAMEWORK FOR C++ STANDARD TEMPLATE LIBRARY , 2011 .

[24]  Norbert Pataki,et al.  Extension of iterator traits in the C++ Standard Template Library , 2011, 2011 Federated Conference on Computer Science and Information Systems (FedCSIS).

[25]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.