EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.statistics.independence.test]

COVERAGE SUMMARY FOR SOURCE FILE [TestRunUpTest.java]

nameclass, %method, %block, %line, %
TestRunUpTest.java0%   (0/1)0%   (0/4)0%   (0/119)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestRunUpTest0%   (0/1)0%   (0/4)0%   (0/119)0%   (0/36)
TestRunUpTest (): void 0%   (0/1)0%   (0/3)0%   (0/1)
setUp (): void 0%   (0/1)0%   (0/8)0%   (0/3)
testDependence (): void 0%   (0/1)0%   (0/54)0%   (0/16)
testIndependence (): void 0%   (0/1)0%   (0/54)0%   (0/16)

1package de.uka.ipd.sdq.statistics.independence.test;
2 
3import java.util.List;
4 
5import junit.framework.TestCase;
6import de.uka.ipd.sdq.statistics.independence.IIndependenceTest;
7import de.uka.ipd.sdq.statistics.independence.RunUpTest;
8import de.uka.ipd.sdq.statistics.test.TestUtils;
9 
10public class TestRunUpTest extends TestCase {
11 
12        private IIndependenceTest indTest;
13 
14        @Override
15        protected void setUp() throws Exception {
16                super.setUp();
17 
18                this.indTest = new RunUpTest();
19        }
20 
21        public void testDependence() {
22                int desiredLag = 2;
23                int numberOfSamples = indTest.getLowerSampleLimit();
24                int repititions = 100;
25 
26                List<Double> samples = null;
27                int indepCnt = 0;
28                int depCnt = 0;
29                for (int i = 0; i < repititions; i++) {
30                        samples = TestUtils.createSampleSequence(numberOfSamples,
31                                        desiredLag);
32                        if (indTest.testIndependence(samples)) {
33                                ++indepCnt;
34                        } else {
35                                ++depCnt;
36                        }
37                }
38 
39                System.out.println("Dependent: " + depCnt + ", Independent: "
40                                + indepCnt);
41                assertTrue(depCnt > indepCnt);
42        }
43 
44        public void testIndependence() {
45                int desiredLag = 1;
46                int numberOfSamples = indTest.getLowerSampleLimit();
47                int repititions = 100;
48 
49                List<Double> samples = null;
50                int indepCnt = 0;
51                int depCnt = 0;
52                for (int i = 0; i < repititions; i++) {
53                        samples = TestUtils.createSampleSequence(numberOfSamples,
54                                        desiredLag);
55                        if (indTest.testIndependence(samples)) {
56                                ++indepCnt;
57                        } else {
58                                ++depCnt;
59                        }
60                }
61 
62                System.out.println("Dependent: " + depCnt + ", Independent: "
63                                + indepCnt);
64                assertTrue(depCnt < indepCnt);
65        }
66 
67}

[all classes][de.uka.ipd.sdq.statistics.independence.test]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov