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

Have a better code coverage #85

Open
dawagner opened this issue Apr 10, 2015 · 1 comment
Open

Have a better code coverage #85

dawagner opened this issue Apr 10, 2015 · 1 comment

Comments

@dawagner
Copy link
Contributor

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.
@krocard
Copy link
Contributor

krocard commented Apr 10, 2015

Maybe we should add -fno-inline -fno-inline-small-functions -fno-default-inline to improve method coverage accuracy. I am not sure they are needed though, as we are compiling in -O0


FormattedSubsystemObject

FormatedSubsystemObject is used by nearly all plugins. Maybe we should modify the test subsystem to use it.


rogue parameters/parameter handle in parameter/ParameterHandle.cpp

get and set of rogue parameters should be made template. The set and get code is duplicated everywhere.


Anyway, templating can reduce line count

True method that are not called are not instantiated.

dawagner added a commit that referenced this issue Apr 13, 2015
Dead code removal

These methods weren't used by anyone. This PR helps closing the coverage gap for #85.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants