透過您的圖書館登入
IP:3.14.144.145
  • 學位論文

一個以移除未使用的程式碼改善軟體維護性的方法:以STF-CTP為例

A Method to Remove Unused Code to Improve Software Maintenance: A Case Study of STF-CTP

指導教授 : 鄭有進 謝金雲

摘要


隨著時間的過去,軟體系統常會因各種原因而累積一些未使用的程式碼。未使用的程式碼會使軟體系統更加複雜,讓維護人員難以理解與修改,因此降低系統的可維護性。雖然靜態分析可找到編譯時期未使用的程式碼,但靜態分析有其限制,因為有些程式碼在執行時期才會被軟體所採用的框架或技術利用反射機制所呼叫,在這樣的限制下,維護人員並不能只根據編譯時期所分析的結果來移除程式碼。為了改善軟體可維護性,本論文提出一個移除未使用的程式碼方法,首先依據系統使用案例撰寫驗收測試案例,再執行這些驗收測試案例來進行動態分析,找出未被任何驗收測試案例所覆蓋的程式碼。接著,利用靜態分析找出未覆蓋的程式碼的結構關係,並進行程式碼審查確認是否為未使用的程式碼,最後進行移除並測試。此外,本論文將以一個Java Web應用程式STF-CTP做為案例探討,說明如何用此方法移除未使用的程式碼。

並列摘要


Over time, software systems often accumulate unused code for some reasons. Unused code makes software system more complex than necessary, making it difficult for maintenance staff to understand and modify, thus reducing the maintainability of the system. Although static analysis can find unused code at compile time, it has limitations because some code is called by various application frameworks used by the system through reflection during run time. In order to improve software maintenance, this thesis proposes a method to remove unused code. First, acceptance tests are developed based on use cases of the system. The acceptance tests are executed for performing dynamic analysis to identify code that is not covered. Then, static analysis is performed to identify structural relationships of the code that is not covered. Further, whether the code is unused is confirmed through code review before its removal. Finally, this paper presents a case study with A Java web application called STF-CTP to describe how to use this method to remove unused code.

參考文獻


[15] 張勝雄,JCIS3:一個支援跨平台專案的持續整合系統,碩士論文,國立臺北科技大學資訊工程系碩士班,臺北,2009。
[16] 王宣皓,雲端持續整合服務半自動供裝之設計與實作,碩士論文,國立臺北科技大學資訊工程系碩士班,臺北,2011。
[17] 王智平,使用企業流程執行語言實現雲端持續整合服務供裝之方法,碩士論文,國立臺北科技大學資訊工程系碩士班,臺北,2011。
[18] 洪陳佐,一個確保Android雲端測試裝置即用性的方法,碩士論文,國立臺北科技大學資訊工程系碩士班,臺北,2013。
[19] 李俊毅,Android雲端測試平台的安全性防護方法,碩士論文,國立臺北科技大學資訊工程系碩士班,臺北,2013。

延伸閱讀