skip to main content
research-article

Native-2-native: automated cross-platform code synthesis from web-based programming resources

Published:26 October 2015Publication History
Skip Abstract Section

Abstract

For maximal market penetration, popular mobile applications are typically supported on all major platforms, including Android and iOS. Despite the vast differences in the look-and-feel of major mobile platforms, applications running on these platforms in essence provide the same core functionality. As an application is maintained and evolved, the resulting changes must be replicated on all the supported platforms, a tedious and error-prone programming process. Existing automated source-to-source translation tools prove inadequate due to the structural and idiomatic differences in how functionalities are expressed across major platforms. In this paper, we present a new approach---Native-2-Native---that automatically synthesizes code for a mobile application to make use of native resources on one platform, based on the equivalent program transformations performed on another platform. First, the programmer modifies a mobile application's Android version to make use of some native resource, with a plugin capturing code changes. Based on the changes, the system then parameterizes a web search query over popular programming resources (e.g., Google Code, StackOverflow, etc.), to discover equivalent iOS code blocks with the closest similarity to the programmer-written Android code. The discovered iOS code block is then presented to the programmer as an automatically synthesized Swift source file to further fine-tune and subsequently integrate in the mobile application's iOS version. Our evaluation, enhancing mobile applications to make use of common native resources, shows that the presented approach can correctly synthesize more than 86% of Swift code for the subject applications' iOS versions.

References

  1. A. Bacchelli, L. Ponzanelli, and M. Lanza. Harnessing stack overflow for the IDE. In Proceedings of the Third International Workshop on Recommendation Systems for Software Engineering, RSSE ’12, pages 26–30. IEEE Press, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Bajracharya, J. Ossher, and C. Lopes. Sourcerer: An internet-scale software repository. In Proceedings of the 2009 ICSE Workshop on Search-Driven Development-Users, Infrastructure, Tools and Evaluation, SUITE ’09, pages 1–4. IEEE Computer Society, 2009.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. Breiman. Bagging predictors. Machine Learning, 24(2):123–140, 1996. ISSN 0885-6125.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. F. P. Brooks. No silver bullet: Essence and accidents of software engineering. Computer, 20(4):10–19, apr 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Ghatol and Y. Patel. Beginning PhoneGap: Mobile Web Framework for JavaScript and HTML5. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In Proceedings of the 27th International Conference on Software Engineering, ICSE ’05, pages 117–125. ACM, 2005.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J2ObjC.org. J2objc, 2015.Google ScholarGoogle Scholar
  8. P. Jackson and I. Moulinier. Natural language processing for online applications. Text retrieval, extraction and categorization, volume 5 of Natural Language Processing. Benjamins, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  9. J. Kim, S. Lee, S.-w. Hwang, and S. Kim. Towards an intelligent code search engine. 2010.Google ScholarGoogle Scholar
  10. L. Ponzanelli, A. Bacchelli, and M. Lanza. Seahawk: Stack Overflow in the IDE. In Proceedings of the 2013 International Conference on Software Engineering, pages 1295–1298. IEEE, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Ponzanelli, G. Bavota, M. Di Penta, R. Oliveto, and M. Lanza. Mining stackoverflow to turn the ide into a self-confident programming prompter. In Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014, pages 102–111. ACM, 2014.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. L. Ponzanelli, G. Bavota, M. D. Penta, R. Oliveto, and M. Lanza. Prompter: A self-confident recommender system. In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, ICSME ’14, pages 577–580. IEEE Computer Society, 2014.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Puder and O. Antebi. Cross-compiling android applications to ios and windows phone 7. Mob. Netw. Appl., 18(1):3–21, Feb. 2013. ISSN 1383-469X.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Robillard, R. Walker, and T. Zimmermann. Recommendation systems for software engineering. Software, IEEE, 27(4):80–86, July 2010.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. P. Robillard, W. Maalej, R. J. Walker, and T. Zimmermann, editors. Recommendation Systems in Software Engineering. Springer, 2014.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. Salton, A. Wong, and C. S. Yang. A vector space model for automatic indexing. Commun. ACM, 18(11):613–620, Nov. 1975. ISSN 0001-0782.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. StackOverflow.com. Stack overflow, 2015.Google ScholarGoogle Scholar
  18. StackOverflow.com. Usage of /info - stack exchange api, 2015.Google ScholarGoogle Scholar
  19. StackOverflow.com. Stack overflow developer survey 2015, 2015.Google ScholarGoogle Scholar
  20. W. Takuya and H. Masuhara. A spontaneous code recommendation tool based on associative search. In Proceedings of the 3rd International Workshop on Search-Driven Development: Users, Infrastructure, Tools, and Evaluation, SUITE ’11, pages 17–20, 2011.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. Vasilescu, V. Filkov, and A. Serebrenik. Stackoverflow and github: Associations between software development and crowdsourced knowledge. In Social Computing (SocialCom), 2013 International Conference on, pages 188–195, Sept 2013.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. www.tiobe.com. Usage of tiobe language use statistics, 2015.Google ScholarGoogle Scholar
  23. A. Zagalsky, O. Barzilay, and A. Yehudai. Example overflow: Using social media for code recommendation. In Recommendation Systems for Software Engineering (RSSE), 2012 Third International Workshop on, pages 38–42, June 2012.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Zhong, S. Thummalapenta, T. Xie, L. Zhang, and Q. Wang. Mining api mapping for language migration. In Proceedings of the 32Nd ACM/IEEE International Conference on Software Engineering - Volume 1, ICSE ’10, pages 195–204. ACM, 2010.. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Native-2-native: automated cross-platform code synthesis from web-based programming resources

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 51, Issue 3
        GPCE '15
        March 2016
        184 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2936314
        • Editor:
        • Andy Gill
        Issue’s Table of Contents
        • cover image ACM Conferences
          GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
          October 2015
          184 pages
          ISBN:9781450336871
          DOI:10.1145/2814204

        Copyright © 2015 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 26 October 2015

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!