簡易檢索 / 詳目顯示

研究生: 張正穎
Chang, Cheng-Ying
論文名稱: 對應用程式介面棄用機制下達符合成本效益的決策
Making Cost-Effective Decisions on API Deprecation
指導教授: 斯國峰
Ssu, Kuo-Feng
焦惠津
Jiau, Hewijin Christine
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電腦與通信工程研究所
Institute of Computer & Communication Engineering
論文出版年: 2017
畢業學年度: 105
語文別: 英文
論文頁數: 92
中文關鍵詞: 應用程式介面棄用機制應用程式介面演進應用程式介面刪除管理資料導向決策應用程式介面使用統計
外文關鍵詞: API Evolution, API Deprecation, API Removal Management, Data-driven Decision Making, API Usage Statistics
相關次數: 點閱:111下載:3
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 理想的情況下,應用程式介面 (API) 作為一個應用程式和該程式使用的軟體框架 (Framework) 間的契約,一旦被公開發布就不應被更動。但事實上,應用程式介面卻時常更動,這造成了應用程式介面的使用者在使用新版本的軟體框架前需要付出成本更改程式碼去適應這些變動。若所需成本過高,軟體框架將會失去市場佔有率。為了降低應用程式介面使用者所付出的成本,匴體框架開發者應採用應用程式介面棄用機制 (Deprecation mechanism) 來管理應用程式介面的移除。然而,目前仍未有實證研究調查採用應用程式介面棄用機制所需的花費和能帶來的效益。對於資源時間有限的軟體框架計畫來說,有了這樣的調查研究才能讓其開發者依據所需的花費和所帶來的效益,在何時需要採用、如何採用棄用機制的抉擇中,下達符合成本效益的決定。因此,此研究進行了一個實證研究去量化棄用機制的花費和效益,並依據調查結果提出一套符合成本效益的決策模組。此外,此研究還設計了一個的虛擬助理協助軟體框架開發者進行決策,進一步實現了決策模組的應用。為了驗證所提出的決策模組的有效性,此研究在六個案例中的軟體生態系裡展現了決策模組能帶來的不同面相的效益。

    Ideally, application programming interfaces (APIs) are assumed to be unchanged once they are published, because they serve as contracts between application and its underlying frameworks. In reality, APIs change over time, requiring API users to migrate client applications before new framework versions can be used. If the effort is too much to afford, framework that API developers have built will lose market share. To reduce the effort, API developers should invest resources to manege API change with deprecation. However, no empirical study investigates the cost along with its benefit. For framework projects where resources and time are tight, such study is needed so that API developers can make decisions regarding the extent to which they should adopt deprecation. This thesis thereby conducts an empirical study to quantify the cost and benefit, and then concludes a decision-making model for adopting deprecation to benefit API users most with least cost. To realize the model in practice, an assistant for support decision-making is further presented. The effectiveness of the decision-making model is demonstrated in ecosystems, which formed by a Spring Framework component and its client programs.

    Abstract (Chinese) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i Abstract (English) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Extracting the Cost and Benefit of Deprecation? . . . . . . . . . . . . . . . . . . . . . 6 2.1 Preliminary Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.1 D Model: Deprecation Involved API Lifecycle Model. . . . . . . . . . . . . . . . . 7 2.1.2 ND Model: Non-Deprecation Involved API Lifecycle Model. . . . . . . . . . . . . . 10 2.1.3 Definition of the Factors Influencing Cost and Benefit . . . . . . . . . . . . . . . . 12 2.2 Empirical Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.1 Research Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.2 Context and Subject Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2.3 Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.2.4 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.5 Study Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3 Making Cost-Effective Decisions on API Deprecation . . . . . . . . . . . . . . . . . . 25 3.1 CoDe-Deprecation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.1.1 Deprecating APIs According to API Usage Statistics . . . . . . . . . . . . . . . . . 26 3.1.2 Providing Migration Information According to API Usage Statistics . . . . . . . . 28 3.1.3 Removing Deprecated APIs According to API Usage Statistics . . . . . . . . . . . 29 3.2 Model Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4 AWARE: A Win-win Assistant for API Removal Management . . . . . . . . . . . . 32 4.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.2 API Usage Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.3 Tool Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.3.1 Context and Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.3.2 Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.1 Verification of Measurement Instrument . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.1.1 API Removal Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.1.2 API Usage Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.2 Effectiveness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.2.1 Experiment Subjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2.2 Auto-Deprecator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.2.3 Metric Definition and Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.2.4 Results Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.3 Threats to Validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7 Conclusion and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    [1] W. Maalej and M. P. Robillard, “Patterns of Knowledge in API Reference Documentation,” Journal of IEEE Transactions on Software Engineering, vol. 39, pp. 1264–1282, 2013.
    [2] C. Bogart, C. K¨astner, J. Herbsleb, and F. Thung, “How to break an API: cost negotiation and community values in three software ecosystems,” in Proceedings of 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, New York, NY, USA, 2016.
    [3] L. Xavier, A. Hora, and M. Valente, “Why do we break APIs? First answers from developers,” in Proceedings of 21st International Conference on Software Analysis, Evolution, and Reengineering, Klagenfurt, Austria, 2017.
    [4] D. Dig and R. Johnson, “The Role of Refactorings in API Evolution,” in Proceedings of the 21st IEEE International Conference on Software Maintenance (ICSM), Budapest, Hungary, 2005.
    [5] M. Godfrey and L. Zou, “Using origin analysis to detect merging and splitting of source code entities,” Journal of IEEE Transactions on Software Engineering, vol. 31, pp. 166–181, 2005.
    [6] Z. Xing and E. Stroulia, “Refactoring Practice: How it is and How it Should be Supported - An Eclipse Case Study,” in Proceedings of the 22nd International Conference on Software Maintenance (ICSM), Raleigh, NC, USA, 2006.
    [7] Z. Xing and E. Stroulia, “API-Evolution Support with Diff-CatchUp,” Journal of IEEE Transactions on Software Engineering, vol. 33, no. 12, pp. 818–836, Dec. 2007.
    [8] T. McDonnell, B. Ray, and M. Kim, “An Empirical Study of API Stability and Adoption in the Android Ecosystem,” in Proceedings of 29th IEEE International Conference on Software Maintenance (ICSM), Eindhoven, Netherlands, 2013.
    [9] L. Xavier, A. Brito, A. Hora, and M. T. Valente, “Historical and Impact Analysis of API Breaking Changes: A Large-scale Study,” in Proceedings of the IEEE 24th International Conference on Software Analysis, Evolution, and Reengineering (SANER), Klagenfurt, Austria, 2017.
    [10] J. Henkel and A. Diwan, “CatchUp! Capturing and Replaying Refactorings to Support API Evolution,” in Proceedings of 27th International Conference on Software
    Engineering (ICSE), St. Louis, MO, USA, 2005.
    [11] W. Wu, Y.-G. Gu´eh´eneuc, G. Antoniol, and M. Kim, “AURA: A Hybrid Approach to Identify Framework Evolution,” in Proceedings of 32nd ACM/IEEE International Conference on Software Engineering (ICSE), Cape Town, South Africa, 2010.
    [12] M. Linares-V´asquez, M. D. Penta, R. Oliveto, and D. Poshyvanyk, “How do API changes trigger stack overflow discussions? a study on the Android SDK,” in Proceedings of the 22nd International Conference on Program Comprehension (ICPC), Hyderabad, India, 2014.
    [13] G. Bavota, M. Linares-Vasquez, C. E. Bernal-Cardenas, M. D. Penta, R. Oliveto, and D. Poshyvanyk, “The Impact of API Change and Fault-Proneness on The User Ratings of Android Apps,” Journal of IEEE Transactions on Software Engineering, vol. 41, pp. 384–407, Apr. 2015.
    [14] W. Wu, F. Khomh, B. Adams, Y. G. Gu´eh´eneuc, and G. Antoniol, “An Exploratory Study of API Changes and Usages based on Apache and Eclipse Ecosystems,” Journal of Empirical Software Engineering, vol. 21, pp. 2366–2412, Dec. 2016.
    [15] A. Hora et al., “How Do Developers React to API Evolution? A Large-scale Empirical Study,” Journal of Software Quality Journal, pp. 1–31, 2016.
    [16] D. Yu, C. Chang, H. Jiau, and K. Ssu, “Which API Lifecycle Model is the Best for API Removal Management?” in Proceedings of 12th International Conference on Software Engineering Advances (ICSEA), Athens, Greece, 2017.
    [17] R. Robbes, M. Lungu, and D. R¨othlisberger, “How do developers react to API deprecation?: the case of a smalltalk ecosystem,” in Proceedings of 20th ACM SIGSOFT International Symposium on the Foundations of Software Engineering, Cary, North Carolina, 2012.
    [18] D. Ko et al., “API Document Quality for Resolving Deprecated APIs,” in Proceedings of 21st IEEE Asia-Pacific Software Engineering Conference (APSEC), Jeju, South Korea, 2014.
    [19] A. A. Sawant, R. Robbes, and A. Bacchelli, “On the Reaction to Deprecation of 25,357 Clients of 4+1 Popular Java APIs,” in Proceedings of the 32nd International Conference on Software Maintenance and Evolution (ICSME), Raleigh, NC, USA, 2016.
    [20] G. Brito, A. Hora, M. T. Valente, and R. Robbes, “Do Developers Deprecate APIs with Replacement Messages? A Large-Scale Analysis on Java Systems,” in Proceedings of the IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Suita, Japan, 2016.
    [21] A. Hora et al., “How do developers react to API evolution? The Pharo ecosystem case,” in Proceedings of 21stIEEE International Conference on Software Maintenance and Evolution, Bremen, Germany, 2015.
    [22] “Spring Framework,” Aug. 2017, https://projects.spring.io/spring-framework/.
    [23] “Netty,” Aug. 2017, https://netty.io/.
    [24] “Spring Framework,” Aug. 2017, https://www.playframework.com/.
    [25] “Ninja,” Aug. 2017, http://www.ninjaframework.org/.
    [26] “Vaddin Framework,” Aug. 2017, https://github.com/vaadin/framework.
    [27] “Vraptor3,” Aug. 2017, http://vraptor3.vraptor.org/en/.
    [28] J. Zhou and R. J. Walker, “API deprecation: a retrospective analysis and detection method for code examples on the web,” in Proceedings of 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, Seattle, WA, USA, 2016.
    [29] D. Qiu, B. Li, and H. Leung, “Understanding the API usage in Java,” Journal of Information and Software Technology, vol. 73, pp. 81–100, May 2016.
    [30] S. Thummalapenta and T. Xie, “SpotWeb: Detecting Framework Hotspots and Coldspots via Mining Open Source Code on the Web,” in Proceedings of the 23rd IEEE/ACM International Conference on Automated Software Engineering, L’Aquila, Italy, 2008.
    [31] I. Sommerville, Software Engineering. Pearson Education Limited, 2010, vol. Ninth Edition ed.
    [32] “The Repository Pattern,” July 2017, https://msdn.microsoft.com/en-us/library/ff649690.aspx.
    33] “RESTful Web Services - Introduction,” July 2017, https://www.tutorialspoint. com/restful/restful introduction.htm.
    [34] Y. M. Mileva, V. Dallmeier, and A. Zeller, “Mining API Popularity,” Journal of Testing – Practice and Research Techniques. Lecture Notes in Computer Science, vol. 6303, pp. 173–180, 2010.
    [35] R. L¨ammel, E. Pek, and J. Starek, “Large-scale, AST-based API-usage analysis of open-source Java projects,” in Proceedings of the 2011 IEEE International Workshop Program Comprehension, TaiChung, Taiwan, 2011.
    [36] M. Collard, H. Kagdi, and J. Maletic, “An XML-based lightweight C++ fact extractor,” in Proceedings of 11th IEEE International Workshop Program Comprehension, Portland, OR, USA, 2003.
    [37] C. D. Roover, R. Lammel, and E. Pek, “Multi-dimensional exploration of API usage,” in Proceedings of 21st IEEE International Workshop Program Comprehension, San Francisco, CA, USA, 2013.
    [38] “Spring Projects,” July 2017, https://spring.io/projects.
    [39] K. Chow and D. Notkin, “Semi-automatic Update of Applications in Response to Library Changes,” in Proceedings of the IEEE International Conference on Software Maintenance (ICSM), Monterey, CA, USA, 1996.
    [40] J. H. Perkins, “Automatically Generating Refactorings to Support API Evolution,” in Proceedings of the 6th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering (PASTE), Lisbon, Portugal, 2005.
    [41] D. Dig, S. Negara, V. Mohindra, and R. Johnson, “ReBA: Refactoring-aware Binary Adaptation of Evolving Libraries,” in Proceedings of 30th International Conference on Software Engineering (ICSE), Leipzig, Germany, 2008.
    [42] M. Kim, D. Notkin, and D. Grossman, “Automatic Inference of Structural Changes for Matching across Program Versions,” in Proceedings of the 29th international conference on Software Engineering (ICSE), Minneapolis, MN, USA, 2007.
    [43] Z. Xing and E. Stroulia, “Identifying and Summarizing Systematic Code Changes via Rule Inference,” Journal of IEEE Transactions on Software Engineering, vol. 39, no. 1, pp. 45–62, Jan. 2013.

    下載圖示 校內:2022-09-12公開
    校外:2022-09-12公開
    QR CODE