Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Have a better code coverage #85

@dawagner

Description

@dawagner

The current code coverage is codecov.io. We can make it better by:

  • removing dead code
  • refactor
  • more tests

Let's analyse the code coverage report to identify dead code and untested parts:

libparameter

  • Unused code related to the Element tree not being strongly-typed. E.g. some classes
  • logValue (in several classes): only used by the remote interface; maybe it shouldn't be a method.
  • lots of to/from blackboard methods (both to/from user and to/from hardware)

ParameterMgr

Subsystem

  • showMapping on formatted subsytem object (here, here and here).

Element Handle

  • to/from user as different types (here; it also impacts other classes)

Fixed Point

Integer

ParameterType

ArrayParameter

  • access as several types (see the general comment on libparameter)

BitParameter / BitwiseAreaConfiguration

FormattedSubsystemObject

SubsystemObject

  • some stuff only used by plugin X or Y (e.g. here and here)

DomainConfiguration

  • validation: configurations never seem to be invalid (here and here)
  • merging

Floats

CriterionRule

Linear and Log Adaptations

not tested at all:

Element god class

Criterion

Mapping

Simulated BackSynchronizer

not tested at all

BitParameterBlockType

Default builder

SystemClass

Subsystem Object Creator

libxmlserializer

  • XmlUtil.cpp not analyzed...
  • The rest of misses are only error cases

libremote-processor

The coverage misses only involve error cases except a function only used by a non-tested remote command.

utility

Summary

In subjective, ascending order of criticality.

  • lots of dead code due to the weak typing of the Element tree (e.g. virtual methods that have to be implemented but are never actually used, such as getKind());
  • a lot of errors cases are not covered (probably the largest source of coverage misses);
  • most of remote commands aren't tested (ParameterMgr.cpp);
  • some methods are only used by plugins and aren't tested; likewise, some client methods are not tested;
  • some features are not tested at all (e.g. simulation mode, parameter adaptation) or poorly tested (e.g. showMapping);
  • a large amount of parameter getters/setters (on one hand, between the user and the blackboard; on the other hand, between the blackboard and the subsystems) are not tested.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions