Skip to content

Commit

Permalink
Add tests for integral characteristics calculators
Browse files Browse the repository at this point in the history
And fixer formulas for the following integral characteristics calculators:
Geometric Mean
Alphabetic Depth
Alphabetic Average Remoteness
  • Loading branch information
ChainsManipulator committed Nov 10, 2024
1 parent 3586128 commit 083e332
Show file tree
Hide file tree
Showing 43 changed files with 823 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class MutualComplianceDegreeTests : AccordanceCalculatorsTests<MutualComp
[TestCase(13, 12, 0.3841)]
[TestCase(14, 15, 0.8352)]
[TestCase(15, 14, 0.8352)]
[TestCase(16, 17, 0.8350)]
[TestCase(17, 16, 0.8350)]
[TestCase(16, 17, 0.835)]
[TestCase(17, 16, 0.835)]
public void MutualComplianceDegreeTest(int firstIndex, int secondIndex, double firstValue)
{
CalculationTest(firstIndex, secondIndex, firstValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class AlphabeticAverageRemotenessTests : FullCalculatorsTests<AlphabeticA
[TestCase(2, Link.Both, 0.65961189)]
[TestCase(2, Link.Cycle, 0.75384077985)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.Start, 0.7169925)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class AlphabeticDepthTests : FullCalculatorsTests<AlphabeticDepth>
[TestCase(2, Link.Both, 9.2345665)]
[TestCase(2, Link.Cycle, 7.5384077985)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.Start, 3.5849625)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class ArithmeticMeanTests : FullCalculatorsTests<ArithmeticMean>
[TestCase(2, Link.Both, 3.142857142857)]
[TestCase(2, Link.Cycle, 4)]

[TestCase(4, Link.None, 1)]
[TestCase(4, Link.Start, 1)]
[TestCase(4, Link.End, 1)]
[TestCase(4, Link.Both, 1)]
[TestCase(4, Link.Cycle, 1)]

[TestCase(30, Link.Start, 1.8)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class AverageRemotenessATSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(2, Link.End, 0.386852807)]
[TestCase(2, Link.Both, 0.08132063)]
[TestCase(2, Link.Cycle, 0.18247041)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessDispersionTests : FullCalculatorsTests<AverageRemo
[TestCase(0, Link.End, 0.0169)]
[TestCase(0, Link.Both, 0.0506)]
[TestCase(0, Link.Cycle, 0.0365)]

[TestCase(2, Link.None, 0.5758459898)]
[TestCase(2, Link.Start, 0.3539214584)]
[TestCase(2, Link.End, 0.3746324241)]
[TestCase(2, Link.Both, 0.4057662147)]
[TestCase(2, Link.Cycle, 0.7039322237)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 0.2615874729)]
[TestCase(30, Link.Start, 0.2207915344)]
[TestCase(30, Link.End, 0.0037990343)]
[TestCase(30, Link.Both, 0.0320311191)]
[TestCase(30, Link.Cycle, 0.0939945344)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class AverageRemotenessGCRatioTests : FullCalculatorsTests<AverageRemoten
[TestCase(2, Link.End, 287.9621351)]
[TestCase(2, Link.Both, 236.5111966)]
[TestCase(2, Link.Cycle, 273.3951389)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class AverageRemotenessGCSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(2, Link.End, 0.527321204)]
[TestCase(2, Link.Both, 0.572664908)]
[TestCase(2, Link.Cycle, 0.611832142)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class AverageRemotenessGCToATRatioTests : FullCalculatorsTests<AverageRem
[TestCase(2, Link.End, 1.309482246)]
[TestCase(2, Link.Both, 0.978885023)]
[TestCase(2, Link.Cycle, 1.06305297)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessKurtosisCoefficientTests : FullCalculatorsTests<Av
[TestCase(0, Link.End, 1.6741)]
[TestCase(0, Link.Both, 1.2419)]
[TestCase(0, Link.Cycle, 1.1666)]

[TestCase(2, Link.None, 3.1899008031)]
[TestCase(2, Link.Start, 1.6068591076)]
[TestCase(2, Link.End, 3.1200053283)]
[TestCase(2, Link.Both, 1.943235334)]
[TestCase(2, Link.Cycle, 2.5925748595)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 1.5)]
[TestCase(30, Link.Start, 1.1666666667)]
[TestCase(30, Link.End, 1.1666666667)]
[TestCase(30, Link.Both, 1.0833333333)]
[TestCase(30, Link.Cycle, 1.1666666667)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessKurtosisTests : FullCalculatorsTests<AverageRemote
[TestCase(0, Link.End, 0.0005)]
[TestCase(0, Link.Both, 0.0032)]
[TestCase(0, Link.Cycle, 0.0016)]

[TestCase(2, Link.None, 1.057766653)]
[TestCase(2, Link.Start, 0.2012758125)]
[TestCase(2, Link.End, 0.4378910419)]
[TestCase(2, Link.Both, 0.3199463542)]
[TestCase(2, Link.Cycle, 1.2846741865)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 0.102642009)]
[TestCase(30, Link.Start, 0.0568737186)]
[TestCase(30, Link.End, 0.0000168381)]
[TestCase(30, Link.Both, 0.001111492)]
[TestCase(30, Link.Cycle, 0.0103074679)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ public class AverageRemotenessMKSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.None, 0.8094)]
[TestCase(1, Link.Start, -0.2459)]
[TestCase(1, Link.End, 0.8094)]
[TestCase(1, Link.Both, -0.0080)]
[TestCase(1, Link.Both, -0.008)]
[TestCase(1, Link.Cycle, 0.0661)]

[TestCase(2, Link.None, 3.26649924)]
[TestCase(2, Link.Start, -0.632100018)]
[TestCase(2, Link.End, -0.667775426)]
[TestCase(2, Link.Both, -1.157935537)]
[TestCase(2, Link.Cycle, -1.203443349)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,24 @@ public class AverageRemotenessRYSkewTests : FullCalculatorsTests<AverageRemotene
/// <param name="value">
/// The value.
/// </param>
[TestCase(1, Link.None, 0.2290)]
[TestCase(1, Link.None, 0.229)]
[TestCase(1, Link.Start, 0.3138)]
[TestCase(1, Link.End, -0.2065)]
[TestCase(1, Link.Both, -0.0862)]
[TestCase(1, Link.Cycle, 0.2050)]
[TestCase(1, Link.Cycle, 0.205)]

[TestCase(2, Link.None, 1.444165399575)]
[TestCase(2, Link.Start, 1.6566498)]
[TestCase(2, Link.End, 2.369195368)]
[TestCase(2, Link.Both, 1.550897715)]
[TestCase(2, Link.Cycle, 2.14199532)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class AverageRemotenessSWSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(2, Link.End, 0.680567977)]
[TestCase(2, Link.Both, -0.051016497)]
[TestCase(2, Link.Cycle, 0.162159139)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessSkewnessCoefficientTests : FullCalculatorsTests<Av
[TestCase(0, Link.End, 0.2583)]
[TestCase(0, Link.Both, -0.4341)]
[TestCase(0, Link.Cycle, -0.4082)]

[TestCase(2, Link.None, 0.7496522433)]
[TestCase(2, Link.Start, 0.5195114814)]
[TestCase(2, Link.End, 1.2615505633)]
[TestCase(2, Link.Both, 0.4029308102)]
[TestCase(2, Link.Cycle, 0.8748926874)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 0.7071067812)]
[TestCase(30, Link.Start, 0.4082482905)]
[TestCase(30, Link.End, 0.4082482905)]
[TestCase(30, Link.Both, 0.2886751346)]
[TestCase(30, Link.Cycle, 0.4082482905)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessSkewnessTests : FullCalculatorsTests<AverageRemote
[TestCase(0, Link.End, 0.0006)]
[TestCase(0, Link.Both, -0.0049)]
[TestCase(0, Link.Cycle, -0.0028)]

[TestCase(2, Link.None, 0.3275814984)]
[TestCase(2, Link.Start, 0.1093844261)]
[TestCase(2, Link.End, 0.2892762012)]
[TestCase(2, Link.Both, 0.1041464096)]
[TestCase(2, Link.Cycle, 0.5167149843)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 0.0946041996)]
[TestCase(30, Link.Start, 0.0423543481)]
[TestCase(30, Link.End, 0.0000955948)]
[TestCase(30, Link.Both, 0.001654884)]
[TestCase(30, Link.Cycle, 0.0117646301)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ public class AverageRemotenessStandardDeviationTests : FullCalculatorsTests<Aver
[TestCase(0, Link.End, 0.1298)]
[TestCase(0, Link.Both, 0.225)]
[TestCase(0, Link.Cycle, 0.191)]

[TestCase(2, Link.None, 0.7588451685)]
[TestCase(2, Link.Start, 0.5949129839)]
[TestCase(2, Link.End, 0.6120722377)]
[TestCase(2, Link.Both, 0.6369978137)]
[TestCase(2, Link.Cycle, 0.8390066887)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.None, 0.5114562277)]
[TestCase(30, Link.Start, 0.4698845969)]
[TestCase(30, Link.End, 0.0616363065)]
[TestCase(30, Link.Both, 0.1789723977)]
[TestCase(30, Link.Cycle, 0.3065852807)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,45 @@ public class AverageRemotenessTests : FullCalculatorsTests<AverageRemoteness>
[TestCase(0, Link.Both, 1.0828)]
[TestCase(0, Link.Cycle, 1.234)]

[TestCase(1, Link.None, 1.6726956021)]
[TestCase(1, Link.Start, 1.4943064208)]
[TestCase(1, Link.End, 1.4621136113)]
[TestCase(1, Link.Both, 1.3948590506)]
[TestCase(1, Link.Cycle, 1.8112989210)]

[TestCase(2, Link.None, 1.09749375)]
[TestCase(2, Link.Start, 1.3299208)]
[TestCase(2, Link.End, 1.17548874963)]
[TestCase(2, Link.Both, 1.31922378713)]
[TestCase(2, Link.Cycle, 1.5076815597)]

[TestCase(30, Link.Start, 0.7169925)]
[TestCase(3, Link.Start, 0.5)]
[TestCase(3, Link.End, 0.5)]
[TestCase(3, Link.Both, 0.5)]
[TestCase(3, Link.Cycle, 1)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(5, Link.Start, 1.1462406252)]
[TestCase(5, Link.End, 1.1462406252)]
[TestCase(5, Link.Both, 1.1462406252)]
[TestCase(5, Link.Cycle, 2)]

[TestCase(6, Link.None, 0)]
[TestCase(6, Link.Start, 1.102035074)]
[TestCase(6, Link.End, 0.654994643)]
[TestCase(6, Link.Both, 1.1181098199)]
[TestCase(6, Link.Cycle, 1.4888663952)]

[TestCase(30, Link.None, 0.8616541669)]
[TestCase(30, Link.Start, 0.7169925001)]
[TestCase(30, Link.End, 0.7169925001)]
[TestCase(30, Link.Both, 0.654994643)]
[TestCase(30, Link.Cycle, 0.9169925001)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class DepthTests : FullCalculatorsTests<Depth>
[TestCase(2, Link.Both, 18.469133)]
[TestCase(2, Link.Cycle, 15.076815597)]

[TestCase(4, Link.None, 0)]
[TestCase(4, Link.Start, 0)]
[TestCase(4, Link.End, 0)]
[TestCase(4, Link.Both, 0)]
[TestCase(4, Link.Cycle, 0)]

[TestCase(30, Link.Start, 3.5849625)]
public void CalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class DescriptiveInformationTests : FullCalculatorsTests<DescriptiveInfor
[TestCase(2, Link.Both, 2.8867851948)]
[TestCase(2, Link.Cycle, 3.389245277)]

[TestCase(4, Link.None, 1)]
[TestCase(4, Link.Start, 1)]
[TestCase(4, Link.End, 1)]
[TestCase(4, Link.Both, 1)]
[TestCase(4, Link.Cycle, 1)]

[TestCase(30, Link.Start, 1.71450693)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Loading

0 comments on commit 083e332

Please sign in to comment.