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

軟體重組案例: 2D 手機遊戲

Case Study of software Refactoring: A 2D Mobile game

指導教授 : 廖賀田

摘要


本論文對一個手機遊戲做重構(refactoring)的真實案例研究。在軟體工程學裡,重構(refactoring)通常是指在不改變程式碼的外部行為情況下而修改原始碼,重構既不修正錯誤,又不增加新的功能性。反而它是用於提高程式碼的可讀性或者改變程式碼內部結構與設計,並且移除死程式碼,使其在將來更容易被維護。這個程式本來是專題課程的成品,本系統結構完整,可以正常執行。但整個程式充滿語言上的不當使用,嚴重違反工程規則。原設計者無法解釋程式,也寫不出程式文件。遊戲是即時互動的系統,有許多的遊戲狀態需要切換。本論文引用Folwer等人在《Refactoring: Improving the Design of Existing Code》一書所提之重構方法對這個程式進行重構(refactoring)。並試圖建立系統文件。目前完成的了基本重組,並整理出遊戲狀態,然後使用繼承機制來重組遊戲的狀態機。藉著各個類別的責任歸屬,讓模糊的設計理念明確化,成為可維護的軟體。

並列摘要


This paper is a real case study of refactoring a mobile game. In software engineering, refactoring usually means modifying the source code without changing the external behavior of the code, and the reconstruction does not correct the error without adding new functionality. Instead, it is used to improve the readability of the code or to change the internal structure and design of the code, and to remove the dead code, making it easier to maintain in the future. This program was originally the finished product of the special course. The system is structurally complete and can be executed normally. However, the entire program is full of illogical misuse, which is a serious violation of engineering rules. The original designer could not interpret the program and could not write the program file. The game is an instant interactive system with many game states that need to be switched. This paper uses the refactoring method proposed by Folwer et al. in "Refactoring: Improving the Design of Existing Code" to refactor the program. And tried to create a system file. The basic reorganization is now completed, and the game state is sorted out, and then the inheritance mechanism is used to reorganize the state machine of the game. Through the attribution of responsibility in each category, the fuzzy design concept is clarified and becomes a maintainable software.

參考文獻


Wiki, Code refactoring, 網址: https://zh.wikipedia.org/wiki/%E4%BB%A3%E7%A0%81%E9%87%8D%E6%9E%84, 上網日期:2017年11月20日。
陳子俊等, 亞瑟 - 2D冒險解迷RPG, 專題製作程式及系統文件, 2016年10月
Wiki, 有限狀態機, 網址:https://zh.wikipedia.org/wiki/%E6%9C%89%E9%99%90%E7%8A%B6%E6%80%81%E6%9C%BA, 上網日期:2017年11月20日
Wiki, Paint to SAI, 網址:https://zh.wikipedia.org/wiki/Paint_Tool_SAI,上網日期:2017年11月20日。
Wiki, Android Studio,網址: https://zh.wikipedia.org/wiki/Android_Studio,上網日期: 2017年11月20日

延伸閱讀