This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Have a better code coverage #85
Copy link
Copy link
Open
Labels
Description
The current code coverage is . 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
- lots of remote command handlers code; has implications on other classes, e.g. ConfigurableDomains
Subsystem
Element Handle
- to/from user as different types (here; it also impacts other classes)
Fixed Point
- convert fixed point from decimal
- out-of-range test in raw space (here and here)
- to/from user value as double (element handle interface not tested for FixedPoint)
Integer
- to/from user value as double
toPlainInteger(only used in the alsa plugin)
ParameterType
ArrayParameter
- access as several types (see the general comment on libparameter)
BitParameter / BitwiseAreaConfiguration
- bit parameter as area configuration (here and here)
- impacts AreaConfiguration as well.
FormattedSubsystemObject
SubsystemObject
DomainConfiguration
Floats
CriterionRule
Linear and Log Adaptations
not tested at all:
Element god class
Criterion
- methods used by the client:
Mapping
- methods used by plugins (
getItem,getItemAsInteger)
Simulated BackSynchronizer
BitParameterBlockType
Default builder
- mechanism enabled but never actually tested (could it be dead code?)
SystemClass
Subsystem Object Creator
- virtual dtor never called? Should be called by Subsystem's dtor, though.
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
- convertToVia (conversion to int8/uint8)
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.
Activity
krocard commentedon Apr 10, 2015
Maybe we should add
-fno-inline -fno-inline-small-functions -fno-default-inlineto improve method coverage accuracy. I am not sure they are needed though, as we are compiling in -O0FormatedSubsystemObject is used by nearly all plugins. Maybe we should modify the test subsystem to use it.
get and set of rogue parameters should be made template. The set and get code is duplicated everywhere.
True method that are not called are not instantiated.
Merge pull request #86 from dawagner/dead-code-removal