Search-Based Crash Reproduction

In order to aid software developers in debugging, we developed EvoCrash, a search-based approach to automated crash reproduction. EvoCrash receives a Java crash stack trace, and searches for a unit test case that can reproduce the crash. Our primary results show that the approach is capable of reproducing over 80% of the reported crashes. Thus EvoCrash outperforms the state-of-the-art crash reproduction techniques based on crash stack trace data.

Explore Test CasesTry EvoCrashAccess the Publication

ACC-331 is among the cases that were successfully covered by EvoCrash. Thus for ACC-331, not only EvoCrash can produce a test case that mimics the reported crash stack trace, but also the generated test case reveals the buggy frame level, thereby being useful for debugging the target software.

More specifically, in this case, CollatingIterator is the target class, which does not fulfill the expected behavior as reported in the associated JavaDoc. According to the provided description in the JavaDoc, in case a null comparator is used to create an object of CollatingIterator, a natural ordering shall be used to sort the items of the iterator. However, when a null comparator is used, a NullPointerException is thrown instead.

As the code illustrates, the generated test by EvoCrash creates the iterator objects required to create an object of CollatingIterator. However, instead of creating a comparator object, the test passes a null value as the first argument to the constructor of CollatingIterator, thus causing the target crash to be re-generated successfully.

java.lang.NullPointerException: 
    at org.apache.commons.collections.iterators.CollatingIterator.least(CollatingIterator.java:333)
    at org.apache.commons.collections.iterators.CollatingIterator.next(CollatingIterator.java:229)
public void test0() throws Throwable {
    CollatingIterator collatingIterator0 = new CollatingIterator();
    LinkedList<Object> linkedList0 = new LinkedList<Object>();
    linkedList0.add((Object) collatingIterator0);
    Iterator<Object> iterator0 = linkedList0.iterator();
    Iterator<Object> iterator1 = linkedList0.iterator();
    collatingIterator0.addIterator(iterator1);
    CollatingIterator collatingIterator1 = new CollatingIterator((Comparator) null, (Iterator) iterator0, (Iterator) collatingIterator0);
    collatingIterator1.next();
}