Skip to content

Commit

Permalink
#203 added more tests for OCC metric
Browse files Browse the repository at this point in the history
  • Loading branch information
mesut committed Jul 7, 2018
1 parent a7fe411 commit 48fcf32
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -255,6 +255,7 @@ if lost.
- [@memoyil](https://github.com/memoyil) as Mehmet Yildirim
- [@sergey-karazhenets](https://github.com/sergey-karazhenets) as Sergey Karazhenets
- [@llorllale](https://github.com/llorllale) as George Aristy
- [@mesut](https://github.com/mesut) as Mesut Özen

Don't hesitate to add your name to this list in your next pull request.

Expand Down
26 changes: 23 additions & 3 deletions src/test/java/org/jpeek/MetricsTest.java
Expand Up @@ -65,8 +65,6 @@
* @checkstyle MagicNumberCheck (500 lines)
* @todo #67:30min PCC: add the rest of the test cases for this metric. Could
* only fit test case for MethodsWithDiffParamTypes within budget.
* @todo #90:30min OCC metric: need to implement the rest of the test cases.
* Could only fit test for sample class "Foo" within budget in this one.
* @todo #106:30min Adding a new 'op' for calls to methods broke some tests
* and hence they were removed. Need to do the math for those tests and then
* add them back: SCOM with "Foo", SCOM with "MethodsWithDiffParamTypes",
Expand Down Expand Up @@ -203,7 +201,29 @@ public static Collection<Object[]> targets() {
new Object[] {"Foo", "CCM", 0.1667d},
new Object[] {"OverloadMethods", "CCM", 0.6d},
new Object[] {"TwoCommonAttributes", "CCM", Double.NaN},
new Object[] {"TwoCommonMethods", "CCM", 0.0238d}
new Object[] {"TwoCommonMethods", "CCM", 0.0238d},
new Object[] {"Bar", "OCC", 0.75d},
new Object[] {"BridgeMethod", "OCC", 0.0d},
new Object[] {"ClassWithPublicField", "OCC", 0.5d},
new Object[] {
"IndirectlyRelatedPairs",
"OCC",
0.6666666666666666d,
},
new Object[] {"MethodMethodCalls", "OCC", 0.2d},
new Object[] {
"MethodsWithDiffParamTypes",
"OCC",
0.3333333333333333d,
},
new Object[] {"NoMethods", "OCC", 0.0d},
new Object[] {"OneMethodCreatesLambda", "OCC", 0.0d},
new Object[] {"OneVoidMethodWithoutParams", "OCC", 0.0d},
new Object[] {"OnlyOneMethodWithParams", "OCC", 1d},
new Object[] {"OverloadMethods", "OCC", 0.75d},
new Object[] {"TwoCommonAttributes", "OCC", 0.0d},
new Object[] {"TwoCommonMethods", "OCC", 0.0d},
new Object[] {"WithoutAttributes", "OCC", 0.0d}
);
}

Expand Down

1 comment on commit 48fcf32

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 48fcf32 Jul 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 90-29fbce76 disappeared from src/test/java/org/jpeek/MetricsTest.java, that's why I closed #203. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.