a framework for automated test mocking of mobile apps
play

A Framework for Automated Test Mocking of Mobile Apps Mattia - PowerPoint PPT Presentation

A Framework for Automated Test Mocking of Mobile Apps Mattia Fazzini Alessandra Gorla Alessandro Orso Mobile Applications Testing Software Environment Testing in this Type of Software Environment Flaky Tests Slow Tests Interference Bugs


  1. A Framework for Automated Test Mocking of Mobile Apps Mattia Fazzini Alessandra Gorla Alessandro Orso

  2. Mobile Applications

  3. Testing

  4. Software Environment

  5. Testing in this Type of Software Environment Flaky Tests Slow Tests Interference Bugs Exec 1 Exec 2 Exec 3 App Dependency Test 1 Test 2 Test 3 Test 4 Test 5 Test 6

  6. Test Mocks App Test Execution Server Network

  7. Test Mocks App Developer Test Execution Test Mock

  8. Test Mocks App Developer Test Execution Test Mock Time-consuming Error-prone Too Specific

  9. M OKA Overview Use iterative Collect mock data approach based on from test executions program synthesis to generate test mocks

  10. Mock Data Collection App Mock Data App Mocked entity Test Mock input Execution Mock output Test Suite Mock components Interaction Point Mock coverage Network Server

  11. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  12. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  13. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  14. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  15. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  16. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  17. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  18. Test Mock Generation Iterative Mock Generation Process Group mock data by mocked entity Generated record-and-replay-based mock App Generate test mock through program synthesis Limit synthesis components to mock components Size of synthesized program ≤ size of modeled method Constraint composition of AST nodes during synthesis Test Mock Generate new mock data Input generation based on concolic execution Test executions from other apps

  19. Preliminary Empirical Study Analyzed tests and test mocks in mobile apps F-Droid GitHub 1,220 Apps 20% of the apps have tests, for a total of 11,487 tests

  20. Preliminary Empirical Study - Test Mocks Name Tests TMs AFTMs ATMs TLPTMs TMs = Test Mocks AFTMs = Android Framework Test Mocks C INE L OG 152 285 23 210 52 ATMs = App Test Mocks E VENTYAY 477 268 111 146 11 TLPTMs = Third-party Library Test Mocks W I F I A NALYZER 708 206 91 85 30 K-9 M AIL 536 135 20 104 11 M ATERIALISTIC 312 97 24 49 24 SMS B ACKUP + 217 75 11 53 11 30% of the test mocks model the Android framework DNS66 66 60 45 15 0 A NKI D ROID 248 38 26 11 1 SMSSync 23 32 2 16 14 41% model Android framework+third party libraries L OOP H ABIT 277 32 0 32 0 C OMMONS 21 32 30 2 0 O PEN K EYCHAIN 217 30 15 15 0 W IKIPEDIA 365 24 0 24 0 W EB O PAC 16 23 8 14 1 P AGE T URNER 24 20 1 19 0 O PEN F OOD F ACTS 155 20 2 18 0 F REE OTP 28 19 19 0 0 OANDBACKUP 57 3 3 15 0 C ALCULATE ! 101 9 9 8 0 A NY M EMO 139 1 1 14 0 4139 1446 441 850 155

  21. Future Work Implement MOKA for Android apps Evaluate MOKA on real-world apps Evaluate re-use across versions and with new tests Evaluate time savings of MOKA’s test mocks

  22. Summary

Recommend


More recommend