[jira] [Created] (PRIMITIVES-16) Bug in class#ShortList/DoubleList (?) with reproducible JUnit test

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (PRIMITIVES-16) Bug in class#ShortList/DoubleList (?) with reproducible JUnit test

ASF GitHub Bot (Jira)
Bug in class#ShortList/DoubleList (?) with reproducible JUnit test
------------------------------------------------------------------

                 Key: PRIMITIVES-16
                 URL: https://issues.apache.org/jira/browse/PRIMITIVES-16
             Project: Commons Primitives
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: jdk 1.6.0
            Reporter: Sai Zhang
         Attachments: ApachePrimitive_Documented_Test.java

Hi all:


I am writing an automated bug finding tool, and using
Apache Commons Primitives as an experimental subject
for evaluation.

The tool creates executable JUnit tests as well as
explanatory code comments. I attached one bug-revealing
test as follows. Could you please kindly check it, to
see if it is a real bug or not?

Also, it would be tremendous helpful if you could give
some feedback and suggestion on the quality of generated code comments?
Is the automatically-inferred comment useful in understanding
the generated test? is the comment helpful in bug fixing?
Particularly when the automatically-generated tests
are often long.

Your suggestion will help us improve the tool.

Please see attachment for the failed test.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (PRIMITIVES-16) Bug in class#ShortList/DoubleList (?) with reproducible JUnit test

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/PRIMITIVES-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sai Zhang updated PRIMITIVES-16:
--------------------------------

    Description:
Hi all:


I am writing an automated bug finding tool, and using
Apache Commons Primitives as an experimental subject
for evaluation.

The tool creates executable JUnit tests as well as
explanatory code comments. I attached one bug-revealing
test as follows. Could you please kindly check it, to
see if it is a real bug or not?

Also, it would be tremendous helpful if you could give
some feedback and suggestion on the quality of generated code comments?
Is the automatically-inferred comment useful in understanding
the generated test? is the comment helpful in bug fixing?
Particularly when the automatically-generated tests
are often long.

Your suggestion will help us improve the tool.

Please see attachment for the failed test.

The comment appears in the form of:
//Tests pass if .... (it gives some small change to the test which can make the failed test pass)


  was:
Hi all:


I am writing an automated bug finding tool, and using
Apache Commons Primitives as an experimental subject
for evaluation.

The tool creates executable JUnit tests as well as
explanatory code comments. I attached one bug-revealing
test as follows. Could you please kindly check it, to
see if it is a real bug or not?

Also, it would be tremendous helpful if you could give
some feedback and suggestion on the quality of generated code comments?
Is the automatically-inferred comment useful in understanding
the generated test? is the comment helpful in bug fixing?
Particularly when the automatically-generated tests
are often long.

Your suggestion will help us improve the tool.

Please see attachment for the failed test.




> Bug in class#ShortList/DoubleList (?) with reproducible JUnit test
> ------------------------------------------------------------------
>
>                 Key: PRIMITIVES-16
>                 URL: https://issues.apache.org/jira/browse/PRIMITIVES-16
>             Project: Commons Primitives
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: jdk 1.6.0
>            Reporter: Sai Zhang
>         Attachments: ApachePrimitive_Documented_Test.java
>
>
> Hi all:
> I am writing an automated bug finding tool, and using
> Apache Commons Primitives as an experimental subject
> for evaluation.
> The tool creates executable JUnit tests as well as
> explanatory code comments. I attached one bug-revealing
> test as follows. Could you please kindly check it, to
> see if it is a real bug or not?
> Also, it would be tremendous helpful if you could give
> some feedback and suggestion on the quality of generated code comments?
> Is the automatically-inferred comment useful in understanding
> the generated test? is the comment helpful in bug fixing?
> Particularly when the automatically-generated tests
> are often long.
> Your suggestion will help us improve the tool.
> Please see attachment for the failed test.
> The comment appears in the form of:
> //Tests pass if .... (it gives some small change to the test which can make the failed test pass)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (PRIMITIVES-16) Bug in class#ShortList/DoubleList (?) with reproducible JUnit test

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/PRIMITIVES-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sai Zhang updated PRIMITIVES-16:
--------------------------------

    Attachment: ApachePrimitive_Documented_Test.java

> Bug in class#ShortList/DoubleList (?) with reproducible JUnit test
> ------------------------------------------------------------------
>
>                 Key: PRIMITIVES-16
>                 URL: https://issues.apache.org/jira/browse/PRIMITIVES-16
>             Project: Commons Primitives
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: jdk 1.6.0
>            Reporter: Sai Zhang
>         Attachments: ApachePrimitive_Documented_Test.java
>
>
> Hi all:
> I am writing an automated bug finding tool, and using
> Apache Commons Primitives as an experimental subject
> for evaluation.
> The tool creates executable JUnit tests as well as
> explanatory code comments. I attached one bug-revealing
> test as follows. Could you please kindly check it, to
> see if it is a real bug or not?
> Also, it would be tremendous helpful if you could give
> some feedback and suggestion on the quality of generated code comments?
> Is the automatically-inferred comment useful in understanding
> the generated test? is the comment helpful in bug fixing?
> Particularly when the automatically-generated tests
> are often long.
> Your suggestion will help us improve the tool.
> Please see attachment for the failed test.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (PRIMITIVES-16) Bug in class#ShortList/DoubleList (?) with reproducible JUnit test

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/PRIMITIVES-16?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086729#comment-13086729 ]

Sai Zhang commented on PRIMITIVES-16:
-------------------------------------

Hi,

Here is the latest output of our documentation inference tool. It renames all
variable names and (hopefully) makes the test easier to read.

The comments generated by our research tool are shown in the form of:

{code}
//Test passes if:  xxxx (it indicates changes that will make a failed test pass)
{code}

Each piece of comments (not the combination of them) provides a way to correct the failed test.
We hope such additional information will help developers understand/fix the test faster/better.

So, it would be great if anyone can take a look at the reported bug to:
(1) confirm is it a real bug?
(2) is such comment information useful? If not, please give us feedback so we can do our best
to improve our tool!

Thank you!

-Sai

{code}
import org.apache.commons.collections.primitives.AbstractCharCollection;
import org.apache.commons.collections.primitives.CharList;
import org.apache.commons.collections.primitives.adapters.ListDoubleList;
import java.util.List;
import org.apache.commons.collections.primitives.ShortCollections;
import org.apache.commons.collections.primitives.DoubleCollections;
import java.lang.String;
import org.apache.commons.collections.primitives.DoubleList;
import org.apache.commons.collections.primitives.RandomAccessCharList;
import org.apache.commons.collections.primitives.CharCollection;
import org.apache.commons.collections.primitives.ShortList;
import org.apache.commons.collections.primitives.adapters.CharListList;
import org.apache.commons.collections.primitives.adapters.DoubleListList;
import org.apache.commons.collections.primitives.ArrayCharList;
import org.apache.commons.collections.primitives.adapters.ListShortList;

import junit.framework.TestCase;
public class ApachePrimitive_Documented_Test_Pretty extends TestCase {
  public void test0() {
    Integer i0 = new Integer(10);
    ArrayCharList arrayCharList0 = new ArrayCharList(i0);
    Integer i1 = new Integer(10);
    ArrayCharList arrayCharList1 = new ArrayCharList(i1);
    Character char0 = new Character('#');
    int i2 = arrayCharList1.indexOf(char0);
    Character char1 = new Character('4');
    boolean b0 = arrayCharList1.contains(char1);
    CharListList charListList0 = new CharListList((CharList)arrayCharList1);
    boolean b1 = arrayCharList0.retainAll((CharCollection)arrayCharList1);
    String str0 = arrayCharList1.toString();
    char[] char_array0 = new char[] { };
    char[] char_array1 = arrayCharList1.toArray(char_array0);
    ArrayCharList arrayCharList2 = new ArrayCharList();
    Integer i3 = new Integer(10);
    ArrayCharList arrayCharList3 = new ArrayCharList(i3);
    Character char2 = new Character('#');
    int i4 = arrayCharList3.indexOf(char2);
    int i5 = arrayCharList2.indexOf(char2);
    boolean b2 = arrayCharList1.add(char2);
    Integer i6 = new Integer(10);
    ArrayCharList arrayCharList4 = new ArrayCharList(i6);
    Integer i7 = new Integer(10);
    ArrayCharList arrayCharList5 = new ArrayCharList(i7);
    Character char3 = new Character('#');
    int i8 = arrayCharList5.indexOf(char3);
    Character char4 = new Character('4');
    boolean b3 = arrayCharList5.contains(char4);
    CharListList charListList1 = new CharListList((CharList)arrayCharList5);
    boolean b4 = arrayCharList4.retainAll((CharCollection)arrayCharList5);
    List list0 = CharListList.wrap((CharList)arrayCharList5);
    Integer i9 = new Integer(10);
    ArrayCharList arrayCharList6 = new ArrayCharList(i9);
    Character char5 = new Character('#');
    int i10 = arrayCharList6.indexOf(char5);
    boolean b5 = arrayCharList5.containsAll((CharCollection)arrayCharList6);
    Integer i11 = new Integer(10);
    ArrayCharList arrayCharList7 = new ArrayCharList(i11);
    Integer i12 = new Integer(10);
    ArrayCharList arrayCharList8 = new ArrayCharList(i12);
    Character char6 = new Character('#');
    int i13 = arrayCharList8.indexOf(char6);
    Character char7 = new Character('4');
    boolean b6 = arrayCharList8.contains(char7);
    CharListList charListList2 = new CharListList((CharList)arrayCharList8);
    boolean b7 = arrayCharList7.retainAll((CharCollection)arrayCharList8);
    boolean b8 = arrayCharList6.removeAll((CharCollection)arrayCharList8);
    int i14 = arrayCharList8.size();
    char char8 = arrayCharList1.get(i14);
    Integer i15 = new Integer(10);
    ArrayCharList arrayCharList9 = new ArrayCharList(i15);
    Integer i16 = new Integer(10);
    ArrayCharList arrayCharList10 = new ArrayCharList(i16);
    Character char9 = new Character('#');
    int i17 = arrayCharList10.indexOf(char9);
    Character char10 = new Character('4');
    boolean b9 = arrayCharList10.contains(char10);
    CharListList charListList3 = new CharListList((CharList)arrayCharList10);
    boolean b10 = arrayCharList9.retainAll((CharCollection)arrayCharList10);
    String str1 = arrayCharList10.toString();
    char[] char_array2 = new char[] { };
    char[] char_array3 = arrayCharList10.toArray(char_array2);
    ArrayCharList arrayCharList11 = new ArrayCharList();
    Integer i18 = new Integer(10);
    ArrayCharList arrayCharList12 = new ArrayCharList(i18);
    Character char11 = new Character('#');
    int i19 = arrayCharList12.indexOf(char11);
    int i20 = arrayCharList11.indexOf(char11);
    boolean b11 = arrayCharList10.add(char11);
    boolean b12 = arrayCharList1.contains(char11);
    //Test passes if charListList4  is changed to type: org.apache.commons.collections.primitives.adapters.DoubleListList, with value: [].
    //Current value: #
    CharListList charListList4 = new CharListList((CharList)arrayCharList1);
    ListShortList listShortList0 = new ListShortList((List)charListList4);
    //Test passes if shortList0 is type: org.apache.commons.collections.primitives.adapters.ListShortList, an example value: [].
    //Current value: #
    ShortList shortList0 = ShortCollections.unmodifiableShortList((ShortList)listShortList0);
   
    // Checks the contract:  shortList0.equals(shortList0)
    assertTrue("Contract failed: shortList0.equals(shortList0)", shortList0.equals(shortList0));
  }
  public void test1() {
    Integer i0 = new Integer(10);
    ArrayCharList arrayCharList0 = new ArrayCharList(i0);
    Integer i1 = new Integer(10);
    ArrayCharList arrayCharList1 = new ArrayCharList(i1);
    Character char0 = new Character('#');
    int i2 = arrayCharList1.indexOf(char0);
    Character char1 = new Character('4');
    boolean b0 = arrayCharList1.contains(char1);
    CharListList charListList0 = new CharListList((CharList)arrayCharList1);
    boolean b1 = arrayCharList0.retainAll((CharCollection)arrayCharList1);
    String str0 = arrayCharList1.toString();
    char[] char_array0 = new char[] { };
    char[] char_array1 = arrayCharList1.toArray(char_array0);
    ArrayCharList arrayCharList2 = new ArrayCharList();
    Integer i3 = new Integer(10);
    ArrayCharList arrayCharList3 = new ArrayCharList(i3);
    Character char2 = new Character('#');
    int i4 = arrayCharList3.indexOf(char2);
    int i5 = arrayCharList2.indexOf(char2);
    boolean b2 = arrayCharList1.add(char2);
    Integer i6 = new Integer(10);
    ArrayCharList arrayCharList4 = new ArrayCharList(i6);
    Integer i7 = new Integer(10);
    ArrayCharList arrayCharList5 = new ArrayCharList(i7);
    Character char3 = new Character('#');
    int i8 = arrayCharList5.indexOf(char3);
    Character char4 = new Character('4');
    boolean b3 = arrayCharList5.contains(char4);
    CharListList charListList1 = new CharListList((CharList)arrayCharList5);
    boolean b4 = arrayCharList4.retainAll((CharCollection)arrayCharList5);
    List list0 = CharListList.wrap((CharList)arrayCharList5);
    Integer i9 = new Integer(10);
    ArrayCharList arrayCharList6 = new ArrayCharList(i9);
    Character char5 = new Character('#');
    int i10 = arrayCharList6.indexOf(char5);
    boolean b5 = arrayCharList5.containsAll((CharCollection)arrayCharList6);
    Integer i11 = new Integer(10);
    ArrayCharList arrayCharList7 = new ArrayCharList(i11);
    Integer i12 = new Integer(10);
    ArrayCharList arrayCharList8 = new ArrayCharList(i12);
    Character char6 = new Character('#');
    int i13 = arrayCharList8.indexOf(char6);
    Character char7 = new Character('4');
    boolean b6 = arrayCharList8.contains(char7);
    CharListList charListList2 = new CharListList((CharList)arrayCharList8);
    boolean b7 = arrayCharList7.retainAll((CharCollection)arrayCharList8);
    boolean b8 = arrayCharList6.removeAll((CharCollection)arrayCharList8);
    int i14 = arrayCharList8.size();
    char char8 = arrayCharList1.get(i14);
    Integer i15 = new Integer(10);
    ArrayCharList arrayCharList9 = new ArrayCharList(i15);
    Integer i16 = new Integer(10);
    ArrayCharList arrayCharList10 = new ArrayCharList(i16);
    Character char9 = new Character('#');
    int i17 = arrayCharList10.indexOf(char9);
    Character char10 = new Character('4');
    boolean b9 = arrayCharList10.contains(char10);
    CharListList charListList3 = new CharListList((CharList)arrayCharList10);
    boolean b10 = arrayCharList9.retainAll((CharCollection)arrayCharList10);
    String str1 = arrayCharList10.toString();
    char[] char_array2 = new char[] { };
    char[] char_array3 = arrayCharList10.toArray(char_array2);
    ArrayCharList arrayCharList11 = new ArrayCharList();
    Integer i18 = new Integer(10);
    ArrayCharList arrayCharList12 = new ArrayCharList(i18);
    Character char11 = new Character('#');
    int i19 = arrayCharList12.indexOf(char11);
    int i20 = arrayCharList11.indexOf(char11);
    boolean b11 = arrayCharList10.add(char11);
    boolean b12 = arrayCharList1.contains(char11);
    CharListList charListList4 = new CharListList((CharList)arrayCharList1);
    ListShortList listShortList0 = new ListShortList((List)charListList4);
    ShortList shortList0 = ListShortList.wrap((List)charListList4);
    DoubleList doubleList0 = ListDoubleList.wrap((List)charListList4);
    List list1 = DoubleListList.wrap(doubleList0);
    //Test passes if doubleList1 is type: org.apache.commons.collections.primitives.adapters.ListDoubleList, an example value: [-1.0].
    //Current value: #
    DoubleList doubleList1 = DoubleCollections.unmodifiableDoubleList(doubleList0);
   
    // Checks the contract:  doubleList1.equals(doubleList1)
    assertTrue("Contract failed: doubleList1.equals(doubleList1)", doubleList1.equals(doubleList1));
  }

}
{code}

> Bug in class#ShortList/DoubleList (?) with reproducible JUnit test
> ------------------------------------------------------------------
>
>                 Key: PRIMITIVES-16
>                 URL: https://issues.apache.org/jira/browse/PRIMITIVES-16
>             Project: Commons Primitives
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: jdk 1.6.0
>            Reporter: Sai Zhang
>         Attachments: ApachePrimitive_Documented_Test.java
>
>
> Hi all:
> I am writing an automated bug finding tool, and using
> Apache Commons Primitives as an experimental subject
> for evaluation.
> The tool creates executable JUnit tests as well as
> explanatory code comments. I attached one bug-revealing
> test as follows. Could you please kindly check it, to
> see if it is a real bug or not?
> Also, it would be tremendous helpful if you could give
> some feedback and suggestion on the quality of generated code comments?
> Is the automatically-inferred comment useful in understanding
> the generated test? is the comment helpful in bug fixing?
> Particularly when the automatically-generated tests
> are often long.
> Your suggestion will help us improve the tool.
> Please see attachment for the failed test.
> The comment appears in the form of:
> //Tests pass if .... (it gives some small change to the test which can make the failed test pass)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira