WO2021205589A1 - Test script generation device, test script generation method, and program - Google Patents

Test script generation device, test script generation method, and program Download PDF

Info

Publication number
WO2021205589A1
WO2021205589A1 PCT/JP2020/015909 JP2020015909W WO2021205589A1 WO 2021205589 A1 WO2021205589 A1 WO 2021205589A1 JP 2020015909 W JP2020015909 W JP 2020015909W WO 2021205589 A1 WO2021205589 A1 WO 2021205589A1
Authority
WO
WIPO (PCT)
Prior art keywords
screen
test script
transition
target
test
Prior art date
Application number
PCT/JP2020/015909
Other languages
French (fr)
Japanese (ja)
Inventor
弘之 切貫
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to PCT/JP2020/015909 priority Critical patent/WO2021205589A1/en
Priority to JP2022513789A priority patent/JP7380851B2/en
Publication of WO2021205589A1 publication Critical patent/WO2021205589A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention relates to a test script generation device, a test script generation method, and a program.
  • programming is a technique for describing a test code using a library for operating a browser as a program and executing a test using the test code (see, for example, Non-Patent Document 2).
  • the present invention has been made in view of the above points, and an object of the present invention is to enable efficient generation of a highly maintainable test script.
  • FIG. 1 is a diagram showing a hardware configuration example of the test script generation device 10 according to the embodiment of the present invention.
  • the test script generation device 10 of FIG. 1 has a drive device 100, an auxiliary storage device 102, a memory device 103, a CPU 104, an interface device 105, a display device 106, an input device 107, and the like, which are connected to each other by a bus B, respectively. ..
  • the memory device 103 reads and stores the program from the auxiliary storage device 102 when the program is instructed to start.
  • the CPU 104 realizes the function related to the test script generation device 10 according to the program stored in the memory device 103.
  • the interface device 105 is used as an interface for connecting to a network.
  • the display device 106 displays a programmatic GUI (Graphical User Interface) or the like.
  • the input device 107 is composed of a keyboard, a mouse, and the like, and is used for inputting various operation instructions.
  • FIG. 3 is a flowchart for explaining an example of a processing procedure executed by the test script generation device 10.
  • the operation log recording unit 11 logs the test based on the manual operation by the tester for the application for which the test script is generated (hereinafter, referred to as “target application”) (hereinafter, referred to as “operation log”). Is recorded in the operation log storage unit 121.
  • the operation log includes information indicating each of the operation under test, the operation target, and the screen transition in chronological order.
  • the information indicating the operation is information on the operation type such as click, double-click, and input.
  • the operation target information is identification information (for example, HTML attributes such as id, name, and xpath) of the operated screen element (HTML element, etc.).
  • the screen transition information is information including identification information (title, URL, etc.) of the transition source screen and identification information (title, URL, etc.) of the transition destination screen.
  • Recording of the operation log may be performed using a known method.
  • a source code (script or the like) for detecting an operation on the screen is embedded in each HTML element in the HTML of each screen of the Web application, and the operation log recording unit 11 May record an operation log in response to the detection of the operation.
  • the operation log may be recorded using the method disclosed in "https://www.ieice.org/ken/paper/2019052581N3/".
  • step S102 and subsequent steps are executed.
  • step S102 it may be executed at an asynchronous timing with respect to step S101.
  • step S102 the page object generation unit 12 executes the page object generation process with reference to the operation log.
  • a page object is an object that has an operation sequence for an element (screen element) in a screen (page) as a method.
  • the page object generation unit 12 generates a definition of a page object class having a method corresponding to an operation sequence for the screen in the operation log for each screen transitioned in the operation log in the test script.
  • test case generation unit 13 generates a test case by combining the methods defined in each page object, and adds the test case to the test script (S103).
  • a test case is a unit of a test that starts from a certain screen and generates a screen transition corresponding to a path to the end screen in the screen transition.
  • One test script contains one or more test cases.
  • step S201 the page object generation unit 12 refers to the operation log and identifies the screen element that has been the operation target even once on the target screen.
  • the page object generation unit 12 executes a process for generating a method definition of the target object.
  • a series of operations performed by the tester from the transition to the target screen to the departure from the target screen are treated as a meaningful group of operations.
  • a series of operations performed from the transition to the target screen to the departure is called an "operation sequence".
  • "until leaving” means until the transition from the target screen to another screen or until the end of a series of operations on the target screen.
  • step S203 the page object generation unit 12 extracts the operation sequence for the target screen from the operation log.
  • a plurality of operation sequences will be extracted for one screen. This is because there can be a plurality of operation procedures for a certain screen.
  • each operation sequence is a candidate for the method of the target object.
  • the page object generation unit 12 executes the loop process L1 for each extracted operation sequence.
  • the operation sequence targeted for processing in the loop processing L1 is hereinafter referred to as a “target operation sequence”.
  • step S204 it is determined whether or not the target operation sequence is included in another operation sequence for the target screen (hereinafter, simply referred to as "another operation sequence"). That is, when all the operation columns extracted for the target screen are adopted as methods, there is a possibility that a large number of duplicate methods will be generated when the operation log is long. The determination is for suppressing the generation of duplicate methods.
  • the page object generation unit 12 Generates a definition of a method that executes the target operation sequence for the target object, and adds the definition to the test script (S205).
  • the locator of the screen element targeted for each operation constituting the target operation sequence is replaced with the field name generated in step S202. By doing so, resistance to changes in the locator of each screen element is ensured.
  • the method name is, for example, "goto ⁇ transition destination screen name> ⁇ serial number>". The developer may modify the generated method definition.
  • test case generation unit 13 generates a test case to be included in the test script by combining the methods defined in the class of each page object generated in step S102.
  • test case group covers all screen transitions in the operation log.
  • One test case visits the same screen only once.
  • a test case in which the screen transition sequence is maximized is adopted.
  • test cases that satisfy the conditions (1) to (3) often confirm one use case, and are considered to be the minimum test cases with high versatility. Even if the test case is flawed, the generated page object and test case script are highly reusable and can be modified efficiently by the developer.
  • test case generation method (a test case generation method satisfying the above conditions (1) to (3)) that covers screen transitions and maximizes the screen transition sequence will be described.
  • the screen transition diagram of the target application can be restored within the range of the operation log.
  • the screen transition diagram is a graph of a tree structure in which the screen of the transition source or the transition destination is a node and the screen transition is an edge.
  • a full search is performed on this screen transition diagram by a method such as depth-first search.
  • the path (route) that starts from the node (root node) on the top page (login screen, etc.) and ends at the terminal node, and does not transition to the same screen (node) twice.
  • One test case is a script that continuously calls the method of the page object corresponding to each screen related to the screen transition so that the screen transition related to the path is generated for each acquired path.
  • the method corresponding to a certain screen transition is a method of the page object corresponding to the transition source screen of the screen transition, and is a method including the screen name of the transition destination screen in the method name.
  • FIG. 5 is a flowchart for explaining an example of the processing procedure of the test case generation process.
  • step S301 the test case generation unit 13 generates a screen transition diagram of the target application based on the operation log.
  • the screen transition diagram may be generated by using a known method.
  • test case generation unit 13 searches a list of paths that are paths from the root node to the terminal node in the screen transition diagram and do not include the same node twice (S302).
  • test case generation unit 13 continuously calls the method of the page object corresponding to each screen related to the screen transition so that the screen transition related to the path is generated for each searched path. Generate a test case and add the generated test case to the test script (S303).
  • the additional function may be manually tested and the operation log may be recorded for the test.
  • steps S102 and S103 of FIG. 3 it is possible to add a page object to the added function or screen, add a method to an existing page object, and the like. can.
  • the test script is automatically generated based on the operation log recorded in the manual operation (manual test).
  • the test script is generated by a combination of methods of page objects generated for each screen of the target application.
  • the locator of the screen element of each screen is basically hidden by the field name (attribute name) of the page object, so the place where the locator appears is the page. Limited to object field definitions.
  • a series of operations (login operation, etc.) for each screen are hidden in the method of the page object.
  • test script it is possible to reduce the amount of modification of the test script when the locator is changed or when the operation of the screen element itself is changed. Therefore, according to the present embodiment, it is possible to efficiently generate a test script with high maintainability. That is, it is possible to generate a highly maintainable automated test script simply by performing a manual test. Even if a function is added to the test target, a test script can be generated for the new function as appropriate.
  • the page object generation unit 12 is an example of the first generation unit.
  • the test case generation unit 13 is an example of the second generation unit.
  • Test script generation device 11 Operation log recording unit 12 Page object generation unit 13 Test case generation unit 100 Drive device 101 Recording medium 102 Auxiliary storage device 103 Memory device 104 CPU 105 Interface device 106 Display device 107 Input device 121 Operation log storage B bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

In order to enable efficiently generating highly maintainable test scripts, this test script generation device has: a first generation unit that refers to an operation log, in which manual operations on screens relating to one or more screen transitions, the objects of said operations, and information indicating the screen transitions are recorded, and that generates, for each pre-transition screen in a screen transition, a definition of a page object including a method that implements the sequence of operations that were performed from said pre-transition screen until transition to another screen; and a second generation unit that generates a test script by combining the aforementioned methods.

Description

テストスクリプト生成装置、テストスクリプト生成方法及びプログラムTest script generator, test script generator and program
 本発明は、テストスクリプト生成装置、テストスクリプト生成方法及びプログラムに関する。 The present invention relates to a test script generation device, a test script generation method, and a program.
 Webアプリやモバイルアプリ等のように、画面を有するアプリケーションの画面操作を伴うテストを自動化するための技術として、主に、「Record & Replay」及び「プログラミング」の2種類がある。 There are mainly two types of technologies for automating tests involving screen operations of applications that have screens, such as web applications and mobile applications, as "Record & Play" and "programming".
 「Record & Replay」とは、ユーザの操作をそのままスクリプトとして記録し、当該スクリプトを実行することで、ユーザの操作を再現する技術である(例えば、非特許文献1参照)。 "Record & Play" is a technology that reproduces a user's operation by recording the user's operation as a script as it is and executing the script (see, for example, Non-Patent Document 1).
 一方、「プログラミング」とは、ブラウザを操作するためのライブラリを利用したテストコードをプログラムとして記述し、当該テストコードを用いてテストを実行する技術である(例えば、非特許文献2参照)。 On the other hand, "programming" is a technique for describing a test code using a library for operating a browser as a program and executing a test using the test code (see, for example, Non-Patent Document 2).
 しかしながら、前者(「Record & Replay」)は、ユーザの操作の単なる羅列がテストスクリプトとして生成されるため、保守性が低いという問題がある。例えば、或る画面要素の識別情報(ロケータ)や、或る画面要素に対する同じ操作がテストスクリプト内の複数箇所に出現するため、ロケータや操作に変更が発生した場合、テストスクリプト中の複数箇所にわたって修正が必要となる。 However, the former ("Record & Play") has a problem of low maintainability because a simple list of user operations is generated as a test script. For example, since the identification information (locator) of a certain screen element and the same operation for a certain screen element appear in multiple places in the test script, when a change occurs in the locator or operation, it spans multiple places in the test script. It needs to be fixed.
 一方、後者(「プログラミング」)は、テストスクリプトの実装に時間とスキルとが要求されるため非効率であるという問題がある。 On the other hand, the latter (“programming”) has the problem of being inefficient because it requires time and skill to implement the test script.
 本発明は、上記の点に鑑みてなされたものであって、保守性の高いテストスクリプトを効率的に生成可能とすることを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to enable efficient generation of a highly maintainable test script.
 そこで上記課題を解決するため、テストスクリプト生成装置は、1以上の画面遷移に関する各画面に対する手動による操作、前記操作の対象及び前記画面遷移のそれぞれを示す情報が記録された操作ログを参照して、前記画面遷移における遷移元の画面ごとに、当該画面から他の画面に遷移するまでに行われた操作列を実行するメソッドを含むページオブジェクトの定義を生成する第1の生成部と、前記メソッドを組み合わせることで、テストスクリプトを生成する第2の生成部と、を有する。 Therefore, in order to solve the above problem, the test script generator refers to the operation log in which the manual operation for each screen related to one or more screen transitions, the target of the operation, and the information indicating each of the screen transitions are recorded. A first generation unit that generates a definition of a page object including a method for executing an operation sequence performed from the screen to another screen for each transition source screen in the screen transition, and the method. It has a second generation unit that generates a test script by combining the above.
 保守性の高いテストスクリプトを効率的に生成可能とすることができる。 It is possible to efficiently generate test scripts with high maintainability.
本発明の実施の形態におけるテストスクリプト生成装置10のハードウェア構成例を示す図である。It is a figure which shows the hardware configuration example of the test script generation apparatus 10 in embodiment of this invention. 本発明の実施の形態におけるテストスクリプト生成装置10の機能構成例を示す図である。It is a figure which shows the functional structure example of the test script generation apparatus 10 in embodiment of this invention. テストスクリプト生成装置10が実行する処理手順の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the processing procedure executed by the test script generation apparatus 10. ページオブジェクトの生成処理の処理手順の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the processing procedure of the page object generation processing. テストケースの生成処理の処理手順の一例を説明するためのフローチャートである。It is a flowchart for demonstrating an example of the process procedure of the test case generation process.
 以下、図面に基づいて本発明の実施の形態を説明する。図1は、本発明の実施の形態におけるテストスクリプト生成装置10のハードウェア構成例を示す図である。図1のテストスクリプト生成装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、インタフェース装置105、表示装置106、及び入力装置107等を有する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing a hardware configuration example of the test script generation device 10 according to the embodiment of the present invention. The test script generation device 10 of FIG. 1 has a drive device 100, an auxiliary storage device 102, a memory device 103, a CPU 104, an interface device 105, a display device 106, an input device 107, and the like, which are connected to each other by a bus B, respectively. ..
 テストスクリプト生成装置10での処理を実現するプログラムは、CD-ROM等の記録媒体101によって提供される。プログラムを記憶した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。 The program that realizes the processing in the test script generation device 10 is provided by a recording medium 101 such as a CD-ROM. When the recording medium 101 storing the program is set in the drive device 100, the program is installed in the auxiliary storage device 102 from the recording medium 101 via the drive device 100. However, the program does not necessarily have to be installed from the recording medium 101, and may be downloaded from another computer via the network. The auxiliary storage device 102 stores the installed program and also stores necessary files, data, and the like.
 メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従ってテストスクリプト生成装置10に係る機能を実現する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。表示装置106はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置107はキーボード及びマウス等で構成され、様々な操作指示を入力させるために用いられる。 The memory device 103 reads and stores the program from the auxiliary storage device 102 when the program is instructed to start. The CPU 104 realizes the function related to the test script generation device 10 according to the program stored in the memory device 103. The interface device 105 is used as an interface for connecting to a network. The display device 106 displays a programmatic GUI (Graphical User Interface) or the like. The input device 107 is composed of a keyboard, a mouse, and the like, and is used for inputting various operation instructions.
 図2は、本発明の実施の形態におけるテストスクリプト生成装置10の機能構成例を示す図である。図2において、テストスクリプト生成装置10は、操作ログ記録部11、ページオブジェクト生成部12及びテストケース生成部13等を有する。これら各部は、テストスクリプト生成装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。テストスクリプト生成装置10は、また、操作ログ記憶部121を利用する。操作ログ記憶部121は、例えば、補助記憶装置102、又はテストスクリプト生成装置10にネットワークを介して接続可能な記憶装置等を用いて実現可能である。 FIG. 2 is a diagram showing a functional configuration example of the test script generation device 10 according to the embodiment of the present invention. In FIG. 2, the test script generation device 10 includes an operation log recording unit 11, a page object generation unit 12, a test case generation unit 13, and the like. Each of these parts is realized by a process of causing the CPU 104 to execute one or more programs installed in the test script generation device 10. The test script generation device 10 also uses the operation log storage unit 121. The operation log storage unit 121 can be realized by using, for example, an auxiliary storage device 102, a storage device that can be connected to the test script generation device 10 via a network, or the like.
 以下、テストスクリプト生成装置10が実行する処理手順について説明する。図3は、テストスクリプト生成装置10が実行する処理手順の一例を説明するためのフローチャートである。 Hereinafter, the processing procedure executed by the test script generation device 10 will be described. FIG. 3 is a flowchart for explaining an example of a processing procedure executed by the test script generation device 10.
 ステップS101において、操作ログ記録部11は、テストスクリプトの生成対象のアプリケーション(以下、「対象アプリ」という。)に対する、テスターによる手動による操作に基づくテストに関するログ(以下、「操作ログ」という。)を操作ログ記憶部121に記録する。操作ログには、テスト中の操作、操作対象及び画面遷移のそれぞれを示す情報等が時系列に含まれる。なお、操作を示す情報とは、クリック、ダブルクリック、入力といった操作種類の情報である。操作対象の情報とは、操作された画面要素(HTM要素等)の識別情報(例えば、id、name、xpathといったHTMLの属性)である。画面遷移の情報とは、遷移元の画面の識別情報(タイトル及びURL等)と、遷移先の画面の識別情報(タイトル及びURL等)とを含む情報である。 In step S101, the operation log recording unit 11 logs the test based on the manual operation by the tester for the application for which the test script is generated (hereinafter, referred to as “target application”) (hereinafter, referred to as “operation log”). Is recorded in the operation log storage unit 121. The operation log includes information indicating each of the operation under test, the operation target, and the screen transition in chronological order. The information indicating the operation is information on the operation type such as click, double-click, and input. The operation target information is identification information (for example, HTML attributes such as id, name, and xpath) of the operated screen element (HTML element, etc.). The screen transition information is information including identification information (title, URL, etc.) of the transition source screen and identification information (title, URL, etc.) of the transition destination screen.
 操作ログの記録は、公知の方法を用いて実行されてもよい。例えば、Webアプリであれば、当該Webアプリの各画面のHTML中の各HTML要素に対して、当該画面に対する操作を検知するためのソースコード(スクリプト等)を埋め込んでおき、操作ログ記録部11は、当該操作の検知に応じて、操作ログを記録してもよい。又は、「https://www.ieice.org/ken/paper/2019052581N3/」に開示された方法が用いられて操作ログの記録が行われてもよい。 Recording of the operation log may be performed using a known method. For example, in the case of a Web application, a source code (script or the like) for detecting an operation on the screen is embedded in each HTML element in the HTML of each screen of the Web application, and the operation log recording unit 11 May record an operation log in response to the detection of the operation. Alternatively, the operation log may be recorded using the method disclosed in "https://www.ieice.org/ken/paper/2019052581N3/".
 操作ログの記録が完了すると、ステップS102以降が実行される。なお、ステップS102以降は、ステップS101に対して非同期なタイミングで実行されてもよい。 When the operation log recording is completed, step S102 and subsequent steps are executed. In addition, after step S102, it may be executed at an asynchronous timing with respect to step S101.
 ステップS102において、ページオブジェクト生成部12は、操作ログを参照してページオブジェクトの生成処理を実行する。ページオブジェクトとは、画面(ページ)中の要素(画面要素)とに対する操作列をメソッドとして有するオブジェクトである。具体的には、ページオブジェクト生成部12は、操作ログにおいて遷移した画面とごとに、操作ログにおける当該画面に対する操作列に対応するメソッドを有するページオブジェクトのクラスの定義をテストスクリプト内に生成する。 In step S102, the page object generation unit 12 executes the page object generation process with reference to the operation log. A page object is an object that has an operation sequence for an element (screen element) in a screen (page) as a method. Specifically, the page object generation unit 12 generates a definition of a page object class having a method corresponding to an operation sequence for the screen in the operation log for each screen transitioned in the operation log in the test script.
 続いて、テストケース生成部13は、各ページオブジェクトで定義されたメソッドを組み合わせることによってテストケースを生成し、当該テストケースをテストスクリプトに追加する(S103)。なお、テストケースとは、或る画面を起点とし、画面遷移において終端の画面までのパス(経路)に対応する画面遷移を発生させるテストの単位をいう。1つのテストスクリプトは、1以上のテストケースを含む。 Subsequently, the test case generation unit 13 generates a test case by combining the methods defined in each page object, and adds the test case to the test script (S103). A test case is a unit of a test that starts from a certain screen and generates a screen transition corresponding to a path to the end screen in the screen transition. One test script contains one or more test cases.
 続いて、ステップS102の詳細について説明する。図4は、ページオブジェクトの生成処理の処理手順の一例を説明するためのフローチャートである。なお、図4では、便宜上、1つの画面に対するページオブジェクト(すなわち、1つのページオブジェクト)のクラス定義の生成手順について説明する。したがって、図4の処理手順は、操作ログにおける遷移元又は遷移先の画面ごとに実行される。但し、操作ログにおいて同じ画面に対する遷移が複数回発生している場合、同じ画面に対して当該処理手順は1回実行されればよい。以下、処理対象とされている画面を「対象画面」といい、対象画面に対するページオブジェクトを「対象オブジェクト」という。 Subsequently, the details of step S102 will be described. FIG. 4 is a flowchart for explaining an example of the processing procedure of the page object generation processing. Note that, for convenience, FIG. 4 describes a procedure for generating a class definition of a page object (that is, one page object) for one screen. Therefore, the processing procedure of FIG. 4 is executed for each screen of the transition source or transition destination in the operation log. However, if the transition to the same screen occurs a plurality of times in the operation log, the processing procedure may be executed once for the same screen. Hereinafter, the screen to be processed is referred to as a "target screen", and the page object for the target screen is referred to as a "target object".
 ステップS201において、ページオブジェクト生成部12は、操作ログを参照して、対象画面において一度でも操作対象とされた画面要素を特定する。 In step S201, the page object generation unit 12 refers to the operation log and identifies the screen element that has been the operation target even once on the target screen.
 続いて、ページオブジェクト生成部12は、操作対象とされた画面要素ごとに、フィールド(属性)の定義を対象オブジェクトのクラス定義に追加する(S202)。各フィールドの名前(フィールド名)は、画面要素を識別するための変数名であり、その値は、当該画面要素の実際の(例えば、HTMLの定義における)ロケータである。ロケータとして用いる値は、耐変更性を重視し、id、name、label、xpathの順で優先されてもよい。 Subsequently, the page object generation unit 12 adds the field (attribute) definition to the class definition of the target object for each screen element targeted for operation (S202). The name of each field (field name) is a variable name for identifying the screen element, and its value is the actual locator (for example, in the definition of HTML) of the screen element. The value used as the locator may be prioritized in the order of id, name, label, and xpath, with an emphasis on change resistance.
 続くステップS203以降において、ページオブジェクト生成部12は、対象オブジェクトのメソッドの定義を生成するための処理を実行する。当該処理では、対象画面に遷移してから離れるまでにテスターが行った一連の操作を意味のあるひとまとまりの動作として扱われる。対象画面に遷移してから離れるまでに行われた一連の操作を「操作列」という。なお、「離れるまで」とは、対象画面から他の画面に遷移するまでや、対象画面において一連の操作を終了するまでをいう。 In the following step S203 and subsequent steps, the page object generation unit 12 executes a process for generating a method definition of the target object. In this process, a series of operations performed by the tester from the transition to the target screen to the departure from the target screen are treated as a meaningful group of operations. A series of operations performed from the transition to the target screen to the departure is called an "operation sequence". In addition, "until leaving" means until the transition from the target screen to another screen or until the end of a series of operations on the target screen.
 ステップS203において、ページオブジェクト生成部12は、操作ログから対象画面に対する操作列を抽出する。1つの画面に関して複数の操作列が抽出される可能性が有る。或る画面に対する操作手順は複数通り存在しうるからである。本実施の形態では、各操作列が対象オブジェクトのメソッドの候補となる。 In step S203, the page object generation unit 12 extracts the operation sequence for the target screen from the operation log. There is a possibility that a plurality of operation sequences will be extracted for one screen. This is because there can be a plurality of operation procedures for a certain screen. In the present embodiment, each operation sequence is a candidate for the method of the target object.
 続いて、ページオブジェクト生成部12は、抽出された操作列ごとにループ処理L1を実行する。ループ処理L1において処理対象とされている操作列を、以下「対象操作列」という。 Subsequently, the page object generation unit 12 executes the loop process L1 for each extracted operation sequence. The operation sequence targeted for processing in the loop processing L1 is hereinafter referred to as a “target operation sequence”.
 ステップS204において、対象操作列が、対象画面に対する他の操作列(以下、単に「他の操作列」という。)に包含されるか否かを判定する。すなわち、対象画面に関して抽出された全ての操作列をメソッドとして採用した場合、操作ログが長い場合に大量の重複したメソッドが生成されてしまう可能性が有る。当該判定は、重複したメソッドの生成を抑制するためのものである。 In step S204, it is determined whether or not the target operation sequence is included in another operation sequence for the target screen (hereinafter, simply referred to as "another operation sequence"). That is, when all the operation columns extracted for the target screen are adopted as methods, there is a possibility that a large number of duplicate methods will be generated when the operation log is long. The determination is for suppressing the generation of duplicate methods.
 ここで、操作列Aが操作列Bに包含されるとは、A=Bの場合、又はAの操作対象の列をA'、Bの操作対象の列をB'としたときに、A'がB'の部分列になっていることと定義する。例えば、A'=[a,b,d]、B'=[a,b,c,d]である場合、A'はB'の部分列であるため、操作列Aは操作列Bに包含される。このとき、操作対象のみが考慮されるため、入力値が異なっていたとしても包含関係は認められる。一方、A'=[a,b,d]、B'=[a,c,d]の場合、操作列A及び操作列Bは、お互い包含関係を有さない。 Here, the operation column A is included in the operation column B when A = B, or when the operation target column of A is A'and the operation target column of B is B', A'. Is defined as a subsequence of B'. For example, when A'= [a, b, d] and B'= [a, b, c, d], the operation sequence A is included in the operation sequence B because A'is a subsequence of B'. Will be done. At this time, since only the operation target is considered, the inclusion relationship is recognized even if the input values are different. On the other hand, when A'= [a, b, d] and B'= [a, c, d], the operation sequence A and the operation sequence B do not have an inclusion relationship with each other.
 対象操作列が他の操作列に包含される場合(S204でYes)、ページオブジェクト生成部12は、対象操作列と当該他の操作列との遷移先の画面が同一であるか否かを操作ログを参照して判定する(S205)。対象操作列と当該他の操作列との遷移先の画面が同一である場合(S205でYes)、ページオブジェクト生成部12は、対象操作列を実行するメソッドの定義の生成を行わない。 When the target operation string is included in another operation column (Yes in S204), the page object generation unit 12 operates whether or not the screen of the transition destination between the target operation column and the other operation sequence is the same. Judgment is made with reference to the log (S205). When the screen of the transition destination between the target operation sequence and the other operation sequence is the same (Yes in S205), the page object generation unit 12 does not generate the definition of the method that executes the target operation sequence.
 一方、対象操作列が他の操作列に包含されない場合(S204でNo)、又は対象操作列と当該他の操作列との遷移先の画面が異なる場合(S205でNo)、ページオブジェクト生成部12は、対象オブジェクトについて、対象操作列を実行するメソッドの定義を生成し、当該定義をテストスクリプトに追加する(S205)。この際、対象操作列を構成する各操作の対象とされている画面要素のロケータは、ステップS202において生成されたフィールド名に置換される。そうすることで、各画面要素のロケータの変更に対する耐性が担保される。また、メソッド名は、例えば、「goto<遷移先画面名><通番>」とされる。なお、生成されたメソッドの定義に対して、開発者による修正が行われてもよい。 On the other hand, when the target operation sequence is not included in the other operation sequence (No in S204), or when the transition destination screen between the target operation row and the other operation sequence is different (No in S205), the page object generation unit 12 Generates a definition of a method that executes the target operation sequence for the target object, and adds the definition to the test script (S205). At this time, the locator of the screen element targeted for each operation constituting the target operation sequence is replaced with the field name generated in step S202. By doing so, resistance to changes in the locator of each screen element is ensured. The method name is, for example, "goto <transition destination screen name> <serial number>". The developer may modify the generated method definition.
 ステップS204~S206に示される処理手順でメソッドが生成されることで、遷移先と操作対象がユニークで、かつ、実行される操作列が長いメソッドが生成される。 By generating a method in the processing procedure shown in steps S204 to S206, a method in which the transition destination and the operation target are unique and the operation sequence to be executed is long is generated.
 続いて、図3のステップS103の詳細について説明する。テストケース生成部13は、ステップS102において生成された各ページオブジェクトのクラスで定義されたメソッドを組み合わせることで、テストスクリプトに含めるテストケースを生成する。 Subsequently, the details of step S103 of FIG. 3 will be described. The test case generation unit 13 generates a test case to be included in the test script by combining the methods defined in the class of each page object generated in step S102.
 具体的にどのようなテストケースを自動化すべきかについては場合によるが、本実施の形態では以下の条件でテストケースを生成する例について説明する。
(1)テストケース群が操作ログにおける全ての画面遷移を網羅する。
(2)1つのテストケースで同じ画面には一度しか訪れない。
(3)(2)の条件において、画面遷移列が最大となるテストケースを採用する。
Specifically, what kind of test case should be automated depends on the case, but in this embodiment, an example of generating a test case under the following conditions will be described.
(1) The test case group covers all screen transitions in the operation log.
(2) One test case visits the same screen only once.
(3) Under the conditions of (2), a test case in which the screen transition sequence is maximized is adopted.
 条件(1)~(3)を満たすテストケースは1本のユースケースを確認している場合が多く、汎用性の高い最低限のテストケースであると考えられる。もし、テストケースに不備があったとしても、生成されたページオブジェクトとテストケースのスクリプトは再利用性が高いため、開発者は効率よく修正することができる。 The test cases that satisfy the conditions (1) to (3) often confirm one use case, and are considered to be the minimum test cases with high versatility. Even if the test case is flawed, the generated page object and test case script are highly reusable and can be modified efficiently by the developer.
 画面遷移を網羅し、かつ、画面遷移列を最大化するテストケースの生成方法(上記(1)~(3)の条件を満たすテストケースの生成方法)の一例について説明する。 An example of a test case generation method (a test case generation method satisfying the above conditions (1) to (3)) that covers screen transitions and maximizes the screen transition sequence will be described.
 操作ログを解析することで、操作ログの範囲で、対象アプリの画面遷移図を復元することができる。画面遷移図とは、遷移元又は遷移先の画面をノードとし、画面遷移をエッジとする木構造のグラフである。この画面遷移図を深さ優先探索などの方法で全探索を行う。これにより、トップページ(ログイン画面等)のノード(ルートノード)から開始して終端のノードで終了するパス(経路)であって、かつ、同じ画面(ノード)に二度遷移しないパス(経路)の一覧を取得する。取得したパスごとに、当該パスに係る画面遷移が発生するように、当該画面遷移に係る各画面に対応するページオブジェクトのメソッドを連続して呼び出すようなスクリプトを1つのテストケースとする。なお、或る画面遷移に対応するメソッドは、当該画面遷移の遷移元の画面に対応するページオブジェクトのメソッドであって、遷移先の画面の画面名をメソッド名に含むメソッドである。 By analyzing the operation log, the screen transition diagram of the target application can be restored within the range of the operation log. The screen transition diagram is a graph of a tree structure in which the screen of the transition source or the transition destination is a node and the screen transition is an edge. A full search is performed on this screen transition diagram by a method such as depth-first search. As a result, the path (route) that starts from the node (root node) on the top page (login screen, etc.) and ends at the terminal node, and does not transition to the same screen (node) twice. Get a list of. One test case is a script that continuously calls the method of the page object corresponding to each screen related to the screen transition so that the screen transition related to the path is generated for each acquired path. The method corresponding to a certain screen transition is a method of the page object corresponding to the transition source screen of the screen transition, and is a method including the screen name of the transition destination screen in the method name.
 図5は、テストケースの生成処理の処理手順の一例を説明するためのフローチャートである。 FIG. 5 is a flowchart for explaining an example of the processing procedure of the test case generation process.
 ステップS301において、テストケース生成部13は、操作ログに基づいて、対象アプリの画面遷移図を生成する。画面遷移図の生成は、公知の方法を用いて行われればよい。 In step S301, the test case generation unit 13 generates a screen transition diagram of the target application based on the operation log. The screen transition diagram may be generated by using a known method.
 続いて、テストケース生成部13は、画面遷移図のルートノードから終端ノードまでのパスであって、かつ、同じノードを2度含まないパスの一覧を探索する(S302)。 Subsequently, the test case generation unit 13 searches a list of paths that are paths from the root node to the terminal node in the screen transition diagram and do not include the same node twice (S302).
 続いて、テストケース生成部13は、探索されたパスごとに、当該パスに係る画面遷移が発生するように、当該画面遷移に係る各画面に対応するページオブジェクトのメソッドを連続して呼び出すようなテストケースを生成し、生成したテストケースをテストスクリプトに追加する(S303)。 Subsequently, the test case generation unit 13 continuously calls the method of the page object corresponding to each screen related to the screen transition so that the screen transition related to the path is generated for each searched path. Generate a test case and add the generated test case to the test script (S303).
 なお、対象アプリのテストスクリプトの生成後に、対象アプリの機能が追加された場合、追加機能に対するテストが必要となる。この場合、追加機能について手動によりテストが行われ、当該テストに関して操作ログが記録されればよい。当該操作ログに基づいて、図3のステップS102及びS103が実行されることで、追加された機能や画面に対してページオブジェクトの追加、及び既存のページオブジェクトへのメソッドの追加等を行うことができる。 If the function of the target application is added after the test script of the target application is generated, it is necessary to test the additional function. In this case, the additional function may be manually tested and the operation log may be recorded for the test. By executing steps S102 and S103 of FIG. 3 based on the operation log, it is possible to add a page object to the added function or screen, add a method to an existing page object, and the like. can.
 上述したように、本実施の形態によれば、手動よる操作(手動テスト)において記録される操作ログに基づいてテストスクリプトが自動的に生成される。また、当該テストスクリプトは、対象アプリの各画面について生成されるページオブジェクトのメソッドの組み合わせによって生成される。クローリングに基づくログではなく操作ログに基づいてページオブジェクトが生成されることで、不要な画面遷移がログに記録される可能性が低下し、不要なページオブジェクトの生成を抑制することができ、意味のあるひとまとまりの動作をメソッド化することができる
 また、各画面の画面要素のロケータは、基本的に、ページオブジェクトのフィールド名(属性名)によって隠蔽されるため、ロケータの出現箇所は、ページオブジェクトのフィールドの定義に限定される。また、各画面に対する一連の操作(ログイン操作等)は、ページオブジェクトのメソッド内に隠蔽される。その結果、ロケータが変更された場合や、画面要素の操作自体に変更があった場合のテストスクリプトの修正量を少量化することがでる。したがって、本実施の形態によれば、保守性の高いテストスクリプトを効率的に生成可能とすることができる。すなわち、手動テストを実施するだけで、保守性の高い自動テストのスクリプトを生成することができる。テスト対象に機能追加などがあった場合も、適宜新しい機能に対してテストスクリプトを生成することができる。
As described above, according to the present embodiment, the test script is automatically generated based on the operation log recorded in the manual operation (manual test). In addition, the test script is generated by a combination of methods of page objects generated for each screen of the target application. By generating page objects based on operation logs instead of crawling logs, the possibility of unnecessary screen transitions being recorded in the log is reduced, and the generation of unnecessary page objects can be suppressed, meaning. In addition, the locator of the screen element of each screen is basically hidden by the field name (attribute name) of the page object, so the place where the locator appears is the page. Limited to object field definitions. In addition, a series of operations (login operation, etc.) for each screen are hidden in the method of the page object. As a result, it is possible to reduce the amount of modification of the test script when the locator is changed or when the operation of the screen element itself is changed. Therefore, according to the present embodiment, it is possible to efficiently generate a test script with high maintainability. That is, it is possible to generate a highly maintainable automated test script simply by performing a manual test. Even if a function is added to the test target, a test script can be generated for the new function as appropriate.
 なお、本実施の形態において、ページオブジェクト生成部12は、第1の生成部の一例である。テストケース生成部13は、第2の生成部の一例である。 In the present embodiment, the page object generation unit 12 is an example of the first generation unit. The test case generation unit 13 is an example of the second generation unit.
 以上、本発明の実施の形態について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 Although the embodiments of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications are made within the scope of the gist of the present invention described in the claims.・ Can be changed.
10     テストスクリプト生成装置
11     操作ログ記録部
12     ページオブジェクト生成部
13     テストケース生成部
100    ドライブ装置
101    記録媒体
102    補助記憶装置
103    メモリ装置
104    CPU
105    インタフェース装置
106    表示装置
107    入力装置
121    操作ログ記憶部
B      バス
10 Test script generation device 11 Operation log recording unit 12 Page object generation unit 13 Test case generation unit 100 Drive device 101 Recording medium 102 Auxiliary storage device 103 Memory device 104 CPU
105 Interface device 106 Display device 107 Input device 121 Operation log storage B bus

Claims (7)

  1.  1以上の画面遷移に関する各画面に対する手動による操作、前記操作の対象及び前記画面遷移のそれぞれを示す情報が記録された操作ログを参照して、前記画面遷移における遷移元の画面ごとに、当該画面から他の画面に遷移するまでに行われた操作列を実行するメソッドを含むページオブジェクトの定義を生成する第1の生成部と、
     前記メソッドを組み合わせることで、テストスクリプトを生成する第2の生成部と、
    を有することを特徴とするテストスクリプト生成装置。
    Refer to the operation log in which the manual operation for each screen related to one or more screen transitions, the target of the operation, and the information indicating each of the screen transitions are recorded, and for each transition source screen in the screen transition, the screen concerned. The first generator that generates the definition of the page object that contains the method that executes the operation sequence performed from to the transition to another screen, and
    By combining the above methods, a second generator that generates a test script and
    A test script generator characterized by having.
  2.  前記第1の生成部は、同一の画面に対する第1の操作列と第2の操作列との遷移先の画面が同一である場合であって、前記第1の操作列の操作対象の列が、第2の操作列の操作対象の列の部分列である場合には、当該画面に対するページオブジェクトについて、前記第1の操作列を実行するメソッドを生成しない、
    ことを特徴とする請求項1記載のテストスクリプト生成装置。
    The first generation unit is a case where the transition destination screens of the first operation row and the second operation row for the same screen are the same, and the operation target row of the first operation row is , If it is a subsequence of the operation target column of the second operation column, the method that executes the first operation column is not generated for the page object for the screen.
    The test script generator according to claim 1.
  3.  前記第2の生成部は、前記操作ログに含まれる全ての画面遷移が発生するように前記メソッドを組み合わせる、
    ことを特徴とする請求項1又は2記載のテストスクリプト生成装置。
    The second generator combines the methods so that all screen transitions included in the operation log occur.
    The test script generator according to claim 1 or 2.
  4.  前記第2の生成部は、同じ画面には1度しか遷移しないように、前記メソッドを組み合わせる、
    ことを特徴とする請求項1乃至3いずれか一項記載のテストスクリプト生成装置。
    The second generator combines the methods so that the same screen only transitions once.
    The test script generator according to any one of claims 1 to 3, wherein the test script generator is characterized by the above.
  5.  前記第2の生成部は、画面遷移列が最大化されるように、前記メソッドを組み合わせる、
    ことを特徴とする請求項4記載のテストスクリプト生成装置。
    The second generator combines the methods so that the screen transition sequence is maximized.
    The test script generator according to claim 4.
  6.  1以上の画面遷移に関する各画面に対する手動による操作、前記操作の対象及び前記画面遷移のそれぞれを示す情報が記録された操作ログを参照して、前記画面遷移における遷移元の画面ごとに、当該画面から他の画面に遷移するまでに行われた操作列を実行するメソッドを含むページオブジェクトの定義を生成する第1の生成手順と、
     前記メソッドを組み合わせることで、テストスクリプトを生成する第2の生成手順と、
    をコンピュータが実行することを特徴とするテストスクリプト生成方法。
    Refer to the operation log in which the manual operation for each screen related to one or more screen transitions, the target of the operation, and the information indicating each of the screen transitions are recorded, and for each transition source screen in the screen transition, the screen concerned. The first generation procedure to generate the definition of the page object including the method that executes the operation sequence performed from to the transition to another screen, and
    By combining the above methods, the second generation procedure to generate the test script and
    A test script generation method characterized by a computer running.
  7.  請求項1乃至5いずれか一項記載のテストスクリプト生成装置としてコンピュータを機能させることを特徴とするプログラム。 A program characterized by operating a computer as a test script generator according to any one of claims 1 to 5.
PCT/JP2020/015909 2020-04-09 2020-04-09 Test script generation device, test script generation method, and program WO2021205589A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2020/015909 WO2021205589A1 (en) 2020-04-09 2020-04-09 Test script generation device, test script generation method, and program
JP2022513789A JP7380851B2 (en) 2020-04-09 2020-04-09 Test script generation device, test script generation method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/015909 WO2021205589A1 (en) 2020-04-09 2020-04-09 Test script generation device, test script generation method, and program

Publications (1)

Publication Number Publication Date
WO2021205589A1 true WO2021205589A1 (en) 2021-10-14

Family

ID=78023618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/015909 WO2021205589A1 (en) 2020-04-09 2020-04-09 Test script generation device, test script generation method, and program

Country Status (2)

Country Link
JP (1) JP7380851B2 (en)
WO (1) WO2021205589A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023067806A1 (en) * 2021-10-22 2023-04-27 日本電信電話株式会社 Testing device, testing method, and program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002014845A (en) * 2000-06-28 2002-01-18 Hitachi Ltd Method for automatically generating test script part and device for the same
JP2007052703A (en) * 2005-08-19 2007-03-01 Fujitsu Ltd Test scenario creation program, test scenario creation apparatus, and test scenario creation method
JP2019159690A (en) * 2018-03-12 2019-09-19 富士通株式会社 Information processing program, information processing method, and information processor
JP2020004113A (en) * 2018-06-28 2020-01-09 株式会社東芝 Information display device, information display program, and information display method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002014845A (en) * 2000-06-28 2002-01-18 Hitachi Ltd Method for automatically generating test script part and device for the same
JP2007052703A (en) * 2005-08-19 2007-03-01 Fujitsu Ltd Test scenario creation program, test scenario creation apparatus, and test scenario creation method
JP2019159690A (en) * 2018-03-12 2019-09-19 富士通株式会社 Information processing program, information processing method, and information processor
JP2020004113A (en) * 2018-06-28 2020-01-09 株式会社東芝 Information display device, information display program, and information display method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MUSO, TORU ET AL.: "Evaluation of a Case of Business Process Improvement and Estimation on its Effect", PROCEEDINGS OF THE 70TH NATIONAL CONVENTION OF IPSJ, 13 March 2008 (2008-03-13), pages 1 - 222 *
NOZAKI, HIROFUMI ET AL.: "NEW STANDARDS FOR JAVA: 9. AUTOMATED BROWSER TESTING WITH SELENIDE", vol. 100, 6 September 2017, ISBN: 987-4-7741-9129-4, pages: 138 - 145 *
TASHIRO, DAISUKE ET AL.: "I nput U1 Specification Recovery using Web Operation Monitoring", IEICE TECHNICAL REPORT., vol. 115, no. 294, 30 October 2015 (2015-10-30), pages 45 - 52, ISSN: 0913-5685 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023067806A1 (en) * 2021-10-22 2023-04-27 日本電信電話株式会社 Testing device, testing method, and program

Also Published As

Publication number Publication date
JP7380851B2 (en) 2023-11-15
JPWO2021205589A1 (en) 2021-10-14

Similar Documents

Publication Publication Date Title
US7810070B2 (en) System and method for software testing
JP4148527B2 (en) Functional test script generator
US7617486B2 (en) Method and system to automate software testing using sniffer side and browser side recording and a toolbar interface
US20160132421A1 (en) Adaptation of automated test scripts
WO2002100034A1 (en) System and process for testing an application
JP2006350686A (en) Instruction set simulator generation device and simulator generation method
Sacramento et al. Web application model generation through reverse engineering and UI pattern inferring
WO2021205589A1 (en) Test script generation device, test script generation method, and program
CN112231197A (en) Page testing method and device and storage medium
CN107038117A (en) It is a kind of based on the web automated testing methods that reference is defined between event handling function
Zarrad A Systematic Review on Regression Testing for Web-Based Applications.
Almeida et al. Mutation-based web test case generation
JP2010102620A (en) User operation scenario generating device, method and program
WO2020209227A1 (en) Analysis device, analysis method, and program
JP7318704B2 (en) Test equipment, test method and program
US9495336B2 (en) Method and apparatus for comparing process designs
Al-Zain et al. Automated user interface testing for web applications and TestComplete
JP2008305019A (en) Simulation device, simulation method and program
JP2017041196A (en) Stub object determination device, method, and program
JP2010055293A (en) Verification assisting program, verification assisting apparatus, and verification assisting method
US12001324B2 (en) Operation pattern generation apparatus, operation pattern generation method and program
GB2397905A (en) Method for automatically generating and ordering test scripts
Reger Suggesting edits to explain failing traces
Phan et al. Hyperagent: Generalist software engineering agents to solve coding tasks at scale
JP5578625B2 (en) Program analysis apparatus, program analysis method, and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20930556

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022513789

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20930556

Country of ref document: EP

Kind code of ref document: A1