systematic testing for resource leaks in android applications

Post on 29-Nov-2014

738 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

The use of mobile devices and the complexity of their software continue to grow rapidly. This growth presents significant challenges for software correctness and performance. In addition to traditional defects, a key consideration are defects related to the limited resources available on these devices. Resource leaks in an application, due to improper management of resources, can lead to slowdowns, crashes, and negative user experience. Despite a large body of existing work on leak detection, testing for resource leaks remains a challenging problem. We propose a novel and comprehensive approach for systematic testing for resource leaks in Android software. Similar to existing testing techniques, the approach is based on a GUI model, but is focused specifically on coverage criteria aimed at resource leak defects. These criteria are based on neutral cycles: sequences of GUI events that should have a "neutral" effect and should not lead to increases in resource usage. We have defined several test coverage criteria based on different categories of neutral cycles in the GUI model. This approach is informed by knowledge of typical causes of resource leaks in Android software. We have also developed LeakDroid, a tool that generates test cases to trigger repeated execution of neutral cycles. When the test cases are executed, resource usage is monitored for suspicious behaviors. The approach has been evaluated on several Android applications. The evaluation demonstrates that the proposed test generation effectively uncovers a variety of resource leaks.

TRANSCRIPT

Systema(c*Tes(ng*for*Resource*Leaks*in*Android*Applica(ons*

PRESTO:(Program(Analyses(and(So5ware(Tools(Research(Group,(Ohio(State(University(

Dacong (Tony) Yan, Shengqian Yang, Atanas Rountev

Ohio State University

Background(•  Android(devices(

•  Currently(lead(the(smartphone(market(•  Direct(impact(on(millions(of(users(•  Require(novel(techniques(for(improved(so5ware(quality(

•  Resource(leaks(•  Examples(of(resources:(memory((managed(or(naIve),(database(cursors,(binders,(bitmaps,(etc.(

•  Slowdowns(and(crashes(•  Limited(resources(on(handheld(devices(

**

An(Example:(APV(

**

Open PDF

Close PDF

NaIve(Memory(ConsumpIon(Comparison(

**

Our(Proposal(•  Challenges:(developing(leakQtriggering(test(cases(and(test(inputs(

•  Insight(•  Leaks(triggered(by(repeated(operaIons(•  Focus(on(neutral(cycles,(repeated(operaIons(that(should(not(increase(resource(usage(

•  ModelQbased(test(generaIon(•  Input:(a(model(for(applicaIon(GUI,(called(GUI(model(•  Generate(test(cases(to(cover(neutral(cycles(in(the(GUI(model(for(leak(discovery(

**

GUI(Model(•  DefiniIon(

•  A(directed(graph(G=(N,(E)(•  N:(GUI(states,(i.e.(GUI(enIIes(and(their(relaIonships(•  E:(transiIons(between(states(triggered(by(events(

**

GUI(Model(for(APV(

GUI(Model(for(APV(

GUI(Model(for(APV(

GUI(Model(•  DefiniIon(

•  A(directed(graph(G=(N,(E)(•  N:(GUI(states,(i.e.(GUI(enIIes(and(their(relaIonships(•  E:(transiIons(between(states(triggered(by(events(

•  Two(categories(of(transiIons(•  ApplicaIonQindependent(•  ApplicaIonQdependent(

**

GUI(Model(for(APV(

Applica5on(Independent(Transi5ons(

GUI(Model(for(APV(

Applica5on(Dependent(Transi5ons(

Coverage(Criteria(• ApplicaIonQindependent(cycles(

• Events(defined(by(the(plaVorm,(and(not(specific(to(individual(applicaIons(

• Example:(ROTATE,(HOME,(POWER(• Cycles(with(BACK(transiIons(

• BACK(transiIon:(going(back(to(a(previous(acIvity(• Opportunity(for(forming(a(cycle(

• ApplicaIonQspecific(neutral(operaIons(• Pairs(of(operaIons(that(“neutralize”(each(other(• Example:(zoomQin(followed(by(zoomQout(

Example(of(a(Generated(Test(Case(

Example(of(a(Generated(Test(Case(

n1 (n2 n3)k

BACK

GUI(Model(for(APV(

GUI(Model(for(APV(

Example(of(a(Generated(Test(Case(

Example(of(a(Generated(Test(Case(

Example(of(a(Generated(Test(Case(

Example(of(a(Generated(Test(Case(

Example(of(a(Generated(Test(Case(

Approach(●  Generate(automaIcally(test(cases(based(on(the(GUI(model,(and(the(targeted(coverage(criteria(●  Followed(by(manual(steps,(e.g.,(to(provide(a(PDF(file(to(be(opened,(and(to(place(it(at(posiIon(3(of(the(file(list(

●  Collect(resource(usage(measurements(as(the(tests(are(being(executed(●  Examples:(managed(heap(size,(naIve(heap(size,(binders,(threads(

●  Drop(“nonQpromising”(cases(for(shorter(execuIon(Ime(●  Report(crashing(execuIons(for(possible(resource(leaks(

**

Experimental(Studies(●  8(openQsource(Android(applicaIons(●  The(generated(test(cases(exposed(18(resource(leak(defects((12(newlyQdiscovered)(●  InvesIgated(manually(the(crashing(test(cases(to(determine(their(root(causes(

●  Detailed(case(studies(to(understand(diversified(causes(of(resource(leaks(●  TradiIonal(leaks((e.g.,(container(leak)(●  Leaking(AndroidQspecific(objects((e.g.,(database(cursors,(binders,(bitmaps)(

●  Leaks(caused(by(naIve(code((e.g.,(improper(management(of(naIve(memory,(hang(in(naIve(code)(**

Conclusions(●  Resource(leaks(are(an(important(problem(for(Android(

●  ModelQbased(test(generaIon(focusing(on(neutral(cycles(is(effecIve(in(detecIng(resource(leaks(

●  Future(work(●  Automated(debugging(of(uncovered(leaks,(using(heap(analysis(

●  Automated(GUI(model(construcIon((iniIal(work(to(appear(at(CGO(2014)(

●  Program(analysis(to(detect(and(diagnose(leaks(staIcally(●  So5ware(release(

●  hfp://www.cse.ohioQstate.edu/presto/so5ware/(**

((

(((((((((((((((((Thank((you(

**

top related