由於圖形使用者介面(Graphical User Interface)廣泛的使用,GUI測試已經成為非常重要的研究主題。在GUI測試中,使用有限狀態機(Finite State Machine,簡稱FSM)建立GUI操作的模型,再利用FSM產生測試案例是很普遍的做法。然而,當GUI越來越複雜時,建立其FSM所花費的代價是很昂貴的。本論文提出一個階層式有限狀態機(HFSM),將FSM中相似的樣式(狀態以及狀態的轉移)藉由Composition以及Inheritance的方式重複利用,以降低建立FSM的複雜度,同時改善FSM的可讀性以及可維護性。另外,本論文利用HFSM產生的測試案例對典型的應用程式進行測試,實驗顯示這些測試案例確實具有偵測軟體缺陷的能力。
Due to the widespread using of GUI (Graphical User Interface), GUI testing has become an important research topic. A popular GUI testing method is to construct a FSM (Finite State Machine) to model the interaction of GUI and then generate test cases based on the FSM. Unfortunately, when the GUI becomes increasingly sophisticated, the construction of FSM is very expensive. In this thesis, we propose a hierarchical FSM (HFSM), which is capable of reusing similar patterns (states and transitions) by composition and inheritance of sub-states. By using HFSM, the complexity of constructing FSM is reduced, and the readability and maintainability of the model are improved. We also conduct experiments to show that test cases generated by HFSM are capable of detecting defects for typical software applications.