跳到主要內容

臺灣博碩士論文加值系統

(44.220.255.141) 您好!臺灣時間:2024/11/13 09:28
字體大小: 字級放大   字級縮小   預設字形  
回查詢結果 :::

詳目顯示

: 
twitterline
研究生:陳柏峻
研究生(外文):Bo-Jun Chen
論文名稱:擴充FEED以偵測Feature Envy程式壞味道
論文名稱(外文):Extending FEED for Detecting Feature Envy Smells
指導教授:劉建宏劉建宏引用關係陳偉凱陳偉凱引用關係
指導教授(外文):Chien-Hung LiuWoei-kae Chen
口試委員:劉建宏陳偉凱鄭有進林迺衛
口試委員(外文):Chien-Hung LiuWoei-kae ChenYu-Chin ChengNai-Wei Lin
口試日期:2018-07-10
學位類別:碩士
校院名稱:國立臺北科技大學
系所名稱:資訊工程系
學門:工程學門
學類:電資工程學類
論文種類:學術論文
論文出版年:2018
畢業學年度:106
語文別:中文
論文頁數:95
中文關鍵詞:方法改善資料流分析Feature Envy程式碼壞味道
外文關鍵詞:ExtendDataflow AnalysisFeature EnvyCode Smells
相關次數:
  • 被引用被引用:0
  • 點閱點閱:199
  • 評分評分:
  • 下載下載:7
  • 收藏至我的研究室書目清單書目收藏:0
Feature Envy壞味道(code Smell)是指一個函式(method),相較於自己所屬的類別(class),對於另一個類別更有興趣,當程式出現Feature Envy壞味道時,帶來的影響可能會是降低內聚力(cohesion),並且提高對於其他類別的耦合度(coupling),意味著程式碼品質會降低,因此偵測與重構Feature Envy是很重要的議題。本論文旨在解決Feature Envy偵測工具FEED現有的問題,包括修改Feature Envy的定義,為部分特殊C#語言結構設計與實作分析演算法,並修正誤判。本論文以實驗驗證我們所提出的修正,並檢測臺北科技大學資訊工程系所開設的「視窗程式設計」課程歷年作業之Feature Envy,比較使用與不使用FEED工具時Feature Envy數量之差異。
Feature Envy is a code small indicating that a method (or a function) seems to be more interested in a class other than the one it is actually in. When a piece of code has feature envy smell, object cohesion is decreased and coupling is increased, signifying a degradation in code quality. Thus, detecting and refactoring feature envy is important. This thesis addresses the problems that are found in the feature envy detector FEED. We enhance and redefine the rules of detecting feature envy. In addition, we design and implement a few new detection algorithms for some special C# language structures and fix some false positives. We conduct experiments to verify the effectiveness of our modification. We also detect the feature envy problems in the homework assignments of the Windows Programming course offered by the Department of Computer Science and Information Engineering at National Taipei University of Technology. We compare the differences in the number of feature envy smells between using and not using FEED.
摘 要 i
ABSTRACT ii
誌 謝 iii
目 錄 iv
表目錄 vii
圖目錄 ix
第一章 緒論 1
1.1 研究動機與目的 1
1.2 論文組織架構 5
第二章 背景介紹與相關研究 6
2.1 Feature Envy背景介紹 6
2.2 相關論文 9
2.3 混淆矩陣(Confusion Matrix)與準確度(accuracy)、精確度(precision)定義 11
2.4 FEED Feature Envy偵測方法 13
2.5 相關工具 15
第三章 Feature Envy 偵測演算法 17
3.1 Feature Envy的特徵 17
3.2 實際應用資料流分析(Dataflow Analysis) 21
3.3 Feature Envy判定方法 23
3.4 For/while/do…while迴圈建立條件判斷式與迴圈本體之關係 25
3.5 條件性存取時之參數分析問題修正 31
3.6 特殊物件階層屬性或方法誤判修正 33
3.7 一行Statement同時定義兩個以上的變數誤判修正 36
3.8 左手式陣列索引誤判修正 37
3.9 「?:」條件運算子判斷方式 38
第四章 系統設計與實作 40
4.1 演算法實作 40
4.2 MergedIdentifierEntry 42
4.3 FEED忽略的類別 42
4.4 改良Dr.Smell顯示 43
4.5 使用範例 44
第五章 實驗 47
5.1 研究問題 47
5.2 簡易測試程式碼資料集檢測 49
5.3 實驗設計 53
5.4 實驗環境 54
5.5 實驗二至實驗五之實驗流程 54
5.6 實驗一、新版與舊版FEED掃描結果比較實驗 55
5.6.1 實驗結果與統計 55
5.7 實驗二、Video Store 掃描正確性實驗 58
5.7.1 實驗結果與統計 58
5.8 實驗三、LAN Simulation掃描正確性實驗 60
5.8.1 實驗結果與統計 60
5.9 實驗四、學生作業掃描正確性實驗 62
5.9.1 實驗結果與統計 62
5.10 實驗五、Feature Envy行為分析範例程式碼掃描正確性實驗 67
5.10.1 實驗結果與統計 68
5.11 實驗六、FEED擬定重構方法之實驗 69
5.11.1 實驗結果與統計 70
5.12 實驗七、FEED工具輔助前後作業Feature Envy數量差異 72
5.12.1 實驗結果與統計 72
5.13 實驗八、YCount ≥ 2之YCount分布實驗 74
5.13.1 實驗結果與統計 74
5.14 實驗結論 80
第六章 結論與未來展望 87
6.1 結論 87
6.2 未來展望 88
參考文獻 90
附錄A Feature Envy行為分析程式碼 92
附錄B NDepend偵測程式碼 94
[1] 楊凱霖, 支援程式作業壞味道偵測與批改之工具 A Tool for Detecting and Grading Code Smell in Programming Assignments, 碩士論文 國立臺北科技大學資訊工程系, 2016.
[2] 李柏鋐, 以資料流分析為基礎之Feature Envy偵測方法 A Feature Envy Detection Method Based on Data Flow Analysis, 碩士論文 國立臺北科技大學資訊工程系, 2017.
[3] Francesca Arcelli Fontana, Mika V. Mäntylä, Marco Zanoni, Alessandro Marino, "Comparing and experimenting machine learning techniques for code smell detection," Empirical Software Engineering, pp. pp. 1143-1191, 6 2016.
[4] Martin Fowler and Kent Beck, Refactoring: improving the design of existing code, Addison-Wesley Professiona, 1999.
[5] Marco DAmbros, Alberto Bacchelli, Michele Lanza, "On the Impact of Design Flaws on Software Defects," in 2010 10th International Conference on Quality Software, Zhangjiajie, China, 2010.
[6] Amandeep Kaur, Sushma Jain, Shivani Goel, "A Support Vector Machine Based Approach for Code Smell Detection," Machine Learning and Data Science (MLDS), 2017 International Conference on, pp. 9-14, 14 12 2017.
[7] Roberto Verdecchia, Rene Aparicio Saez, Giuseppe Procaccianti, Patricia Lago, "Empirical Evaluation of the Energy Impact of Refactoring Code Smells," EPiC Series in Computing, Vol. 52., 5 2018.
[8] Haris Mumtaz, Mohammad Alshayeb, Sajjad Mahmood, Mahmood Niazi, "An empirical study to improve software security through the application of code refactoring," in Information and Software Technology Volume 96, April 2018, pp. 112-125.
[9] G.Saranya, H.Khanna Nehemiah, A.Kannan, V.Nithya, "Model level code smell detection using EGAPSO based on similarity measures," Alexandria Engineering Journal, 7 Aug 2017.
[10] Bruno L. Sousa, Priscila P. Souza, Eduardo M. Fernandes, Kecia A.M. Ferreira, Mariza A.S. Bigonha, "FindSmells: Flexible Composition of Bad Smell Detection Strategies," in IEEE 25th International Conference on Program Comprehension (ICPC), Buenos Aires, Argentina, 2017.
[11] b. (愛), "[學習] [分析] 混淆矩陣與TP、TN、FP、FN," [Online]. Available: http://belleaya.pixnet.net/blog/post/43873939. [Accessed 24 7 2018].
[12] WIKI, "Precision and recall - WIKI Pedia," [Online]. Available: https://en.wikipedia.org/wiki/Precision_and_recall. [Accessed 24 7 2018].
[13] "NDepend," [Online]. Available: http://www.ndepend.com/. [Accessed 16 5 2018].
[14] "JDeodorant Plugin," [Online]. Available: https://marketplace.eclipse.org/content/jdeodorant. [Accessed 16 5 2018].
[15] M. Fokaefs, N. Tsantalis, and A. Chatzigeorgiou, "JDeodorant: Identification and Removal of Feature Envy Bad Smells," 2007 IEEE International Conference on Software Maintenance, pp. 519 - 520, Oct 2007.
[16] M. Lanza and R. Marinescu, Object-oriented metrics in practice: using software metrics to characterize, evaluate, and improve the design of object-oriented systems., Springer, 2007.
[17] N. Tsantalis and A. Chatzigeorgiou, "Identification of move method refactoring opportunities," IEEE Transactions on Software Engineering, vol. 35, no. 3, pp. 347-367, May 2009.
[18] S. Demeyer, F. Van Rysselberghe, T. Girba, J. Ratzinger, R. Marinescu, T. Mens, B. Du Bois, D. Janssens, S. Ducasse, M. Lanza, M. Rieger, H. Gall, M. El-Ramly, "The LAN-simulation: a refactoring teaching example," in International Workshop on Principles of Software Evolution (IWPSE05), Lisbon, Portugal, 2005.
QRCODE
 
 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                                                               
第一頁 上一頁 下一頁 最後一頁 top