Systematic Testing for Resource Leaks in Android Applications
Upcoming SlideShare
Loading in...5
×
 

Systematic Testing for Resource Leaks in Android Applications

on

  • 634 views

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 ...

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.

Statistics

Views

Total Views
634
Views on SlideShare
634
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Systematic Testing for Resource Leaks in Android Applications Systematic Testing for Resource Leaks in Android Applications Presentation Transcript

    • Systema(c*Tes(ng*for*Resource*Leaks*in*Android* Applica(ons* Dacong (Tony) Yan, Shengqian Yang, Atanas Rountev Ohio State University PRESTO:(Program(Analyses(and(So5ware(Tools(Research(Group,(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 n3)k (n2 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( ●  ●  Collect(resource(usage(measurements(as(the(tests( are(being(executed( ●  ●  ●  ** 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( 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)( ●  ●  Detailed(case(studies(to(understand(diversified( causes(of(resource(leaks( ●  ●  ●  ** InvesIgated(manually(the(crashing(test(cases(to( determine(their(root(causes( 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( ((((((((((((((((( **