PduApi  0.0.1.0
PduApi - Toolbox
Quality

Quality has different aspects:

  • Quality by tests
  • Quality of Source Code

Quality by tests

PduApi uses google-test to evaluate unit tests, functional tests and system tests. The complete tests are part of the build process and will be done before commit/checkin.

Quality of Source Code

Quality by Coverage of Source Code

The Coverage of the Source code by tests is XX%.

Quality by compiling options

Quality of Source Code is improved by compiling with following GCC Options which show all warnings and handles them like an error:

  • -Wall
  • -Wpedantic
  • -Werror
  • -pedantic-errors
  • -Werror=pedantic
  • -Wshadow

Exception from warning compile flags (point of discussions):

  • -Wno-vla ( Variable Length Arrays are used, because stack is quicker than using heap )

Exception from warning compile flags to follwing source codes:

  • all test-routines
  • pduapi_dissector ( #include C-Source code from wireshark produces warnings )

Quality by coding style

PduApi preferes using C++11 rvalues to lvalues. This reduces memory fragmentation, which speeds up the complete application.

PduApi has not a single polling. All worker-threads are controlled by handshaking.

PduApi uses as much as possible std::<container>::reserve and std::<container>::emplace. This avoids unneeded memory allocations and unneeded copy of objects. Result is automatically a reduction of memory fragmentation.

Memory safty

PduApi has almost no pointer and new statements inside. It uses the new variadic template features of C++x11 and above:

  • std::shared_ptr, std::weak_ptr, std::unique_ptr, std::reference_wrapper are used instead of pointer.
  • std::make_shared is used instead of new.
  • std::vector is used for dynamic buffer allocation to avoid memory leaks.