in Android apps Shin Hwei Zhen Xiang Abhik Tan Dong Gao - - PowerPoint PPT Presentation

in android apps
SMART_READER_LITE
LIVE PREVIEW

in Android apps Shin Hwei Zhen Xiang Abhik Tan Dong Gao - - PowerPoint PPT Presentation

Repairing crashes in Android apps Shin Hwei Zhen Xiang Abhik Tan Dong Gao Roychoudhury 2 Prevalence of Mobile Apps App Store Google Play Launched with 500 apps. 3.5 millions apps By July 17, 10 millions available for download apps


slide-1
SLIDE 1

Repairing crashes in Android apps

Shin Hwei Tan Zhen Dong Xiang Gao Abhik Roychoudhury

slide-2
SLIDE 2

Prevalence of Mobile Apps

2008 2017 2021 1994 2008 IBM Simon

First device that features apps like calendar & calculator.

App Store

Launched with 500 apps. By July 17, 10 millions apps downloaded.

Android Market

Launched with 50 apps.

Google Play

3.5 millions apps available for download in December 2017.

Apps Popularity

Total app downloads number will jump to 352 billion.

➢ Mobile apps are indispensable ➢ Android app maintenance is a long-standing problem ➢ 62% of app users experienced a crash, freeze/error

2

slide-3
SLIDE 3

Problem: Fixing Crashes in Android Apps

Challenges for repair techniques:

  • Source code for Android apps is often unavailable.
  • Positive UI tests that encode program functionality are often

unavailable.

  • Negative UI test that encode the crashing behavior may be flaky.

Challenges for human developers:

  • Inadequate understanding of Android development
  • Complexity of Android Activity lifecycle

3

slide-4
SLIDE 4

Problem: Fixing Crashes in Android Apps

Challenges for repair techniques:

  • Source code for Android apps is often unavailable.
  • Positive UI tests that encode program functionality are often

unavailable.

  • Negative UI test that encode the crashing behavior may be flaky.

Challenges for human developers:

  • Inadequate understanding of Android development
  • Complexity of Android Activity lifecycle

4

Automated Repair of Crashes in Android app: Given a buggy app and UI sequence S that leads to a crash, find a app that does not crash on S.

slide-5
SLIDE 5

Summary of Droix

  • Evolves Android apps using a single UI sequence
  • Property violations checker at multiple levels:
  • Pre-execution (Code level)
  • Encode exception handling best practices
  • Static analysis
  • During Execution (Test level)
  • Encode Android Activity/Fragment lifecycle models.
  • New lifecycle-aware repair operators for fixing Android apps

5

slide-6
SLIDE 6

✓ Long-standing problem ✓ A succession of increasingly better human-created solutions ✓ Result is equal to or better than human-created solution (E) The result is equal to or better than the most recent human-created solution to a long-standing problem for which there has been a succession of increasingly better human-created solutions.

6

slide-7
SLIDE 7

High Commercial Value: Patent In Progress

  • Collaboration with Singapore Telecommunications Limited (Singtel)
  • Largest mobile network operator in Singapore
  • Prior art search report by our patent attorney: “No previous invention
  • ffers the same features”

(A) The result was patented as an invention in the past, is an improvement over a patented invention,

  • r would qualify today as a patentable new invention.

7

slide-8
SLIDE 8

EA for Android apps

  • (𝜈 + λ) Evolutionary Algorithm, 𝜈 = 40 and λ = 20
  • Constraints for Code-level & Test-level Properties:
  • Hard Constraints: eliminate patches if property is violated
  • Soft Constraints: possible property violation
  • Fitness Function f:

f = Minimize # of violations for soft constraints (D) The result is publishable in its own right as a new scientific result independent of the fact that the result was mechanically created

8

slide-9
SLIDE 9

Empirical Evaluation

K-9 Mail Fdroid PoetAssistant AnkiDroid ConnectBot ......

24 crashes in 15 mobile apps ▪ Fixes15 crashes: >50% ▪ 12 fixes are of comparable quality to human-created fixes ▪ Sometimes better than human- crafted fix! ▪ 3 fixes are incorrect and they are complex to fix ▪ Potential future improvement Benchmark: Droixbench

9

slide-10
SLIDE 10

Human Competitive

10

slide-11
SLIDE 11

Human Competitive

Patch generated by Droix

10

slide-12
SLIDE 12

Human Competitive

Patch generated by Droix

10

slide-13
SLIDE 13

Human Competitive

Patch generated by Droix Patch crafted by human

10

slide-14
SLIDE 14

Human Competitive

Patch generated by Droix Patch crafted by human

10

slide-15
SLIDE 15

Human Competitive

Patch generated by Droix Patch crafted by human

10

slide-16
SLIDE 16

Human Competitive

Patch generated by Droix Patch crafted by human

10

slide-17
SLIDE 17

Human Competitive

Patch generated by Droix Patch crafted by human

10

slide-18
SLIDE 18

Human Competitive

Patch generated by Droix Patch crafted by human ➢ <17minutes to fix

➢ 2 days to fix ➢ Resolved 9 months later

10

slide-19
SLIDE 19

Human Competitive

Patch generated by Droix Patch crafted by human ➢ <17minutes to fix

➢ 2 days to fix ➢ Resolved 9 months later

10

slide-20
SLIDE 20

Human Competitive

Patch generated by Droix Patch crafted by human ➢ <17minutes to fix

➢ 2 days to fix ➢ Resolved 9 months later

10

slide-21
SLIDE 21

Wide applicability of our results

Repair for everyone

✓ Could be used by any smartphone user ✓ Doesn’t require source code ✓ No prior knowledge of Android app ✓ No prior experience of running tests

Developer App users

UI sequence

Bug report Buggy APK Fixed APK

Droix

11

slide-22
SLIDE 22

Conclusion

  • Technical Contributions:
  • EA for fixing Android apps without source code & heavy test suite
  • Specialized operators for Android apps
  • Droixbench: systematic evaluation
  • High Commercial Value: Patent-filling with Singtel
  • Practicality: Crashes in Android apps affect all app users.
  • Human-competitive: Our approach could generate patches that

are not only of comparable quality to human patches, but could also outperform human patch.

12