[cost] Brush up tests (2)

Summary:
Fix misleading test names. Correct comments/FP/ok/bad markers. Remove reduntant tests.
To be continued...

Reviewed By: skcho

Differential Revision: D21929471

fbshipit-source-id: fc1a30dc8
master
Ezgi Çiçek 5 years ago committed by Facebook GitHub Bot
parent d3eb554e8c
commit ab08d6cfff

@ -20,22 +20,22 @@ public class ArrayListTest {
for (int i = 0, size = local_list.size(); i < size; ++i) {}
}
public void arraylist_empty_underrun_bad() {
public void arraylist_empty_underrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(-1, 42);
}
public void arraylist_empty_ok() {
public void arraylist_empty_ok_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0, 42);
}
public void arraylist_empty_overrun_bad() {
public void arraylist_empty_overrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(1, 42);
}
public void arraylist_add3_overrun_bad() {
public void arraylist_add3_overrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(42);
list.add(1337);
@ -43,7 +43,7 @@ public class ArrayListTest {
list.add(4, 666);
}
public void arraylist_add_in_loop() {
public void arraylist_add_in_loop_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 10; ++i) {
list.add(i);
@ -51,7 +51,7 @@ public class ArrayListTest {
for (int i = 0, size = list.size(); i < size; ++i) {}
}
public void arraylist_add_in_nested_loop_constant() {
public void arraylist_add_in_nested_loop_constant_constant() {
for (int j = 0; j < 10; j++) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 10; ++i) {
@ -61,7 +61,7 @@ public class ArrayListTest {
}
}
public void arraylist_add_in_loop_ok() {
public void arraylist_add_then_loop_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
@ -83,7 +83,7 @@ public class ArrayListTest {
for (int i = 0, size = list.size(); i < size; ++i) {}
}
public void arraylist_addAll_bad() {
public void arraylist_addAll_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(2);
list.add(3);
@ -96,18 +96,18 @@ public class ArrayListTest {
list2.addAll(5, list);
}
public void arraylist_get_underrun_bad() {
public void arraylist_get_underrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.get(0);
}
public void arraylist_get_overrun_bad() {
public void arraylist_get_overrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.get(2);
}
public void arraylist_get_ok() {
public void arraylist_get_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
@ -118,7 +118,7 @@ public class ArrayListTest {
}
}
public void arraylist_set_ok() {
public void arraylist_set_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
@ -128,24 +128,24 @@ public class ArrayListTest {
}
}
public void arraylist_set_underrun_bad() {
public void arraylist_set_underrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.set(0, 10);
}
public void arraylist_set_overrun_bad() {
public void arraylist_set_overrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.set(1, 10);
}
public void arraylist_remove_overrun_bad() {
public void arraylist_remove_overrun_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.remove(1);
}
public void arraylist_remove_ok() {
public void arraylist_remove_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
@ -153,15 +153,7 @@ public class ArrayListTest {
list.get(0);
}
public void arraylist_remove_bad() {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
list.remove(0);
list.get(1);
}
public void arraylist_remove_in_loop_Good() {
public void arraylist_remove_in_loop_constant() {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 10; ++i) {
list.add(i);
@ -191,10 +183,10 @@ public class ArrayListTest {
}
}
// Control vars include element which is some intValue and list length. The result of intValue
// depends on the list element. O(list.length x (-list.elements + 11))
// Control vars include the list length and the element which is some intValue.
// O(list.length x (-list.elements + 11))
// Simplified version of real code https://fburl.com/a3gge1b7
public boolean iterate_over_arraylist_shortcut_FP(ArrayList<Integer> list) {
public boolean iterate_over_arraylist_shortcut_linear_FP(ArrayList<Integer> list) {
for (Integer element : list) {
if (element > 10) {
return false;

@ -26,8 +26,5 @@ class CantHandle {
i++;
}
}
// Expected: x^2, got x^2
void quadratic(int x) {
for (int i = 0; i < x * x; i++) {}
}
}

@ -61,7 +61,7 @@ class CollectionsTest {
for (Integer el : Collections.unmodifiableSet(set)) {}
}
void emptySet_zero() {
void emptySet_constant() {
Set<String> set = Collections.emptySet();
for (String s : set) {}
}

@ -215,6 +215,11 @@ public class Cost_test {
for (int i = 0; i < n; i++) {}
mult_symbols_quadratic(n, n);
}
// Expected: x^2, got x^2
void quadratic(int x) {
for (int i = 0; i < x * x; i++) {}
}
}
class CloneTest {

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
class EvilCfg {
public void foo(int i, int j, boolean b) {
public void foo_FP(int i, int j, boolean b) {
int k, l, m, n;
k = b ? i : j;

@ -23,9 +23,7 @@ class Invariant {
// x shouldn't be invariant since it can have two different values
// depending on whether the inner conditional is executed or not.
// Currently, we are getting a quadratic, rather than a linear,
// because the value of x at the true branch of the if statement is
// precisely analyzed to [0,4+min(1,size.ub)], rather than [0,5].
// Currently, we are getting T.
void formal_not_invariant_FP(int size, int x) {
int i = 0;
while (i < size + x) {
@ -38,8 +36,7 @@ class Invariant {
// x shouldn't be invariant since it can have two different values
// depending on whether the inner conditional is executed or not
// Currently, we are getting T because of a problem in InferBo, see
// T32798161
// Currently, we are getting quadratic bound we can't simplify (5+min(1, size))
void local_not_invariant_FP(int size) {
int i = 0;
int x = 5;
@ -60,8 +57,6 @@ class Invariant {
} while (i < m);
}
// before, we were getting items.size()^2 since all functions were
// assumed to be impure
void list_size_invariant(List<?> items) {
for (int i = 0; i < items.size(); i++) {}
}

@ -32,44 +32,43 @@ codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest$Elt.<init>(Arra
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest$Elt.get_boolean():boolean, 4, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.<init>(), 15, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.array_get_elem_constant():void, 81, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add3_overrun_bad():void, 27, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_addAll_bad():void, 39, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_loop():void, 174, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_loop_ok():void, 187, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_nested_loop_constant():void, 1774, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_ok():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_overrun_bad():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_underrun_bad():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_ok():void, 56, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_overrun_bad():void, 13, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_underrun_bad():void, 7, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_bad():void, 22, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_in_loop_Good():void, 214, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_ok():void, 22, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_overrun_bad():void, 13, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_ok():void, 68, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_overrun_bad():void, 16, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_underrun_bad():void, 10, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.boolean_control_var_linear():void, 7 + 19 ⋅ this.arr.length + 4 ⋅ (this.arr.length + 1), OnUIThread:false, [{this.arr.length + 1},Loop at line 300,{this.arr.length},Loop at line 300]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.call_init_with_put_linear(java.util.ArrayList):void, 22 + 8 ⋅ a.length + 13 ⋅ a.length + 3 ⋅ (a.length + 1) + 3 ⋅ (a.length + 1), OnUIThread:false, [{a.length + 1},call to HashMap ArrayListTest.init_with_put_linear(ArrayList),Loop at line 309,{a.length + 1},Loop at line 317,{a.length},call to HashMap ArrayListTest.init_with_put_linear(ArrayList),Loop at line 309,{a.length},Loop at line 317]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add3_overrun_constant():void, 27, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_addAll_constant():void, 39, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_loop_constant():void, 174, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_nested_loop_constant_constant():void, 1774, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_then_loop_constant():void, 187, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_ok_constant():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_overrun_constant():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_underrun_constant():void, 9, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_constant():void, 56, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_overrun_constant():void, 13, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_underrun_constant():void, 7, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_constant():void, 22, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_in_loop_constant():void, 214, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_overrun_constant():void, 13, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_constant():void, 68, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_overrun_constant():void, 16, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_underrun_constant():void, 10, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.boolean_control_var_linear():void, 7 + 19 ⋅ this.arr.length + 4 ⋅ (this.arr.length + 1), OnUIThread:false, [{this.arr.length + 1},Loop at line 292,{this.arr.length},Loop at line 292]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.call_init_with_put_linear(java.util.ArrayList):void, 22 + 8 ⋅ a.length + 13 ⋅ a.length + 3 ⋅ (a.length + 1) + 3 ⋅ (a.length + 1), OnUIThread:false, [{a.length + 1},call to HashMap ArrayListTest.init_with_put_linear(ArrayList),Loop at line 301,{a.length + 1},Loop at line 309,{a.length},call to HashMap ArrayListTest.init_with_put_linear(ArrayList),Loop at line 301,{a.length},Loop at line 309]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.call_sortArrayList(java.util.ArrayList):void, 4 + list.length × log(list.length), OnUIThread:false, [{list.length},call to void ArrayListTest.sortArrayList(ArrayList),Modeled call to Collections.sort,{list.length},call to void ArrayListTest.sortArrayList(ArrayList),Modeled call to Collections.sort]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_add_all(java.util.ArrayList,java.util.ArrayList):void, 13 + 5 ⋅ (l.length + list.length) + 3 ⋅ (l.length + list.length + 1), OnUIThread:false, [{l.length + list.length + 1},Loop at line 250,{l.length + list.length},Loop at line 250]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_add_all_sym(java.util.ArrayList,java.util.ArrayList):void, 13 + 5 ⋅ (l.length + list.length) + 3 ⋅ (l.length + list.length + 1), OnUIThread:false, [{l.length + list.length + 1},Loop at line 257,{l.length + list.length},Loop at line 257]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_linear(java.util.ArrayList):void, 9 + 5 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 232,{list.length},Loop at line 232]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_modify(java.util.ArrayList):void, 21 + 5 ⋅ (list.length + 4) + 3 ⋅ (list.length + 5), OnUIThread:false, [{list.length + 5},Loop at line 243,{list.length + 4},Loop at line 243]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_add_all(java.util.ArrayList,java.util.ArrayList):void, 13 + 5 ⋅ (l.length + list.length) + 3 ⋅ (l.length + list.length + 1), OnUIThread:false, [{l.length + list.length + 1},Loop at line 242,{l.length + list.length},Loop at line 242]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_add_all_sym(java.util.ArrayList,java.util.ArrayList):void, 13 + 5 ⋅ (l.length + list.length) + 3 ⋅ (l.length + list.length + 1), OnUIThread:false, [{l.length + list.length + 1},Loop at line 249,{l.length + list.length},Loop at line 249]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_linear(java.util.ArrayList):void, 9 + 5 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 224,{list.length},Loop at line 224]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.constructor_modify(java.util.ArrayList):void, 21 + 5 ⋅ (list.length + 4) + 3 ⋅ (list.length + 5), OnUIThread:false, [{list.length + 5},Loop at line 235,{list.length + 4},Loop at line 235]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.empty_list_constant(int):void, 12, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.id(java.util.ArrayList):void, 10, OnUIThread:false, []
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.init_with_put_linear(java.util.ArrayList):java.util.HashMap, 11 + 13 ⋅ a.length + 3 ⋅ (a.length + 1), OnUIThread:false, [{a.length + 1},Loop at line 309,{a.length},Loop at line 309]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.init_with_put_linear(java.util.ArrayList):java.util.HashMap, 11 + 13 ⋅ a.length + 3 ⋅ (a.length + 1), OnUIThread:false, [{a.length + 1},Loop at line 301,{a.length},Loop at line 301]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_arraylist(java.util.ArrayList):void, 8 + 5 ⋅ list.length, OnUIThread:false, [{list.length},Loop at line 15]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_arraylist_shortcut_FP(java.util.ArrayList):boolean, 10 + 11 ⋅ list.length + 2 ⋅ list.length × (11-max(10, list.elements)) + 3 ⋅ (list.length + 1) × (11-max(10, list.elements)), OnUIThread:false, [{11-max(10, list.elements)},Loop at line 198,{list.length + 1},Loop at line 198,{11-max(10, list.elements)},Loop at line 198,{list.length},Loop at line 198]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_arraylist_with_inner(java.util.ArrayList):void, 9 + 11 ⋅ list1.length + 3 ⋅ (list1.length + 1), OnUIThread:false, [{list1.length + 1},Loop at line 189,{list1.length},Loop at line 189]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_arraylist_shortcut_linear_FP(java.util.ArrayList):boolean, 10 + 11 ⋅ list.length + 2 ⋅ list.length × (11-max(10, list.elements)) + 3 ⋅ (list.length + 1) × (11-max(10, list.elements)), OnUIThread:false, [{11-max(10, list.elements)},Loop at line 190,{list.length + 1},Loop at line 190,{11-max(10, list.elements)},Loop at line 190,{list.length},Loop at line 190]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_arraylist_with_inner(java.util.ArrayList):void, 9 + 11 ⋅ list1.length + 3 ⋅ (list1.length + 1), OnUIThread:false, [{list1.length + 1},Loop at line 181,{list1.length},Loop at line 181]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_over_local_arraylist(java.util.ArrayList):void, 10 + 5 ⋅ list.length, OnUIThread:false, [{list.length},Loop at line 20]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_while_has_next(java.util.ArrayList):void, 6 + 10 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 181,{list.length},Loop at line 181]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_with_iterator(java.util.ArrayList):void, 6 + 8 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 175,{list.length},Loop at line 175]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.json_array_constructor_linear(java.util.ArrayList):void, 9 + 5 ⋅ arr.length + 3 ⋅ (arr.length + 1), OnUIThread:false, [{arr.length + 1},Loop at line 277,{arr.length},Loop at line 277]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.linear(int,java.util.ArrayList):void, 7 + 9 ⋅ (-i + a.length + 1), OnUIThread:false, [{-i + a.length + 1},Loop at line 284]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_while_has_next(java.util.ArrayList):void, 6 + 10 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 173,{list.length},Loop at line 173]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.iterate_with_iterator(java.util.ArrayList):void, 6 + 8 ⋅ list.length + 3 ⋅ (list.length + 1), OnUIThread:false, [{list.length + 1},Loop at line 167,{list.length},Loop at line 167]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.json_array_constructor_linear(java.util.ArrayList):void, 9 + 5 ⋅ arr.length + 3 ⋅ (arr.length + 1), OnUIThread:false, [{arr.length + 1},Loop at line 269,{arr.length},Loop at line 269]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.linear(int,java.util.ArrayList):void, 7 + 9 ⋅ (-i + a.length + 1), OnUIThread:false, [{-i + a.length + 1},Loop at line 276]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.max_linear(java.util.ArrayList):Person, 12 + people.length, OnUIThread:false, [{people.length},Modeled call to Collections.max]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.remove_string_from_list(java.lang.String):boolean, 13 + 12 ⋅ this.list.length + 3 ⋅ (this.list.length + 1), OnUIThread:false, [{this.list.length + 1},Loop at line 221,{this.list.length},Loop at line 221]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.remove_string_from_list(java.lang.String):boolean, 13 + 12 ⋅ this.list.length + 3 ⋅ (this.list.length + 1), OnUIThread:false, [{this.list.length + 1},Loop at line 213,{this.list.length},Loop at line 213]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.sortArrayList(java.util.ArrayList):void, 2 + list.length × log(list.length), OnUIThread:false, [{list.length},Modeled call to Collections.sort,{list.length},Modeled call to Collections.sort]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.sort_comparator_nlogn(java.util.ArrayList):void, 8 + people.length × log(people.length), OnUIThread:false, [{people.length},Modeled call to Collections.sort,{people.length},Modeled call to Collections.sort]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.substitute_array_block_linear(java.util.ArrayList,java.util.ArrayList):void, 33 + 5 ⋅ (b.length + a.length), OnUIThread:false, [{b.length + a.length},call to void ArrayListTest.iterate_over_arraylist(ArrayList),Loop at line 15]
@ -82,7 +81,6 @@ codetoanalyze/java/performance/Break.java, codetoanalyze.java.performance.Break.
codetoanalyze/java/performance/Break.java, codetoanalyze.java.performance.Break.break_loop(int,int):int, 8 + 7 ⋅ p, OnUIThread:false, [{p},Loop at line 12]
codetoanalyze/java/performance/Break.java, codetoanalyze.java.performance.Break.break_outer_loop_MaybeInfinite(int,int):void, 8 + 4 ⋅ maxI + 3 ⋅ maxI × (min(12, maxJ)) + 5 ⋅ maxI × (12-max(0, maxJ)) + 5 ⋅ (min(11, maxI)) × (min(11, maxJ)), OnUIThread:false, [{min(11, maxJ)},Loop at line 37,{min(11, maxI)},Loop at line 35,{12-max(0, maxJ)},Loop at line 35,{min(12, maxJ)},Loop at line 37,{maxI},Loop at line 35]
codetoanalyze/java/performance/CantHandle.java, CantHandle.<init>(), 3, OnUIThread:false, []
codetoanalyze/java/performance/CantHandle.java, CantHandle.quadratic(int):void, 6 + 6 ⋅ x², OnUIThread:false, [{x},Loop at line 31,{x},Loop at line 31]
codetoanalyze/java/performance/CantHandle.java, CantHandle.square_root_FP(int):void, , OnUIThread:false, [Unbounded loop,Loop at line 17]
codetoanalyze/java/performance/CantHandle.java, CantHandle.square_root_variant_FP(int):void, , OnUIThread:false, [Unbounded loop,Loop at line 25]
codetoanalyze/java/performance/CollectionTest.java, CollectionTest$Dummy.<init>(), 3, OnUIThread:false, []
@ -104,7 +102,7 @@ codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.<init>(), 3
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.binary_search_log(java.util.List):int, 5 + log(list.length), OnUIThread:false, [{list.length},Modeled call to Collections.binarySearch]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.copy_linear(java.util.List,java.util.List):void, 3 + list_to.length, OnUIThread:false, [{list_to.length},Modeled call to Collections.copy]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptyList_constant():void, 10, OnUIThread:false, []
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptySet_zero():void, 11, OnUIThread:false, []
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptySet_constant():void, 11, OnUIThread:false, []
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.fill_linear(java.util.List,java.lang.String):void, 3 + list.length, OnUIThread:false, [{list.length},Modeled call to Collections.fill]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.globalEmptyList_constant():void, 8, OnUIThread:false, []
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.reverse_constant(java.lang.String):void, 6, OnUIThread:false, []
@ -147,6 +145,7 @@ codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Co
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.loop_on_unknown_global_linear():void, 5 + 5 ⋅ codetoanalyze.java.performance.Cost_test.global + 5 ⋅ (1+max(0, codetoanalyze.java.performance.Cost_test.global)), OnUIThread:false, [{1+max(0, codetoanalyze.java.performance.Cost_test.global)},Loop at line 203,{codetoanalyze.java.performance.Cost_test.global},Loop at line 203]
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.main_bad():int, 271, OnUIThread:false, []
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.mult_symbols_quadratic(int,int):void, 6 + 6 ⋅ x × y, OnUIThread:false, [{y},Loop at line 211,{x},Loop at line 211]
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.quadratic(int):void, 6 + 6 ⋅ x², OnUIThread:false, [{x},Loop at line 221,{x},Loop at line 221]
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.rand():boolean, 9, OnUIThread:false, []
codetoanalyze/java/performance/Cost_test.java, codetoanalyze.java.performance.Cost_test.unitCostFunction():void, 1, OnUIThread:false, []
codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performance.Cost_test_deps.<init>(), 3, OnUIThread:false, []
@ -167,7 +166,7 @@ codetoanalyze/java/performance/EnumTest.java, MyEnum.<init>(java.lang.String,int
codetoanalyze/java/performance/EnumTest.java, MyEnum.valueOf(java.lang.String):MyEnum, 7, OnUIThread:false, []
codetoanalyze/java/performance/EnumTest.java, MyEnum.values():MyEnum[], 7, OnUIThread:false, []
codetoanalyze/java/performance/EvilCfg.java, EvilCfg.<init>(), 3, OnUIThread:false, []
codetoanalyze/java/performance/EvilCfg.java, EvilCfg.foo(int,int,boolean):void, , OnUIThread:false, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/EvilCfg.java, EvilCfg.foo_FP(int,int,boolean):void, , OnUIThread:false, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/FieldAccess.java, codetoanalyze.java.performance.FieldAccess$Test.<init>(codetoanalyze.java.performance.FieldAccess), 6, OnUIThread:false, []
codetoanalyze/java/performance/FieldAccess.java, codetoanalyze.java.performance.FieldAccess.<init>(), 3, OnUIThread:false, []
codetoanalyze/java/performance/FieldAccess.java, codetoanalyze.java.performance.FieldAccess.iterate_upto_field_size(codetoanalyze.java.performance.FieldAccess$Test):void, 6 + 6 ⋅ test.a, OnUIThread:false, [{test.a},Loop at line 16]
@ -199,10 +198,10 @@ codetoanalyze/java/performance/IntTest.java, IntTest.intValue_linear(java.lang.I
codetoanalyze/java/performance/IntTest.java, IntTest.static_Integer_top():void, , OnUIThread:false, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/IntTest.java, IntTest.valueOf_linear(int):void, 8 + 5 ⋅ p + 3 ⋅ (1+max(0, p)), OnUIThread:false, [{1+max(0, p)},Loop at line 20,{p},Loop at line 20]
codetoanalyze/java/performance/Invariant.java, Invariant.<init>(), 3, OnUIThread:false, []
codetoanalyze/java/performance/Invariant.java, Invariant.do_while_invariant(int,int):void, 5 + 3 ⋅ (k - 1) + 4 ⋅ (max(1, k)), OnUIThread:false, [{max(1, k)},Loop at line 58,{k - 1},Loop at line 58]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, , OnUIThread:false, [Unbounded loop,Loop at line 31]
codetoanalyze/java/performance/Invariant.java, Invariant.list_size_invariant(java.util.List):void, 5 + 5 ⋅ items.length + 3 ⋅ (items.length + 1), OnUIThread:false, [{items.length + 1},Loop at line 66,{items.length},Loop at line 66]
codetoanalyze/java/performance/Invariant.java, Invariant.local_not_invariant_FP(int):void, 7 + 12 ⋅ (size + 5) + 7 ⋅ (size + 5) × (5+min(1, size)) + 4 ⋅ (5+min(0, size)), OnUIThread:false, [{5+min(0, size)},Loop at line 46,{5+min(1, size)},Loop at line 46,{size + 5},Loop at line 46]
codetoanalyze/java/performance/Invariant.java, Invariant.do_while_invariant(int,int):void, 5 + 3 ⋅ (k - 1) + 4 ⋅ (max(1, k)), OnUIThread:false, [{max(1, k)},Loop at line 55,{k - 1},Loop at line 55]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, , OnUIThread:false, [Unbounded loop,Loop at line 29]
codetoanalyze/java/performance/Invariant.java, Invariant.list_size_invariant(java.util.List):void, 5 + 5 ⋅ items.length + 3 ⋅ (items.length + 1), OnUIThread:false, [{items.length + 1},Loop at line 61,{items.length},Loop at line 61]
codetoanalyze/java/performance/Invariant.java, Invariant.local_not_invariant_FP(int):void, 7 + 12 ⋅ (size + 5) + 7 ⋅ (size + 5) × (5+min(1, size)) + 4 ⋅ (5+min(0, size)), OnUIThread:false, [{5+min(0, size)},Loop at line 43,{5+min(1, size)},Loop at line 43,{size + 5},Loop at line 43]
codetoanalyze/java/performance/Invariant.java, Invariant.x_is_invariant_ok(int):void, 12 + 6 ⋅ (size + 20), OnUIThread:false, [{size + 20},Loop at line 19]
codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.<clinit>():void, 83, OnUIThread:false, []
codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.<init>(java.lang.String,int), 5, OnUIThread:false, []

@ -1,17 +1,16 @@
codetoanalyze/java/performance/Array.java, codetoanalyze.java.performance.Array.array_access_overrun_constant():void, 4, BUFFER_OVERRUN_L2, no_bucket, ERROR, [<Offset trace>,Assignment,<Length trace>,Array declaration,Array access: Offset: [2, 8] Size: 8]
codetoanalyze/java/performance/Array.java, codetoanalyze.java.performance.Array.call_gen_and_iter_types_linear_FP(int,int):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 88]
codetoanalyze/java/performance/Array.java, codetoanalyze.java.performance.Array.call_gen_and_iter_types_linear_FP(int,int):void, 3, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add3_overrun_bad():void, 5, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 4 Size: 3]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_addAll_bad():void, 10, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 5 Size: 4]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_overrun_bad():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: 1 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_underrun_bad():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: -1 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_overrun_bad():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 2 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_underrun_bad():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset: 0 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_bad():void, 5, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset: 1 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_in_loop_Good():void, 6, BUFFER_OVERRUN_L5, no_bucket, ERROR, [<Offset trace>,Assignment,<Length trace>,Set array size,Array access: Offset: [0, 9] Size: [0, 10]]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_overrun_bad():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 1 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_overrun_bad():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 1 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_underrun_bad():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset: 0 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add3_overrun_constant():void, 5, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 4 Size: 3]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_addAll_constant():void, 10, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 5 Size: 4]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_overrun_constant():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: 1 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_underrun_constant():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: -1 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_overrun_constant():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 2 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_get_underrun_constant():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset: 0 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_in_loop_constant():void, 6, BUFFER_OVERRUN_L5, no_bucket, ERROR, [<Offset trace>,Assignment,<Length trace>,Set array size,Array access: Offset: [0, 9] Size: [0, 10]]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_remove_overrun_constant():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 1 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_overrun_constant():void, 3, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Array access: Offset: 1 Size: 1]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_set_underrun_constant():void, 2, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset: 0 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.empty_list_constant(int):void, 3, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.substitute_array_block_linear(java.util.ArrayList,java.util.ArrayList):void, 8, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [Parameter `b.elements[*]`,Call,Parameter `a.elements[*]`,Through,Through,Call,<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32 by call to `void ArrayListTest.iterate_over_arraylist(ArrayList)` ]
codetoanalyze/java/performance/CantHandle.java, CantHandle.square_root_FP(int):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 17]
@ -22,7 +21,7 @@ codetoanalyze/java/performance/CantHandle.java, CantHandle.square_root_variant_F
codetoanalyze/java/performance/CollectionTest.java, CollectionTest$MyEnumType$1.<init>(), 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/CollectionTest.java, CollectionTest$MyEnumType.<clinit>():void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to CollectionTest$MyEnumType$1.<init>(),Unbounded loop,Loop at line 88]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptyList_constant():void, 1, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptySet_zero():void, 2, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.emptySet_constant():void, 2, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/CollectionsTest.java, CollectionsTest.globalEmptyList_constant():void, 1, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/Compound_loop.java, codetoanalyze.java.performance.Compound_loop.compound_while(int):int, 3, CONDITION_ALWAYS_TRUE, no_bucket, WARNING, [Here]
codetoanalyze/java/performance/Compound_loop.java, codetoanalyze.java.performance.Compound_loop.nested_while_and_or(int):int, 3, CONDITION_ALWAYS_TRUE, no_bucket, WARNING, [Here]
@ -38,14 +37,14 @@ codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performan
codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performance.Cost_test_deps.loop_no_dep2(int):int, 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performance.Cost_test_deps.real_while():int, 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Assignment,<RHS trace>,Assignment,Binary operation: ([0, +oo] + [0, 29]):signed32]
codetoanalyze/java/performance/Cost_test_deps.java, codetoanalyze.java.performance.Cost_test_deps.two_loops():int, 5, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([3, +oo] + 1):signed32]
codetoanalyze/java/performance/EvilCfg.java, EvilCfg.foo(int,int,boolean):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/EvilCfg.java, EvilCfg.foo_FP(int,int,boolean):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/InheritanceTest.java, InheritanceTest$UniqueImpl4.top_cost(InheritanceTest$MyInterface3):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 58]
codetoanalyze/java/performance/InheritanceTest.java, InheritanceTest$UniqueImpl4.top_cost(InheritanceTest$MyInterface3):void, 1, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant(int,int):void, 4, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32]
codetoanalyze/java/performance/IntTest.java, IntTest.control_var_band_add_constant(int,int):void, 6, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Parameter `x`,Binary operation: ([-oo, +oo] + 1):signed32]
codetoanalyze/java/performance/IntTest.java, IntTest.static_Integer_top():void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 15]
codetoanalyze/java/performance/IntTest.java, IntTest.static_Integer_top():void, 1, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Assignment,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 31]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop at line 29]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, 2, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Parameter `x`,<RHS trace>,Parameter `x`,Binary operation: (size + [min(0, x), max(0, x)]):signed32]
codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP(int,int):void, 6, INTEGER_OVERFLOW_L5, no_bucket, ERROR, [<LHS trace>,Parameter `x`,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/JsonArray.java, libraries.marauder.analytics.utils.json.JsonArray.addStringEntry(java.lang.String):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to void JsonUtils.serialize(StringBuilder,String),Call to void JsonUtils.escape(StringBuilder,String),Unbounded loop,Loop at line 13]

Loading…
Cancel
Save