Regression for Minimizing Android GUI Test Suites

Regression for Minimizing Android GUI Test Suites

innovative android app ideas 2020 for students

innovative android app ideas 2020 for students

We observed that the set of traces generated by an automatedtesting tool has many redundancies. Our technique for GUI testsuite reduction tries to remove these redundancies. We next describethese redundancies using a series of examples

Redundant Traces.Among the traces in a test suite, thecoverage provided by some traces is a subset of coverage providedby the remaining traces. Such traces can be removed from the testsuite without decreasing the cumulative coverage. Our techniquefinds such redundant traces and removes them from the test suite.

Redundant Loops.We also observed that there could beredundancies within a trace, for example, if the trace contains aredundant loop. A loop in a trace is a sub-trace of the trace thatbegins and ends in the same abstract state. Traces generated byautomated testing tools tend to contain many loops, and some suchloops do not provide additional coverage over the coverage that canbe achieved by the trace without the loop and the remaining traces.Such loops are redundant and can be removed from the trace if theresulting trace can be replayed. innovative android app ideas 2020 for students We next illustrate such redundantloops using a couple of examples.All examples utilize the file browser app shown in Figure 1. Whenthe app starts, it shows the root directory (abstract state/screens0).In this initial state/screen, a user can invoke a pop-up menu (s1)bytouching the menu button on the screen (the button at the top-rightcorner with three dot characters). Once the menu is visible, the usercan close the menu by touching the same button. Selecting an itemon the menu results in a completely different abstract state/screenof the app. Pressing the Option button leads the app to the optionscreen (s2).

edundant Trace Fragments.While analyzing traces inautomatically generated test suites of several apps, we observedthat many traces share common sub-traces. If we execute thesetraces, the common sub-traces get executed multiple times (oncefor each trace) but new coverage is only achieved when a commonsub-trace is executed for the first time. We can avoid redundantexecution of these common sub-traces if we can combine fragmentsof traces in a manner that avoids repetitions of common sub-traces.Combining fragments of traces will also result in longer traces. Suchlonger traces will reduce the number of restarts, which are moreexpensive operations than triggering an action. The next exampledescribes how common sub-traces contribute to redundancy.

State abstraction.In our discussion so far, we assumed we havea suitable state abstraction that enables us to cluster similar-lookingscreens. The performance of our technique for test reduction de-pends heavily on our choice of state abstraction. If we choose afine-grained abstraction, then our technique runs faster, but maymiss many opportunities for reduction. On the other hand, if we pick a coarse-grained abstraction, many of the traces that our tech-nique constructs become non-replayable. Therefore, our techniquespends more time in checking replayability of various traces, but weget a bigger reduction. We observed that a human tester can easilyidentify screens that are similar by analyzing what is visible on thescreen. Ideally we needed an abstraction that judges that two appscreens to be the same if and only if a human tester finds the twoscreens visually identical. After analyzing several apps, we pickeda state abstraction based on information from the GUI componenttree. The details of the abstraction are described in Section 4.Removing redundancies.We propose a two-phase algorithmto remove redundancies from a GUI test suite. https://codeshoppy.com/android-app-ideas-for-students-college-project.html The first phase re-moves redundant traces and redundant loops greedily. It first re-moves redundant traces by greedily selecting traces such that eachselected trace contributes new coverage to the coverage of the set ofalready selected traces. The non-selected traces are then redundantand are removed from the test suite. It then removes redundantloops from each remaining trace. In order to remove redundantloops in a trace, the algorithm creates the set of all traces obtainedfrom the trace by removing zero or more loops. It then selectsa trace from the set that does not decrease cumulative coverage,lowers cost of the trace maximally, and is replayable. Such a tracereplaces the original trace in the test suite.The second phase removes redundant trace fragments as muchas possible. For that it constructs a new set of traces by combiningfragments of the traces in the set computed by the first phase. Whensplicing trace fragments, we found it useful to limit the number offragments in spliced trace to a small number (three in our case),because a trace composed of many fragments tends to be non-replayable in practice. Thus, the second phase of the algorithm firstcreates the set of candidate traces composed of a bounded numberof trace fragments. It then constructs a new test suite by greedilyselecting traces from the set of candidate traces.In both phases, whenever our algorithm generates a new trace, itchecks whether the trace is replayable or not by executing it a fewtimes. This prevents the algorithm from adding a non-replayabletrace to the resulting regression test suite. If the algorithm findsa trace to be non-replayable, it identifies and saves the shortestnon-replayable prefix of the trace. In the future, if the algorithmfinds that a new trace starts with one of these saved prefixes, thenit can safely infer that the trace is non-replayable and discard it.This optimization helps the algorithm aggressively discard somenon-replayable traces without executing them multiple times.