Test coverage report - MotionTooler/MotionToolsWiki GitHub Wiki

Introduction

Since Unity does not support code coverage, we will provide a proper test coverage report here. The report shows code tested as follows: MethodToTest(Arguments) - MethodTestedByTest()

If some methods or classes are not tested, this will be explained.

Summary

Automatic coverage tools help us show the coverage for some classes that are completely disconnected from Unity. The summary of automatic coverage tools report are displayed in the following image. Note that the total coverage is not representative for the actual code coverage percentage.

Code Coverage

Tests

Filter, 2/2 classes tested

ButterworthFilter.cs

Code coverage: 100%

ButterworthFilter(int samplingFrequency, int order, int cutoffFrequency) - Implicitly tested by all other tests

Fs { get; set; } - TestFsChange(), TestFsChangeZeroException()

Order { get; set; } - TestOrderChange(), TestOrderChangeZeroException(), TestOrderChangeUnevenException()

CutoffFrequency { get; set; } - TestCutoffFrequencyChange(), TestCutoffFrequencyChangeZeroException()

Apply(float) - TestWaves(string, int, int, int)

TimeShiftingFilter.cs

Code coverage: 100%

TimeShiftingFilter.get_Order - TimeShiftingFilterTests.TestCorrectOrder()

TimeShiftingFilter.set_Order - TimeShiftingFilterTests.TestCorrectOrder(), TimeShiftingFilterTests.TestNegativeOrder(), TimeShiftingFilterTests.TestOddOrder()

TimeShiftingFilter..ctor() - all tests in TimeShiftingFilterTests

TimeShiftingFilter.Apply(float) - TimeShiftingFilterTests.TestOrderEightWithNoScopeChange(), TimeShiftingFilterTests.TestDecreaseOrder(), TimeShiftingFilterTests.TestIncreaseOrder()

IFilter.cs

This is an interface which can not be tested.

GenericAnimator, 2/3 classes tested

HumanToNeuronFactory.cs

Code coverage: 100%

FullHumanToNeuronValueConverter() - Implicitly tested by all other tests

InitializeHipsValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryHips()

InitializeLegValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryLegs()

InitializeSpineValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactorySpine()

InitializeArmValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryArm()

InitializeToesValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryToes()

InitializeEyeValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryEyes()

InitializeJawValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryJaw()

InitializeLeftFingersValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryLeftFingers()

InitializeRightFingersValues(HumanToNeuronValueConverter) - TestHumanToNeuronFactoryRightFingers()

InitializeUpperChestValues(HumanToNeuronValueConverter) - TestHumanToNeuronUpperChest()

InitalizeLastBoneValues(HumanToNeuronValueConverter) - TestHumanToNeurorLastBone()

HumanToNeuronValueConverter.cs

Code coverage: 100%

HumanToNeuronValueConverter(int) - Implicitly tested by all other tests

Convert(HumanBodyBones) - Implicitly tested by all other tests, TestOutOfBoundsNewConverion(), TestOutOfBoundsConverion()

AddConvertValue(HumanBodyBones, params NeuronBones[]) - TestConverterOneValue(), TestConverterMultipleValues(), TestConverterMultipleConversionsFirstValue(), TestConverterMultipleConversionsSecondValue()

AddConvertValues(IDictionary<HumanBodyBones, IEnumerable<NeuronBones>>) - TestConverterDictionaryInsert()

IValueConverter.cs

This is an interface which can not be tested.

NeuronGenericAnimatorInstance.cs

Code coverage: 0%

This can not be tested because all the functionality of this depends on constant BVH data stream from Neuron Axis. It was proven too difficult to replicate this data and so we decided not to test this class.

GenericCollider, 1/1 classes tested

CollisionTools.cs

Code coverage: 50% This class is closely related to Unity and so the test report can't be automatically generated. We have thoroughly tested the methods to ensure proper functionality.

AddSkeletonColliders(Animator, int) - TestRecursiveAddedColliderAmountFullSkeleton(), TestRecursiveAddedColliderAmountPartialSkeleton(), TestRecursiveAddCollidersTwice(), TestSkeletonWithoutAnimatorAdd(), TestEmptyAnimatorAdd()

RemoveSkeletonColliders(Animator) - TestRecursiveRemovedColliderAmount(), TestSkeletonWithoutAnimatorRemove(), TestEmptyAnimatorRemove()

AddSkeletonColliderRenderers(Animator, Color) - Not yet implemented, not yet tested

RemoveSkeletonColliderRenderers(Animator) - Not yet implemented, not yet tested

GenericUtilities, 1/1 classes tested

CollisionUtils.cs

Code coverage: 100% This class is closely related to Unity and so the test report can't be automatically generated. We have thoroughly tested the methods to ensure proper functionality.

AddCapsuleCollidersRecursively(Transform, int) - AddCapsuleCollidersRecursivelySerialTest(), AddCapsuleCollidersRecursivelyDepthTest(), AddCapsuleCollidersRecursivelyDepthChildTest(),

AddCapsuleColliders(Transform, Transform, int) - AddCapsuleCollidersAmountTest(), AddCapsuleCollidersTypeTest(), AddCapsuleCollidersTypeTestFirstChild(), AddCapsuleCollidersHeightTest(), AddCapsuleCollidersRadiusTest()

RemoveCollidersRecursively(Transform) - RemoveCollidersRecursivelySerialTest(), RemoveCollidersRecursivelyTwoObjectsDepthTest(),

RemoveColliders(Transform bone) - RemoveCollidersTwoObjectsTest(), RemoveCollidersTwoObjectsSerialTest(), RemoveCollidersTwoObjectsDepthTest(),

AddCapsuleColliderWithChilds(Transform sourceBone) - AddCapsuleColliderWithChildsTest(), AddCapsuleColliderWithChildsWithoutChildsTest()

AddCapsuleColliderToFurthestChild(Transform) - AddCapsuleColliderToFurthestChildTest(), AddCapsuleColliderToFurthestChildHeightTest(), AddCapsuleColliderToParentWithoutChilds(), AddCapsuleColliderToFurthestChildHeightWithoutChildsTest(), AddCapsuleColliderToFurthestChildRadiusWithoutChildsTest()

Mocap, 0/7 classes tested This code is from the NeuronSDK, we will not be testing this as it is not our code.
Utilities, 2/4 classes tested

AssetLoader.cs

Code coverage: 100%

LoadAsset<T>(string, OnSuccess<T>) - TestDelegate()

LoadAsset<T>(string) - TestLoadAsset(), TestLoadEmptyString(), TestLoadNull()

BoneRigidbodies.cs

This code is still from the NeuronSDK, we will not be testing this as it is not our code.

ClassifierTrainerSettings.cs

Code coverage: 100%

ClassifierTrainerSettings.Enable() - ClassifierTrainerSettingsTests.TestEnable

HandClampClassifierTrainer.cs

Not tested since it depends on sample data, and we do not have a good oracle to verify our results with.

HandDataRecording, 0/1 classes tested

HandMotionRecording.cs

Heavily depends on unity message and file input/output. Therefore not unit tested.

Classifier, 3/3 classes tested

ClampClassifier.cs

Code coverage: approximately 100% as this class is dependent on Unity

Classify(HandRotations data) - TestNullRotation(), TestRecognizeClamping(), TestRecognizeNoClamping()

MarkovClampClassifier.cs

Code coverage: 100%

MarkovClampClassifier..ctor(string) - all tests in MarkovClampClassifierTests

MarkovClampClassifier..ctor(ICollection<double[][]>, ICollection<double[][]>) - MarkovClampClassifierTests.TestLearningUnClamped(), MarkovClampClassifierTests.TestLearningUnClamped

MarkovClampClassifier.Classify(HandRotations) - MarkovClampClassifierTests.TestLearningUnClamped(), MarkovClampClassifierTests.TestLearningUnClamped

MarkovClampClassifier..ctor(ICollection<double[][]>, ICollection<double[][]>) - MarkovClampClassifierTests.TestLearningUnClamped(), MarkovClampClassifierTests.TestLearningClamped

NullClassifier.cs

Code coverage: 100%

MarkovClampClassifier..ctor() - all tests in NullClassifierTests.TestDefaultConstuctor

MarkovClampClassifier..ctor(TClass value) - NullClassifierTests.TestDefaultValueConstuctor

MarkovClampClassifier.Classify(TData data) - NullClassifierTests.TestDefaultConstuctor, NullClassifierTests.TestDefaultValueConstuctor

IClassifier.cs

This is an interface which can not be tested.

Clampers, 1/2 classes tested

ClampableGameObject.cs

Code coverage: 0% not tested because all methods in this class are empty.

HandClamper.cs

Code coverage: approximately 100% as this class is dependent on Unity

ApplyClamping(IClassifier<HandRotations, HandClassification> classifier, Animator animator, IList<IClampableGameObject> clampableGameObjects) - TestClampWhenCloseAndGrip(), TestNoClampWhenFarAndGrip(), TestNoClampWhenCloseAndNoGrip(), TestNoClampWhenClampingFalse, TestNoClampWhenNoClampBone()

IClampableGameObject.cs

This is an interface which can not be tested.

IClamper.cs

This is an interface which can not be tested.

Selections, 3/3 classes tested

Selectable.cs

Code coverage

SelectionChangedEventArgs.cs

Code coverage

Controllers, 4/4 classes tested

IAnimatorController.cs

This is an interface which can not be tested.

AnimatorController.cs

AddAnimators() - TestAddAnimator(), TestAddTwoAnimators()

RemoveAnimators() - TestRemoveAnimator(), TestRemoveNoAnimator()

ICollidersController.cs

This is an interface which can not be tested.

CollidersController.cs

AddColliders() - TestAddColliders() RemoveColliders() - TestRemoveColliders() GetGeneralLayer() - TestGetGeneralLayer() SetGeneralLayer(int) - TestSetGeneralLayer() GetBoneLayer() - TestGetBoneLayer() SetBoneLayer(int) - TestSetBoneLayer()

IRigidBodiesController.cs

This is an interface which can not be tested.

RigidBodiesController.cs

AddRigidBodies() - TestAddRigidBodies(), TestAddRigidBodiesTwice() RemoveRigidBodies() - TestRemoveRigidBodies(), TestRemoveNoRigidBodies()

ISelecterController.cs

This is an interface which can not be tested.

SelecterController.cs

UpdateSelectables(IEnumerable<GameObject>) - TestUpdateSelectables() RemoveSelection(GameObject) - TestRemoveSelection(), TestRemoveNotSelectedSelection() InvertSelection() - TestDeselectAll() SelectAll() - TestInverseSelection() DeselectAll() - TestSelectAll() Selectables() - TestSelectables() SelectedNonHumanoid() - TestSelectNonHumanoid(), TestSelectNoNonHumanoid()

Crawler, 1/2 classes tested

Crawler.cs

This is an interface which can not be tested.

SkeletonCrawler.cs

Code coverage: 100%

Crawl(GameObject value) - Implicitly tested by all other tests

CrawlUp(GameObject value) - TestCrawlUp(), TestCrawlUpAndDown()

CrawlDown(GameObject value) - TestCrawlDown(), TestCrawlUpAndDown()

CheckCrawlCondition(GameObject value) - Implicitly tested by all other tests

⚠️ **GitHub.com Fallback** ⚠️