圖形使用者介面(Graphical User Interface,簡稱GUI)已被廣泛地使用在應用軟體中,因此GUI測試是一個很重要的研究議題。一個複雜的GUI通常需要大量的測試案例,才能執行到所有可能發生的互動。過去有研究指出,有限狀態機(Finite State Machine,簡稱FSM)可以用來自動產生GUI測試案例。然而,當GUI漸趨複雜時,建立FSM的成本也相對地變成非常昂貴。本論文提出一個以合約語言(Contract Language)為基礎的GUI測試方法,利用合約語言來描述事件之間的互動關係,並利用這些互動關係,自動化地建立FSM,再產生測試案例。另外,本論文的合約語言也與巨集元件的觀念做整合,使得測試者能以不同的抽象層級,來描述GUI事件的互動關係。
Graphical User Interface (GUI) has been extensively used in software applications which make GUI testing an important research topic. A sophisticated GUI requires a large number of test cases to fully exercise every possible interaction. It has been shown that FSM can be used in generating test cases automatically. However, when the GUI becomes increasingly sophisticated, the construction of FSM also becomes very expensive. This thesis proposes a GUI test-case generation strategy based on a contract language, which is used to specify the interaction relationships between GUI events. These relationships are then used to construct FSM to generate test cases automatically. In addition, this thesis integrates contract language with the concept of macro components so that testers can specify interaction relationships in different levels of abstraction.