JP6723976B2 - Test execution device and program - Google Patents

Test execution device and program Download PDF

Info

Publication number
JP6723976B2
JP6723976B2 JP2017233974A JP2017233974A JP6723976B2 JP 6723976 B2 JP6723976 B2 JP 6723976B2 JP 2017233974 A JP2017233974 A JP 2017233974A JP 2017233974 A JP2017233974 A JP 2017233974A JP 6723976 B2 JP6723976 B2 JP 6723976B2
Authority
JP
Japan
Prior art keywords
screen
transition
test
input
information
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
JP2017233974A
Other languages
Japanese (ja)
Other versions
JP2019101889A (en
Inventor
利行 倉林
利行 倉林
宗吉 伊山
宗吉 伊山
治門 丹野
治門 丹野
弘之 切貫
弘之 切貫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2017233974A priority Critical patent/JP6723976B2/en
Publication of JP2019101889A publication Critical patent/JP2019101889A/en
Application granted granted Critical
Publication of JP6723976B2 publication Critical patent/JP6723976B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、テスト実行装置及びプログラムに関する。 The present invention relates to a test execution device and a program.

近年、ニーズに合ったサービスを迅速に提供するため、サービスを短いサイクルで提供する開発スタイルが増加しており、それに伴いソフトウェアテストの頻度も増加している。このような中、Webアプリケーションにおいて、機能テストにおける画面遷移テストに稼働がかかることが問題となっている。機能テストとはJSTQB(非特許文献1)によると「コンポーネント(独立してテストできるソフトウェアの最小単位)やシステム(コンポーネントのセット)の機能仕様の分析に基づいて実施するテスト」と定義され、コンポーネントレベルの機能を確認するテストから、システムレベルの機能を確認するテストまで存在する。 In recent years, in order to provide services that meet needs quickly, the development style of providing services in a short cycle is increasing, and the frequency of software testing is increasing accordingly. Under such circumstances, it is a problem that the screen transition test in the function test is activated in the Web application. According to JSTQB (Non-Patent Document 1), a functional test is defined as "a test performed based on an analysis of a functional specification of a component (a minimum unit of software that can be independently tested) or a system (a set of components)." There are tests that check the functionality of the level to tests that check the function of the system level.

機能テストにおける画面遷移テストは、機能テストの中でも、「クライアントサイドからのインタラクションに対し、クライアントサイドに表示される画面から、仕様通りに実装されているかどうかを確認することができる機能に対するテスト」とここでは定義する。 The screen transition test in the functional test is, among the functional tests, "a test for the function that allows you to confirm whether the screen is displayed on the client side according to the interaction from the client side, according to the specifications". Define here.

機能テストにおける画面遷移テストに稼働がかかるのは、クライアントサイドからのインタラクションとして、画面にあるリンクやボタンをクリックしたり、フォームに適切な値を入力するなどの人間の操作が求められるためである。このような画面遷移テストを自動化し、稼働削減を狙う方法として、テストケースをスクリプト化し、自動実行する手法が広く知られている。 The reason why the screen transition test in the functional test is activated is that human interaction such as clicking a link or button on the screen or inputting an appropriate value in the form is required as the interaction from the client side. .. As a method of automating such a screen transition test and aiming to reduce the operation, a method of scripting a test case and automatically executing it is widely known.

テストケースを人手でスクリプト化するには稼働がかかるため、以下の2つのテストスクリプト自動生成技術が存在する。
・Capture and Replay技術を用いたテストスクリプトの自動生成(非特許文献2)
・モデルベーステストによるテストスクリプトの自動生成(非特許文献3)
Since it takes time to manually script a test case, the following two test script automatic generation technologies exist.
・Automatic generation of test script using Capture and Replay technology (Non-Patent Document 2)
・Automatic generation of test script by model-based test (Non-Patent Document 3)

"JSTQB"、[online]、インターネット<URL:http://jstqb.jp/syllabus.html>"JSTQB", [online], Internet <URL: http://jstqb.jp/syllabus.html> "Selenium IDE"、[online]、インターネット<URL:https://addons.mozilla.org/ja/firefox/addon/selenium-ide/>"Selenium IDE", [online], Internet <URL: https://addons.mozilla.org/en/firefox/addon/selenium-ide/> "結合テストにおけるテスト項目自動生成手法の提案と評価"、丹野 治門,張 暁晶,星野 隆、電子情報通信学会技術研究報告、Oct 2010"Proposal and evaluation of automatic test item generation method in combination test", Harumon Tanno, Akiaki Zhang, Takashi Hoshino, IEICE technical report, Oct 2010

Capture and Replay技術では、仕様から人手で作成したテストケースをユーザが実行することで、ユーザの画面に対する操作を記録してテストスクリプトとして出力することができる。しかし、Capture and Replay技術を用いた場合、画面操作を記録するためのツール操作といった追加の稼働が発生するため、一般的に3回以上同等のテストを実施しない場合は、稼働の元が取れないという欠点が存在する。 With the Capture and Replay technology, a user can manually execute a test case created from the specifications to record the operation on the user's screen and output it as a test script. However, when the Capture and Replay technology is used, additional operations such as tool operations for recording screen operations occur, so in general, if the equivalent tests are not performed three times or more, the operation cannot be recovered. There is a drawback.

モデルベーステストでは、仕様をマシンが読み取れる形式のモデルで記述することで、読み取った仕様からテストケースを自動生成し、テストスクリプトとして出力することができる。しかし、モデルを記述するための追加の稼働がかかるという欠点が存在する。 In model-based testing, by writing specifications in a machine-readable model, test cases can be automatically generated from the read specifications and output as test scripts. However, it has the disadvantage of requiring additional work to describe the model.

以上より、既存のテストスクリプト自動生成技術では、テストスクリプトを生成するための追加の稼働が発生することが問題であるということがいえる。 From the above, it can be said that the existing test script automatic generation technology has a problem that additional operation for generating the test script occurs.

本発明は、上記の点に鑑みてなされたものであって、Webアプリケーションに関するテストの実行を効率化することを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to improve the efficiency of execution of a test related to a Web application.

そこで上記課題を解決するため、テスト実行装置は、Webアプリケーションのソースコードから、前記ソースコードにおいて定義された第1の画面遷移の情報を抽出する抽出部と、前記Webアプリケーションに関して表示される画面に対する入力値を生成する第1の生成部と、前記第1の生成部が生成した入力値を前記画面に入力し、前記画面を自動的に操作する操作部と、自動的な操作によって実現される第2の画面遷移の情報を生成する第2の生成部と、前記第2の画面遷移が前記第1の画面遷移に対して不足する場合に、不足する画面遷移の遷移元の画面に対する各入力領域に対する値の入力をユーザから受け付ける受付部とを有し、前記操作部は、前記受付部が受け付けた値を前記遷移元の画面に対して入力する。 Therefore, in order to solve the above-mentioned problem, the test execution apparatus extracts the information of the first screen transition defined in the source code from the source code of the Web application, and the screen displayed for the Web application. A first generation unit that generates an input value, an operation unit that inputs the input value generated by the first generation unit into the screen and automatically operates the screen, and is realized by an automatic operation. A second generation unit that generates information on a second screen transition, and each input to the transition source screen of the insufficient screen transition when the second screen transition is insufficient for the first screen transition The operation unit has a reception unit that receives a value input to the region from the user, and the operation unit inputs the value received by the reception unit to the transition source screen.

Webアプリケーションに関するテストの実行を効率化することができる。 It is possible to efficiently execute the test related to the Web application.

同一URLでも異なる画面としてテストしたい画面の例を示す図である。It is a figure which shows the example of the screen which it wants to test as a different screen even with the same URL. 適切な入力値を生成するのが困難なフォームの例を示す図である。It is a figure which shows the example of a form in which it is difficult to generate an appropriate input value. Tree Edit Distanceの一例を示す図である。It is a figure which shows an example of Tree Edit Distance. 本発明の実施の形態におけるシステム構成例を示す図である。It is a figure which shows the system structural example in embodiment of this invention. 本発明の実施の形態におけるクライアント装置10のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the client apparatus 10 in embodiment of this invention. 本発明の実施の形態におけるクライアント装置10の機能構成例を示す図である。It is a figure which shows the function structural example of the client apparatus 10 in embodiment of this invention. クライアント装置10が実行する処理手順の一例を説明するためのフローチャートである。6 is a flowchart for explaining an example of a processing procedure executed by the client device 10. 静的解析の一例を示す図である。It is a figure which shows an example of a static analysis. 画面遷移図の一例を示す図である。It is a figure which shows an example of a screen transition diagram. 画面遷移情報の抽出処理の処理手順の一例を説明するためのフローチャートである。9 is a flowchart illustrating an example of a processing procedure of screen transition information extraction processing. テストケースの生成及び実行処理の処理手順の一例を説明するためのフローチャートである。6 is a flowchart for explaining an example of a processing procedure of test case generation and execution processing. フォームの一例を示す図である。It is a figure which shows an example of a form. テスト入力値の生成処理の処理手順の一例を説明するためのフローチャートである。9 is a flowchart illustrating an example of a processing procedure of a test input value generation processing. 或るフォームのHTMLの定義例を示す図である。It is a figure which shows the definition example of HTML of a certain form. 辞書の一例を示す図である。It is a figure which shows an example of a dictionary. 遷移先画面の判定処理の処理手順の一例を説明するためのフローチャートである。7 is a flowchart for explaining an example of a processing procedure of determination processing of a transition destination screen. DOMツリーの一例を示す図である。It is a figure which shows an example of a DOM tree. 画面遷移図の生成処理の処理手順の一例を説明するためのフローチャートである。It is a flow chart for explaining an example of a processing procedure of generation processing of a screen transition diagram. テストケースに対する入力値の補助処理の処理手順の一例を説明するためのフローチャートである。It is a flow chart for explaining an example of a processing procedure of auxiliary processing of an input value to a test case. 入力情報補助ファイルの表示例を示す図である。It is a figure which shows the example of a display of an input information auxiliary file. テストスクリプトの出力処理の処理手順の一例を説明するためのフローチャートである。9 is a flowchart illustrating an example of a processing procedure of test script output processing.

以下、図面に基づいて本発明の実施の形態を説明する。本実施の形態では、テスト対象から仕様をリバースし、リバースした仕様に基づいて網羅的なテストケースを自動生成し、テストスクリプトとして出力するといったアプローチを提案する。本アプローチによって、追加の稼働を必要とせずに網羅的なテストスクリプトを自動生成することができる。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In this embodiment, an approach is proposed in which a specification is reversed from a test target, an exhaustive test case is automatically generated based on the reversed specification, and is output as a test script. This approach allows us to automatically generate exhaustive test scripts without the need for additional work.

本実施の形態では、機能テストにおける画面遷移テストを対象としているため、以下のステップで処理が実行される。
(1)テスト対象を解析し、仕様としてテスト対象を構成する画面と画面間の繋がり、各画面に到達するための手段を抽出する。
(2)(1)で取得した仕様から機能テストにおける画面遷移テストに適した画面遷移図を生成する。
(3)(2)で生成した画面遷移図の各遷移に対応するテストスクリプトを、(1)で抽出した画面に到達するための手段の情報に基づいて、出力したいスクリプト形式に合わせて出力する。
In this embodiment, since the screen transition test in the functional test is targeted, the process is executed in the following steps.
(1) The test target is analyzed, and the screens constituting the test target as specifications and the connections between the screens and the means for reaching each screen are extracted.
(2) A screen transition diagram suitable for the screen transition test in the functional test is generated from the specifications acquired in (1).
(3) Output the test script corresponding to each transition of the screen transition diagram generated in (2) according to the script format to be output based on the information of the means for reaching the screen extracted in (1) ..

(1)ではテスト対象を構成する画面とその画面に到達するための手段を抽出する。Webアプリケーションでは、jspファイル等の画面(HTML)の元となるファイルから、クライアントサイドからのリクエストに応じて、動的に画面を生成するケースが一般的である。したがって、テスト対象がどのような画面で構成されていて、それらがどのように繋がっているかの情報は、ソースコードに直接記述されていないため、適切な解析が必要となる(技術課題1:テスト対象から仕様をリバースする方法の検討)。 In (1), a screen constituting the test target and a means for reaching the screen are extracted. In a Web application, a screen is generally generated dynamically from a file that is a source of a screen (HTML) such as a jsp file in response to a request from the client side. Therefore, the information about what kind of screen the test target is composed of and how they are connected is not directly described in the source code, and thus an appropriate analysis is required (Technical Problem 1: Test Examination of the method to reverse the specification from the target).

また、画面に到達するための手段の抽出においても、Webアプリケーションでは、特定の入力値を与えないと遷移することができない画面遷移が存在する。例えば、電話番号を登録するようなシステムにおいて、11桁の半角数字でないと登録完了画面に遷移できないケースが挙げられる。このような画面遷移に対して、適切な入力値を生成する必要がある(技術課題2:画面遷移を実現するための適切な入力値生成方法の検討)。 Further, also in the extraction of means for reaching the screen, in the Web application, there is a screen transition that cannot be transited without giving a specific input value. For example, in a system for registering a telephone number, there may be a case where the registration completion screen cannot be displayed unless it is an 11-digit half-width number. It is necessary to generate an appropriate input value for such a screen transition (Technical Problem 2: Examination of an appropriate input value generation method for realizing the screen transition).

(2)では、(1)で取得したテスト対象を構成する画面情報を用いて、機能テストにおける画面遷移テストに適した画面遷移図を生成する。機能テストにおける画面遷移テストでは、機能の粒度で画面を識別する必要がある。一般的に画面はURLで識別されるが、同一URLの画面同士でも、機能テストでは異なる画面と判別されることがある。例えば、検索サイトにおいて、検索結果が無かったときの画面と検索結果が有ったときの画面はURLで見た場合、同一となることがあるが、機能テストの観点では別々の画面としてみなされる。したがって、機能テストの観点に合った、適切な画面識別を行う必要がある(技術課題3:機能テストにおける適切な画面識別方法の検討)。 In (2), the screen transition diagram suitable for the screen transition test in the functional test is generated by using the screen information constituting the test target acquired in (1). In the screen transition test in the functional test, it is necessary to identify the screen by the granularity of the function. Generally, screens are identified by a URL, but screens with the same URL may be identified as different screens by a functional test. For example, on the search site, the screen when there is no search result and the screen when there is a search result may be the same when viewed from the URL, but they are regarded as separate screens from the viewpoint of functional testing. .. Therefore, it is necessary to perform appropriate screen identification in accordance with the viewpoint of the functional test (Technical Problem 3: Examination of an appropriate screen identification method in the functional test).

(3)は、出力したいスクリプト形式に合わせてテストスクリプトを生成するステップである。(1)で抽出した画面に到達するための手段(リンクやボタンのクリック、フォーム(入力領域)への入力等)を、出力したいスクリプト形式で記述する。本ステップについては、抽出した手段をそれに対応するメソッドで記述するだけなので技術的課題はないと考えられる。 (3) is a step of generating a test script according to the script format to be output. Describe the means for reaching the screen extracted in (1) (clicking links and buttons, inputting in the form (input area), etc.) in the script format you want to output. Regarding this step, it is considered that there is no technical problem because only the method corresponding to the extracted means is described.

以上より、本アプローチには以下の3つの技術的課題があると考えられる。
技術課題1:テスト対象から仕様をリバースする方法の検討。
技術課題2:画面遷移を実現するための適切な入力値生成方法の検討。
技術課題3:機能テストにおける適切な画面識別方法の検討。
From the above, it is considered that this approach has the following three technical issues.
Technical Problem 1: Examination of the method of reversing the specifications from the test target.
Technical problem 2: Examination of an appropriate input value generation method for realizing screen transition.
Technical Issue 3: Examination of an appropriate screen identification method in a functional test.

[技術課題1:テスト対象から仕様をリバースする方法の検討]
<従来技術と問題点>
アプリケーションから仕様をリバースする技術として、静的解析を用いた技術が存在する(例えば、「"Reconstructing Software Architecture for J2EE Web Applications" Minmin Han, Christine Hofmeister, Robert L. Nord,Proceedings of the 10th Working Conference on Reverse Engineering 2003」)。しかし、jspファイルから動的に生成されるHTMLのように、実行しないと生成できない情報を取得することができないため、仕様を完全にリバースすることができない。このような欠点を補うため、静的解析と動的解析を組み合わせた技術も存在する(例えば、「Silva CE, Campos JC. 2013. "Combining Static and Dynamic Analysis for the Reverse Engineering of Web Applications". Proceedings of the 5th Symposium on Engineering Interactive Computing Systems - EICS. :107-112.」)。本技術では静的解析でプログラム中のパスを洗い出し、動的解析でそれらのパスを全て網羅するようなテストケースを生成することでWebアプリケーションの振る舞いの網羅を目指している。しかし、動的解析で通過したパスを取得するためには入力値が通過しうる全ての箇所にログが取得できるようなコードを挿入する必要があり、ユーザは、クライアントサイドからサーバサイドまで、システム構成を正確に把握し、プログラムが通過した場所を表すログを出力するための環境を用意しなくてはならないため、ツール導入のための追加稼働の削減を目指している本実施の形態の目的とは合致しない。また、テスト対象に手を加えることで振る舞いが変わる可能性もあり、そのようなテスト対象から生成したテストケースを実際のテストに用いた場合、想定していたテストシナリオと異なる内容のテストをしてしまうリスクが存在する。
[Technical subject 1: Examination of the method to reverse the specifications from the test target]
<Prior art and problems>
There is a technique that uses static analysis as a technique for reversing specifications from an application (for example, "Reconstructing Software Architecture for J2EE Web Applications" Minmin Han, Christine Hofmeister, Robert L. Nord, Proceedings of the 10th Working Conference on Reverse Engineering 2003"). However, like HTML dynamically generated from a jsp file, information that cannot be generated without execution cannot be obtained, and therefore the specification cannot be completely reversed. There is also a technology that combines static analysis and dynamic analysis to compensate for such drawbacks (for example, "Silva CE, Campos JC. 2013. "Combining Static and Dynamic Analysis for the Reverse Engineering of Web Applications". Proceedings of the 5th Symposium on Engineering Interactive Computing Systems-EICS.: 107-112."). The present technology aims to cover the behavior of the Web application by identifying paths in the program by static analysis and generating test cases that cover all of these paths by dynamic analysis. However, in order to get the path passed by the dynamic analysis, it is necessary to insert the code that can get the log in all the places where the input value can pass, and the user can use the system from client side to server side. Since the environment for accurately grasping the configuration and outputting the log indicating the place where the program has passed must be prepared, the purpose of this embodiment is to reduce the additional operation for introducing the tool. Does not match. In addition, the behavior may be changed by modifying the test target, and when the test case generated from such test target is used for the actual test, the test contents different from the expected test scenario are tested. There is a risk that

<本実施の形態における提案:コントローラに着目した静的解析と動的解析を用いた仕様のリバース技術>
本実施の形態では、Webアプリケーションにおいて一般的に用いられているデザインパターンであるMVC(Model View Controller)の構成において、クライアントサイドからのリクエストに対して実行する処理を決定するコントローラに着目する。例えば、サーブレットがコントローラの一例である。コントローラが割り振る遷移を静的解析で全て把握し、その後の動的解析でそれらの遷移を網羅することで、テスト対象を構成する画面と画面間の繋がり、各画面に到達するための手段を漏れなくリバースすることができる。従来手法との違いとして、本実施の形態ではコントローラにのみ着目するため、クライアントサイドの情報からコントローラの示す遷移先をどの程度網羅できたかを推測することができ、ログを取得するための環境を用意する稼働を不要、又は少なくすることができるといった利点が挙げられる。従来のプログラムの実行パスを取得する方法では、実行パスの詳細な情報をクライアントサイドから推測することは不可能である。
<Proposal in this Embodiment: Reverse Technology of Specifications Using Static Analysis and Dynamic Analysis Focusing on Controller>
In the present embodiment, attention is paid to a controller that determines the process to be executed in response to a request from the client side in the configuration of MVC (Model View Controller) that is a design pattern that is generally used in Web applications. For example, a servlet is an example of a controller. By grasping all the transitions allocated by the controller by static analysis, and covering all those transitions by subsequent dynamic analysis, the screens that make up the test target are connected to each other, and the means to reach each screen is omitted. Can be reversed without. As a difference from the conventional method, since only the controller is focused in this embodiment, it is possible to infer to what extent the transition destination indicated by the controller can be covered from the information on the client side, and the environment for acquiring the log can be set. The advantage is that the operation to be prepared is unnecessary or can be reduced. With the conventional method of acquiring the execution path of the program, it is impossible to infer detailed information of the execution path from the client side.

[技術課題2:画面遷移を実現するための適切な入力値生成方法の検討]
<従来技術と問題点>
画面遷移を実現するための適切な入力値を生成するための方法として、Search Based Software Testing(以下「SBST」という。)を用いた手法が存在する(N. Alshahwan and M. Harman, "Automated web application testing using search based software engineering," 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), Lawrence, KS, 2011, pp. 3-12.)。SBSTを用いた入力値生成では、達成したい要件に対する達成度合いを定量的に評価できるように設計された評価関数に基づいて、ヒューリスティック探索アルゴリズムを用いて、達成したい要件を満足するテスト入力値を生成する。例えば入力値aに対して「a>10」の場合にのみ遷移する画面遷移が存在した場合、評価関数を「a−10」と置く。この時、評価関数の値が0より大きい場合に所望の画面遷移を実現することができる。最初に入力値a=0とした場合、評価関数の値は、−10となる。次に入力値a=2とした場合、評価関数の値は、−8となり、所望の画面遷移を実現するための条件である、評価関数の値が0より大きいという条件に近づく。したがって入力値aの値が大きい方が良いと判断し、徐々に入力値aの値を大きくしていくことで、a=12等の所望の画面遷移を実現するための値を生成することができる。
[Technical subject 2: Examination of an appropriate input value generation method for realizing screen transition]
<Prior art and problems>
There is a method using Search Based Software Testing (hereinafter referred to as "SBST") as a method for generating an appropriate input value for realizing screen transition (N. Alshahwan and M. Harman, "Automated web. application testing using search based software engineering," 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), Lawrence, KS, 2011, pp. 3-12.). In the input value generation using SBST, the heuristic search algorithm is used to generate the test input value that satisfies the requirement to be achieved, based on the evaluation function designed to quantitatively evaluate the degree of achievement for the requirement to be achieved. To do. For example, when there is a screen transition that transitions only when “a>10” for the input value a, the evaluation function is set as “a-10”. At this time, when the value of the evaluation function is larger than 0, a desired screen transition can be realized. First, when the input value a=0, the value of the evaluation function becomes −10. Next, when the input value a=2, the value of the evaluation function becomes −8, which approaches the condition that the value of the evaluation function is larger than 0, which is a condition for realizing a desired screen transition. Therefore, it is determined that the larger the input value a is, it is possible to generate a value for realizing a desired screen transition such as a=12 by gradually increasing the value of the input value a. it can.

SBSTを用いた入力値生成は、上記の数値型の例のように、所望の画面遷移を実現するための条件を、定量的な評価が可能な評価関数と置くことができる単純な場合には有効である。しかし、入力フォームにどのような入力値が求められているのかを判断し、判断結果に基づいて適切な入力値を与える必要がある場合には、定量的な評価が可能な評価関数を設計することが困難なため、有効ではない。具体的には、氏名やメールアドレスなどの文字列型を入力とし、型チェックを行って問題なければ正常系の画面に遷移する場合においては、型チェックの条件(メールアドレスであればアットマークを含んでいるかどうかなど)を、定量的な評価が可能な評価関数と置くことが困難なため、適切な入力値を生成することは難しい。また、適切な入力値が生成できなかった場合、当該入力値の入力フォームが存在する画面に対するテストについては、ユーザがすべて人手で実施する必要があり、その画面に遷移までの画面操作の手間なども含めると、多くの稼働がかかってしまう。具体的には、図2に示される画面g1の入力フォームの入力値は、メールアドレスであるべきところ、当該入力フォームに対して適切な入力値を生成するのは困難である。したがって、画面g2への遷移は容易だが、画面g3への遷移には多くの稼動がかかってしまう。 The input value generation using the SBST is simple in the case where the condition for realizing the desired screen transition can be placed as an evaluation function capable of quantitative evaluation, as in the case of the above numerical type. It is valid. However, if it is necessary to judge what input value is required for the input form and give an appropriate input value based on the judgment result, design an evaluation function that enables quantitative evaluation. Not so effective because it is difficult. Specifically, when inputting a character string type such as name and email address, and when performing a type check and transitioning to a normal screen if there is no problem, the type check condition (at the It is difficult to put (such as whether or not it is included) as an evaluation function that can be evaluated quantitatively, so it is difficult to generate an appropriate input value. In addition, if an appropriate input value cannot be generated, the user must perform all the tests on the screen on which the input form of the input value exists, and it is necessary to perform the screen operation until the screen transitions. If you include it, it will take a lot of work. Specifically, the input value of the input form on the screen g1 shown in FIG. 2 should be a mail address, but it is difficult to generate an appropriate input value for the input form. Therefore, the transition to the screen g2 is easy, but the transition to the screen g3 requires a lot of operations.

<本実施の形態における提案:入力フォームの周辺情報を用いたテスト入力値生成とユーザによる補助技術>
本実施の形態は、2つのステップから構成される。第1ステップでは、ラベル等の入力フォームの周辺情報(すなわち、画面の記述情報のうち入力フォームに対応する記述部分から抽出される情報)を用いて、どのような種類の入力値が求められているのか判断し、求められている内容に対応する具体的な単語を予め用意された辞書から取得し、当該単語を入力値として与えることで、各入力フォームに合った適切な入力値を与えることができる。
<Proposal in the present embodiment: test input value generation using peripheral information of input form and user assistive technology>
This embodiment is composed of two steps. In the first step, what kind of input value is obtained by using the peripheral information of the input form such as the label (that is, the information extracted from the description portion of the screen description information corresponding to the input form). Whether a specific word corresponding to the requested content is obtained from a dictionary prepared in advance and the word is given as an input value, an appropriate input value suitable for each input form is given. You can

第2ステップでは、第1ステップで適切な入力値を生成できなかった入力フォームの情報をユーザに提示し、入力値の補助をユーザに求めることで、入力値だけを与えるという必要最低限の稼働で、自動生成できなかった箇所の補完を行うことができる。 In the second step, the minimum required operation is presented in which only the input value is given by presenting the user with the information on the input form for which an appropriate input value could not be generated in the first step and requesting the user to assist the input value. With, it is possible to supplement the parts that could not be automatically generated.

[技術課題3:機能テストにおける適切な画面識別方法の検討]
<従来技術と問題点>
本実施の形態では、機能テストにおける画面遷移テストを、機能テストの中でも、「クライアントサイドからのインタラクションに対し、クライアントサイドに表示される画面から、仕様通りに実装されているかどうかを確認することができる機能に対するテスト」と定義する。一般的に画面はURLで識別されるが、本定義における画面遷移テストでは、同一URLの画面同士でも画面によっては異なる画面としてテストすることが重要である。例えば、検索サイトにおいて、図1のように検索結果が無かったときの画面と検索結果が有ったときの画面はURLで見た場合、同一となることがあるが、機能テストの観点では別々の画面としてみなす。このような場合、URLではなく、表示される画面から識別するべきである。しかし、単純に表示された画面同士を画像として比較すると、確認したい機能部分が同一でも、それ以外の箇所が異なっていた場合、異なる画面と判別されてしまう。したがって、画面全体ではなく、画面を構成する要素の一部を比較する必要がある。画面は主にHTML、DOM(Document Object Model )構造、テキスト、画像、CSS(Cascading Style Sheets)等の要素で構成されている。
[Technical subject 3: Examination of appropriate screen identification method in functional test]
<Prior art and problems>
In the present embodiment, the screen transition test in the functional test is described in the functional test as follows: "For the interaction from the client side, it is possible to confirm whether the screen is displayed according to the specifications on the screen displayed on the client side. "Functional test". Generally, screens are identified by URL, but in the screen transition test in this definition, it is important to test even screens with the same URL as different screens depending on the screen. For example, in the search site, the screen when there is no search result and the screen when there is a search result as shown in FIG. 1 may be the same when viewed by URL, but they are different from the viewpoint of functional test. Regarded as the screen. In such cases, it should be identified from the displayed screen rather than the URL. However, when the displayed screens are simply compared as images, if the functional parts to be confirmed are the same but the other parts are different, they are determined to be different screens. Therefore, it is necessary to compare some of the elements that make up the screen rather than the entire screen. The screen is mainly composed of elements such as HTML, DOM (Document Object Model) structure, text, image and CSS (Cascading Style Sheets).

試験観点によって着目すべき箇所は異なるが、本実施の形態では機能の違いがHTMLのDOM構造に表れるケースを対象とする。HTMLのDOM構造比較の既存手法として、Tree Edit Distance(以下「TED」という。)を用いた手法が存在する(例えば、「"A survey on tree edit distance and related problems" Philip Bille. 2004. Theoretical Computer Science. Volume 337, Issues 1-3, 9 June 2005, Pages 217-239.」)。 Although the points to be noted differ depending on the test viewpoint, the present embodiment is directed to the case where the difference in function appears in the HTML DOM structure. As an existing method for comparing the DOM structure of HTML, there is a method using Tree Edit Distance (hereinafter referred to as “TED”) (for example, “A survey on tree edit distance and related problems” Philip Bille. 2004. Theoretical Computer Science. Volume 337, Issues 1-3, 9 June 2005, Pages 217-239.").

TEDとは、両DOMツリーが一致するまでノードの削除・挿入を行ったときの削除・挿入の回数となる。例えば、図3においてDOMツリー1とDOMツリー2を一致させるには、DOMツリー2の<p>、<strong>、<U>の3つのノードを削除し、<img>ノードを挿入する必要があるため、TEDの値は4となる。閾値が3以下の場合、DOMツリー1とDOMツリー2の構造は不一致と判断することができ、閾値が4以上の場合、DOMツリー1とDOMツリー2の構造は一致すると判断することができる。 The TED is the number of deletions/insertions when deleting/inserting a node until both DOM trees match. For example, in order to match DOM tree 1 and DOM tree 2 in FIG. 3, it is necessary to delete three nodes <p>, <strong>, and <U> of DOM tree 2 and insert an <img> node. Therefore, the value of TED is 4. When the threshold is 3 or less, it can be determined that the structures of the DOM tree 1 and the DOM tree 2 do not match, and when the threshold is 4 or more, it can be determined that the structures of the DOM tree 1 and the DOM tree 2 match.

TEDを用いた画面の構造比較の欠点として、画面ごとに適切な閾値が異なるため、閾値の設定が困難であるといった点が挙げられる。閾値(TEDに対する許容範囲)を必要とする原因として、以下の2つが考えられる。
原因1:機能テストにおける画面の識別に影響を与えないノードの存在
原因2:並列化されたノードの存在
原因1については、太字タグ<b>など、機能テストにおいて画面の識別に影響を与えないノードが存在することが挙げられる。原因2については、見出しタグなどが挙げられる。例えば、ニュースサイトにおいて、見出しの数が異なっている場合でもニュースを表示するという機能は同一であるため、見出しの数は機能に影響を与えないということがいえる。このように画面の識別に影響を与えないノードが存在し、それらのノードによってTEDの値が増加するため、閾値を設ける必要がある。
One of the drawbacks of the screen structure comparison using TED is that it is difficult to set a threshold value because an appropriate threshold value is different for each screen. There are two possible causes for requiring the threshold value (allowable range for TED).
Cause 1: Presence of node that does not affect screen identification in functional test Cause 2: Presence of parallelized node Regarding cause 1, bold tag <b>, etc. does not affect screen identification in functional test. It can be mentioned that there is a node. The cause 2 may be a heading tag or the like. For example, it can be said that the function of displaying news is the same even when the number of headlines is different on the news site, and therefore the number of headlines does not affect the function. In this way, there are nodes that do not affect the identification of the screen, and these nodes increase the TED value, so it is necessary to set a threshold value.

<本実施の形態における提案:HTMLのDOM構造の類似度を利用した画面識別技術>
本実施の形態では、原因1に関わるノードを削除し、原因2に関わるノードを集約することでHTMLを抽象化し、抽象化されたHTMLを比較することで、閾値の設定を必要とせずに機能テストにおける適切な画面識別を可能とする。
<Proposal in this Embodiment: Screen Identification Technology Using Similarity of HTML DOM Structure>
In the present embodiment, the nodes related to cause 1 are deleted and the nodes related to cause 2 are aggregated to abstract the HTML, and the abstracted HTMLs are compared to each other, thereby enabling the function without setting a threshold value. Allows proper screen identification in testing.

以下、上記を実現するための具体例について説明する。図4は、本発明の実施の形態におけるシステム構成例を示す図である。図4において、サーバ装置20及びクライアント装置10は、例えば、LAN(Local Area Network)又はインターネット等のネットワークを介して接続される。 Hereinafter, a specific example for realizing the above will be described. FIG. 4 is a diagram showing a system configuration example in the embodiment of the present invention. In FIG. 4, the server device 20 and the client device 10 are connected via a network such as a LAN (Local Area Network) or the Internet, for example.

サーバ装置20は、Webアプリケーションを含むテスト対象のシステムを含む1以上のコンピュータである。 The server device 20 is one or more computers including a system to be tested including a web application.

クライアント装置10は、サーバ装置20が有するWebアプリケーションについてのテスト(検証)を支援する装置である。 The client device 10 is a device that supports a test (verification) of a Web application included in the server device 20.

図5は、本発明の実施の形態におけるクライアント装置10のハードウェア構成例を示す図である。図5のクライアント装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、インタフェース装置105、表示装置106、及び入力装置107等を有する。 FIG. 5 is a diagram showing a hardware configuration example of the client device 10 according to the embodiment of the present invention. The client device 10 of FIG. 5 includes 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.

クライアント装置10での処理を実現するプログラムは、CD−ROM等の記録媒体101によって提供される。プログラムを記憶した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。 A program that implements the processing in the client 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 a network. The auxiliary storage device 102 stores the installed program and also stores necessary files and data.

メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従ってクライアント装置10に係る機能を実現する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。表示装置106はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置107はキーボード及びマウス等で構成され、様々な操作指示を入力させるために用いられる。 The memory device 103 reads the program from the auxiliary storage device 102 and stores the program when an instruction to activate the program is given. The CPU 104 realizes a function related to the client device 10 according to a 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 GUI (Graphical User Interface) or the like according to a program. The input device 107 includes a keyboard, a mouse, and the like, and is used to input various operation instructions.

図6は、本発明の実施の形態におけるクライアント装置10の機能構成例を示す図である。図6において、クライアント装置10は、画面遷移情報抽出部11、テストシナリオ生成部12、画面自動操作部13、画面評価部14及びテスト資材生成部15等を有する。これら各部は、クライアント装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。 FIG. 6 is a diagram showing a functional configuration example of the client device 10 according to the embodiment of the present invention. 6, the client device 10 includes a screen transition information extraction unit 11, a test scenario generation unit 12, a screen automatic operation unit 13, a screen evaluation unit 14, a test material generation unit 15, and the like. Each of these units is realized by a process that causes the CPU 104 to execute one or more programs installed in the client device 10.

画面遷移情報抽出部11は、Webアプリケーションのコントローラのソースコードに基づいて、静的解析技術を用いてコントローラを解析し、各リクエストに対する遷移先の数を取得する。 The screen transition information extraction unit 11 analyzes the controller using a static analysis technique based on the source code of the controller of the Web application, and acquires the number of transition destinations for each request.

テストシナリオ生成部12は、テストにおいて表示された各画面に対するテストシナリオとテスト入力値とを生成する。或る画面の各フォームに対するテスト入力値は、当該画面に係るHTMLのDOMツリーにおける当該フォームの周辺情報を用いて生成される。当該フォームの周辺情報とは、HTMLにおいて当該フォームに関して定義された情報の一例である。 The test scenario generator 12 generates a test scenario and a test input value for each screen displayed in the test. The test input value for each form of a certain screen is generated using the peripheral information of the form in the HTML DOM tree of the screen. The peripheral information of the form is an example of information defined for the form in HTML.

画面自動操作部13は、生成されたテストシナリオとテスト入力値とをテストケースとして、画面操作を自動的に実行することで、動的解析を実現する。 The screen automatic operation unit 13 realizes dynamic analysis by automatically executing screen operations using the generated test scenario and test input value as a test case.

画面評価部14は、画面操作の実行により遷移した画面が既に遷移したことのある画面か否かをURLやHTML等の情報を用いて判定する。画面評価部14は、画面操作の実行により遷移した画面のHTMLデータと、既に遷移したことのある画面のHTMLデータとについて、それぞれを抽象化するための編集処理を行って、編集後のHTMLデータを比較する。 The screen evaluation unit 14 determines whether or not the screen transitioned by executing the screen operation has already been transited using information such as URL and HTML. The screen evaluation unit 14 performs edit processing for abstracting each of the HTML data of the screen that has transitioned due to the execution of the screen operation and the HTML data of the screen that has already transitioned, and the edited HTML data. To compare.

テスト資材生成部15は、静的解析及び動的解析により得られた情報に基づいて、画面遷移図を生成する。テスト資材生成部15は、また、テストシナリオ生成部12によって生成されたテストシナリオとテスト入力値をテストスクリプトの形式で出力する。 The test material generation unit 15 generates a screen transition diagram based on the information obtained by the static analysis and the dynamic analysis. The test material generation unit 15 also outputs the test scenario and the test input value generated by the test scenario generation unit 12 in the form of a test script.

以下、クライアント装置10が実行する処理手順について説明する。図7は、クライアント装置10が実行する処理手順の一例を説明するためのフローチャートである。 The processing procedure executed by the client device 10 will be described below. FIG. 7 is a flowchart for explaining an example of a processing procedure executed by the client device 10.

ステップS101において、画面遷移情報抽出部11は、静的解析技術を用いてコントローラのソースコードを解析し、画面の遷移先を決定するコントローラの情報から、各リクエストに対する遷移先の数を取得する。1つのリクエストに対する遷移先の数を示す情報を「画面遷移情報」といい、画面遷移情報のリストを「画面遷移情報リスト」という。 In step S101, the screen transition information extraction unit 11 analyzes the source code of the controller using a static analysis technique, and acquires the number of transition destinations for each request from the information of the controller that determines the transition destination of the screen. The information indicating the number of transition destinations for one request is called "screen transition information", and the list of screen transition information is called "screen transition information list".

図8は、静的解析の一例を示す図である。図8には、コントローラのソースコードの一部が示されている。図8において記述d1は、リクエストを示す。記述d2及び記述d3は、当該リクエストに対応した遷移先を示す。ステップS101では、記述d1、d2、及びd3から、「owners/new」というリクエストに対して2つの遷移先が有ることが抽出される。このような抽出が、ソースコードに定義されている全てのリクエストについて実行される。 FIG. 8 is a diagram showing an example of static analysis. FIG. 8 shows a part of the source code of the controller. In FIG. 8, description d1 indicates a request. The description d2 and the description d3 indicate the transition destination corresponding to the request. In step S101, it is extracted from the descriptions d1, d2, and d3 that there are two transition destinations for the request "owners/new". Such extraction is performed for all requests defined in the source code.

続いて、画面自動操作部13は、初期URLにアクセスして、初期URLに対応するHTMLデータ等を取得する(S102)。その結果、当該HTMLデータ等に基づく画面が表示装置106に表示される。初期URLは、例えば、ユーザによって入力されてもよいし、補助記憶装置102に予め記憶されていてもよい。 Subsequently, the screen automatic operation unit 13 accesses the initial URL and acquires HTML data or the like corresponding to the initial URL (S102). As a result, a screen based on the HTML data or the like is displayed on the display device 106. The initial URL may be input by the user or may be prestored in the auxiliary storage device 102, for example.

続くステップS103〜S108では、初期URLに対応するHTMLデータ、及び当該HTMLデータに係る画面を起点として遷移可能な全てのHTMLデータに関して、動的解析等が実行される。具体的には、静的解析で取得された各リクエストに対する遷移先を全て網羅するように、動的解析として、初期URLに対応する画面を起点として実際にテスト対象の画面操作が自動的に実施される。動的解析では、各画面上の全てのリンクに対してクリックを実施し、入力フォームとそれに対応するサブミットボタンが有る場合には、サブミットボタンを押したときのリクエストに対して、静的解析で取得したそのリクエストの遷移先の数を満たすまで、テスト入力値が生成され、画面操作が繰り返される。リクエストの遷移先の数を満たしたか否かについては、遷移先の画面について、既に遷移した画面との比較を行い、新規に遷移した画面かどうかの判断を行って、到達画面数をカウントする。以上の動的解析によって遷移先画面の情報(HTML、URL等)と画面間の繋がり、画面に到達するための手段が取得される。また、コントローラを通らない画面遷移が動的解析で発見された場合、その画面遷移の情報も追加される。コントローラを通らない画面遷移とは、例えば、aタグでのリンクがクリックされた場合に発生する画面遷移である。 In the subsequent steps S103 to S108, dynamic analysis or the like is performed on the HTML data corresponding to the initial URL and all the HTML data that can be transitioned from the screen related to the HTML data as a starting point. Specifically, to cover all transition destinations for each request acquired by static analysis, as a dynamic analysis, the screen operation of the test target is automatically performed starting from the screen corresponding to the initial URL. To be done. In dynamic analysis, all links on each screen are clicked, and if there is an input form and the corresponding submit button, static analysis is performed for the request when the submit button is pressed. Test input values are generated and screen operations are repeated until the number of acquired transition destinations of the request is satisfied. Regarding whether or not the number of transition destinations of the request is satisfied, the transition destination screen is compared with the already transited screen, and it is determined whether or not the screen is a newly transited screen, and the number of reached screens is counted. By the above dynamic analysis, the information (HTML, URL, etc.) of the transition destination screen and the connection between the screens, and the means for reaching the screen are acquired. If a screen transition that does not pass through the controller is found by dynamic analysis, information on the screen transition is also added. The screen transition that does not pass through the controller is, for example, a screen transition that occurs when a link in the a tag is clicked.

以下、ステップS103〜S108の間で処理対象とされているHTMLデータを、「対象HTML」という。 Hereinafter, the HTML data targeted for processing between steps S103 and S108 is referred to as "target HTML".

ステップS104において、テストシナリオ生成部12は、対象HTMLに係る画面(以下、「対象画面」という。)に対するテストシナリオを生成する。すなわち、対象画面において画面の遷移を発生させる画面要素(リンクやサブミットボタン等)ごとに、操作及びロケータの組からなるテストシナリオが生成される。操作は、クリック等の操作である。ロケータは、操作の対象とされる画面要素の識別情報である。 In step S104, the test scenario generation unit 12 generates a test scenario for the screen related to the target HTML (hereinafter referred to as “target screen”). That is, a test scenario including a set of an operation and a locator is generated for each screen element (link, submit button, etc.) that causes a screen transition in the target screen. The operation is an operation such as clicking. The locator is identification information of the screen element to be operated.

続くステップS105〜S107は、ステップS104において生成されたテストシナリオごとに実行される。S105〜S107において処理対象とされているテストシナリオを、以下「対象テストシナリオ」という。 The following steps S105 to S107 are executed for each test scenario generated in step S104. The test scenario targeted for processing in S105 to S107 is hereinafter referred to as "target test scenario".

ステップS106において、テストシナリオ生成部12が、対象テストシナリオに基づいてテストケースを生成し、画面自動操作部13が、当該テストケースを対象画面に対して実行する。その結果、画面遷移が発生する。なお、対象テストシナリオが、入力値を必要とする場合、ステップS106において、テスト入力値の生成が行われる。 In step S106, the test scenario generation unit 12 generates a test case based on the target test scenario, and the screen automatic operation unit 13 executes the test case on the target screen. As a result, screen transition occurs. When the target test scenario requires an input value, the test input value is generated in step S106.

遷移先の全ての画面(HTML)に対してステップS103〜S108が実行されると、テスト資材生成部15は、画面遷移図を生成する(S109)。具体的には、テスト資材生成部15は、生成された画面遷移情報リストと、ステップS103〜S108において実際に発生した画面遷移とを比較して、テストにおいて発生しなかった画面遷移が有れば当該画面遷移を抽出(検出)し、遷移することのできた画面遷移と遷移することのできなかった画面遷移の情報を合わせた画面遷移図を生成する。遷移することができなかった画面遷移に対しては、テストスクリプトも生成できていないため、人手で作成する等のサポートが行われてもよい。 When steps S103 to S108 are executed for all the transition destination screens (HTML), the test material generation unit 15 generates a screen transition diagram (S109). Specifically, the test material generation unit 15 compares the generated screen transition information list with the screen transition actually occurred in steps S103 to S108, and if there is a screen transition that has not occurred in the test. The screen transition is extracted (detected), and a screen transition diagram in which information of screen transitions that can be transited and screen transitions that cannot be transited is combined is generated. For screen transitions that could not be transited, a test script could not be generated, so support such as manual creation may be performed.

図9は、画面遷移図の一例を示す図である。図9では、画面Aから画面B及び画面Cに遷移し、画面Cから画面Bに遷移することが示されている。また、破線の矩形は、仕様では遷移する予定であるが、テストにおいて遷移が発生しなかった画面を示す。すなわち、ソースコードでは、画面Cから遷移する画面が有ることが定義されているが、動的解析では当該画面への遷移が発生しなかったことを示す。 FIG. 9 is a diagram showing an example of a screen transition diagram. FIG. 9 shows that the screen A transits to the screen B and the screen C, and the screen C transits to the screen B. Also, the broken-line rectangle indicates a screen in which the transition is scheduled in the specifications, but the transition does not occur in the test. That is, the source code defines that there is a screen that transitions from the screen C, but the dynamic analysis indicates that the transition to the screen did not occur.

続いて、テスト資材生成部15は、画面遷移図において、遷移できなかった箇所の有無を判定する(S110)。すなわち、図9において、破線の矩形に該当する箇所の有無が判定される。 Subsequently, the test material generation unit 15 determines whether or not there is a portion that could not be transitioned in the screen transition diagram (S110). That is, in FIG. 9, it is determined whether or not there is a portion corresponding to the dashed rectangle.

該当箇所が無い場合(S110でNo)、テスト資材生成部15は、各画面遷移が発生したときのテストシナリオとテスト入力値とをテストスクリプトの形式で出力する(S112)。 When there is no corresponding part (No in S110), the test material generation unit 15 outputs the test scenario and the test input value when each screen transition occurs in the form of a test script (S112).

一方、該当箇所が有る場合(S110でYes)、テスト資材生成部15は、テストケースに対する入力値の補助をユーザから受けるための処理を実行する(S111)。ステップS111に続いて、ステップS101以降が再実行される。 On the other hand, when there is a corresponding portion (Yes in S110), the test material generation unit 15 executes a process for receiving the input value assistance for the test case from the user (S111). Subsequent to step S111, steps S101 and thereafter are re-executed.

続いて、図7のステップS101の詳細について説明する。図10は、画面遷移情報の抽出処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S101 in FIG. 7 will be described. FIG. 10 is a flowchart for explaining an example of the processing procedure of the screen transition information extraction processing.

ステップS301において、画面遷移情報抽出部11は、コントローラのソースコードを読み込む。当該ソースコードは、予め補助記憶装置102に記憶されていてもよい。 In step S301, the screen transition information extraction unit 11 reads the source code of the controller. The source code may be stored in the auxiliary storage device 102 in advance.

続いて、画面遷移情報抽出部11は、ソースコードから検出されるリクエストごとにステップS302〜304を実行する。ステップS303において、画面遷移情報抽出部11は、処理対象のリクエストに対する遷移先の数をソースコードを参照して特定し、当該リクエストと当該数との組を、画面遷移情報リストに追加する。したがって、画面遷移情報リストには、ソースコード(仕様)において予定されている全ての画面遷移の情報が登録される。 Subsequently, the screen transition information extraction unit 11 executes steps S302 to 304 for each request detected from the source code. In step S303, the screen transition information extraction unit 11 identifies the number of transition destinations for the request to be processed by referring to the source code, and adds the set of the request and the number to the screen transition information list. Therefore, information on all screen transitions scheduled in the source code (specification) is registered in the screen transition information list.

続いて、図7のステップS106の詳細について説明する。図11は、テストケースの生成及び実行処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S106 in FIG. 7 will be described. FIG. 11 is a flowchart for explaining an example of a processing procedure of test case generation and execution processing.

ステップS401において、テストシナリオ生成部12は、対象テストシナリオの操作にフォームへの入力操作が含まれているか否かを判定する。対象テストシナリオの操作にフォームへの入力操作が含まれていない場合(S401でNo)、テストシナリオ生成部12は、対象テストシナリオをそのままテストケースとする(S402)。続いて、画面自動操作部13は、当該テストケースを対象画面に対して実行する(S403)。当該テストケースの実行により、画面遷移が発生する。続いて、画面評価部14は、テストケースの実行によるリンクのクリックやボタンの押下により発生したリクエストを「リクエストA」として記憶する(S405)。 In step S401, the test scenario generation unit 12 determines whether the operation of the target test scenario includes a form input operation. When the operation of the target test scenario does not include the input operation to the form (No in S401), the test scenario generation unit 12 sets the target test scenario as the test case as it is (S402). Subsequently, the screen automatic operation unit 13 executes the test case on the target screen (S403). Screen transition occurs due to the execution of the test case. Subsequently, the screen evaluation unit 14 stores the request generated by clicking the link or pressing the button by executing the test case as "request A" (S405).

続いて、画面評価部14は、ステップS403で遷移した画面が既に遷移したことのある画面か否かをURLやHTML等の情報を用いて判定する(S405)。この際、ステップS403で遷移した画面が未だ遷移したことのない画面である場合、当該遷移に関する情報が、遷移リストの要素として追加される。遷移リストとは、動的解析において発生した画面間の遷移に関する情報を要素とするリストである。当該要素は、遷移前画面のURL、遷移後画面のURL、リクエストA、遷移後画面のHTML、及びテストケース等を含む。 Subsequently, the screen evaluation unit 14 determines whether or not the screen transitioned in step S403 has already been transited by using information such as URL and HTML (S405). At this time, when the screen that has transited in step S403 is a screen that has not yet transited, information regarding the transition is added as an element of the transition list. The transition list is a list whose elements are information about transitions between screens that have occurred in the dynamic analysis. The element includes the URL of the pre-transition screen, the URL of the post-transition screen, the request A, the HTML of the post-transition screen, the test case, and the like.

一方、対象テストシナリオの操作にフォームへの入力操作が含まれている場合(S401でYes)、テストシナリオ生成部12は、フォームへの入力値(テスト入力値)を生成する(S406)。例えば、対象画面が図12に示される通りであれば、対象テストシナリオには、姓に対応するフォームへの入力操作、名に対応するフォームへの入力操作、メールアドレスに対応するフォームへの入力操作、及び登録ボタンの押下等が含まれている。したがって、この場合、フォームごとにテスト入力値が生成される。1つのフォームに対して複数のテスト入力値が生成される可能性が有る。そこで、続くステップS407〜S412は、各フォームに対するテスト入力値の組み合わせごとに実行される。当該組み合わせは、全通りの組合せであってもよいし、全通りの中から所定数の組み合わせが抽出されたものであってもよい。全通りの組み合わせとは、例えば、姓についてN個のテスト入力値が生成され、名についてM個のテスト入力値が生成され、メールアドレスについてL個のテスト入力値が生成された場合、N×M×L通りの組み合わせをいう。以下、処理対象の組み合わせを、「対象組み合わせ」という。 On the other hand, when the operation of the target test scenario includes the input operation to the form (Yes in S401), the test scenario generation unit 12 generates the input value (test input value) to the form (S406). For example, if the target screen is as shown in FIG. 12, in the target test scenario, the input operation to the form corresponding to the surname, the input operation to the form corresponding to the first name, and the input to the form corresponding to the email address This includes operations and pressing of registration buttons. Therefore, in this case, a test input value is generated for each form. Multiple test input values may be generated for one form. Therefore, the following steps S407 to S412 are executed for each combination of test input values for each form. The combination may be all combinations, or a predetermined number of combinations may be extracted from all combinations. For example, in the case where N test input values are generated for a family name, M test input values are generated for a first name, and L test input values are generated for an email address, N* is a combination of all combinations. It means M×L combinations. Hereinafter, a combination of processing targets is referred to as a “target combination”.

ステップS408において、テストシナリオ生成部12は、対象組み合わせに属する各テスト入力値がそれぞれに対応するフォームへの入力対象とされたテストケースを、対象テストシナリオに基づいて生成する。続いて、画面自動操作部13は、当該テストケースを対象画面に対して実行する(S409)。すなわち、対象テストシナリオにおいて値の入力先とされている各フォームに対して対象組み合わせに属するテスト入力値が入力され、対象テストシナリオにおいて押下対象とされているサブミットボタンが押下される。その結果、画面遷移が発生する。 In step S408, the test scenario generation unit 12 generates a test case in which each test input value belonging to the target combination is an input target for the corresponding form based on the target test scenario. Subsequently, the screen automatic operation unit 13 executes the test case on the target screen (S409). That is, the test input values belonging to the target combination are input to each form that is the input destination of the value in the target test scenario, and the submit button that is the pressing target in the target test scenario is pressed. As a result, screen transition occurs.

続いて、画面評価部14は、ボタンの押下により発生したリクエストを「リクエストA」として記憶する(S410)。続いて、画面評価部14は、ステップS405と同様の処理を実行する(S411)。 Subsequently, the screen evaluation unit 14 stores the request generated by pressing the button as "request A" (S410). Then, the screen evaluation part 14 performs the same process as step S405 (S411).

全ての組み合わせについてステップS407〜S412が実行されると、画面評価部14は、遷移リストにおけるリクエストAに対する遷移後画面のURLの数(すなわち、リクエストAを含む要素の数、以下「動的遷移数」という。)が、画面遷移情報リストにおいてリクエストAに対応する遷移先URLの数(以下、「静的遷移数」という。)に等しいか否かを判定する(S413)。すなわち、ステップS413では、リクエストAに関してソースコードに定義されている全ての遷移が検出されたか否かが判定される。 When steps S407 to S412 are executed for all the combinations, the screen evaluation unit 14 determines the number of URLs of the screen after transition for the request A in the transition list (that is, the number of elements including the request A, hereinafter “dynamic transition number”). Is equal to the number of transition destination URLs corresponding to the request A in the screen transition information list (hereinafter, referred to as “static transition number”) (S413). That is, in step S413, it is determined whether or not all the transitions defined in the source code for request A have been detected.

動的遷移数が、静的遷移数に等しい場合(S413でYes)、対象テストシナリオについては、図11の処理が終了する。動的遷移数が、静的遷移数に達していない場合、すなわち、動的遷移が静的遷移に対して不足する場合(S413でNo)、画面評価部14は、対象画面の各フォームに対するテスト入力値としてテストシナリオ生成部12が生成しうる全ての入力値が生成されたか否かを判定する(S414)。テストシナリオ生成部12が生成しうる全ての入力値が生成されていない場合、すなわち、テストシナリオ生成部12によって、異なる入力値の生成の余地が有る場合(S414でNo)、ステップS406以降が繰り返される。この場合、対象テストシナリオについて、異なるテスト入力値の組み合わせが生成されてテストケースが実行される。 When the number of dynamic transitions is equal to the number of static transitions (Yes in S413), the process of FIG. 11 ends for the target test scenario. When the number of dynamic transitions does not reach the number of static transitions, that is, when the number of dynamic transitions is insufficient for static transitions (No in S413), the screen evaluation unit 14 performs a test on each form of the target screen. It is determined whether or not all the input values that can be generated by the test scenario generation unit 12 have been generated as the input values (S414). If all the input values that can be generated by the test scenario generation unit 12 have not been generated, that is, if there is room for generation of different input values by the test scenario generation unit 12 (No in S414), Step S406 and subsequent steps are repeated. Be done. In this case, for the target test scenario, a combination of different test input values is generated and the test case is executed.

一方、対象画面の各フォームに対するテスト入力値としてテストシナリオ生成部12が生成しうる全ての入力値が生成された場合(S414でYes)、テスト資材生成部15は、入力情報補助ファイルに、対象画面のURL及びタイトルと、対象画面の各フォームの周辺情報(ラベル、id及びname)等を追加(記録)する(S415)。すなわち、入力情報補助ファイルには、全ての画面遷移を網羅する入力値を生成できなかった画面ごとに、URL、タイトル、各フォームの周辺情報が記録される。ここで入力情報補助ファイルに登録されたフォームに対する入力値の入力が、図7のステップS111においてユーザによって補助される。 On the other hand, when all the input values that can be generated by the test scenario generation unit 12 have been generated as the test input values for each form of the target screen (Yes in S414), the test material generation unit 15 sets the target information in the input information auxiliary file. The URL and title of the screen and the peripheral information (label, id and name) of each form on the target screen are added (recorded) (S415). That is, in the input information auxiliary file, the URL, the title, and the peripheral information of each form are recorded for each screen for which an input value that covers all screen transitions could not be generated. Here, the input of the input value to the form registered in the input information auxiliary file is assisted by the user in step S111 of FIG.

なお、入力情報補助ファイルの形式は所定のものに限定されないが、例えば、表形式ファイルが好適である。また、入力情報補助ファイルは、例えば、補助記憶装置102に記憶される。 Although the format of the input information auxiliary file is not limited to a predetermined format, for example, a tabular file is suitable. The input information auxiliary file is stored in the auxiliary storage device 102, for example.

なお、ステップS414の判定は、ステップS406以降の繰り返し回数が上限に達したか否かに基づいて行われてもよい。 The determination in step S414 may be performed based on whether or not the number of repetitions after step S406 has reached the upper limit.

続いて、ステップS406の詳細について説明する。図13は、テスト入力値の生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S406 will be described. FIG. 13 is a flowchart for explaining an example of the processing procedure of the test input value generation processing.

ステップS501〜S508は、対象テストシナリオにおいて入力対象とされるフォーム(対象画面のフォーム)ごとに実行される。以下、処理対象のフォームを「対象フォーム」という。 Steps S501 to S508 are executed for each input target form (form of target screen) in the target test scenario. Hereinafter, the form to be processed will be referred to as the “target form”.

ステップS502において、テストシナリオ生成部12は、対象フォームの周辺情報(又は属性情報)を対象HTMLから取得する。本実施の形態では、対象フォームのラベル(label)、id及びname等が周辺情報として取得される。例えば、対象フォームが、図12の3つ目のフォーム(メールアドレスの入力フォーム)である場合に、当該フォームに関するHTMLの記述情報が図14の通りであったとすると、ラベル(label)として「メールアドレスを入力して下さい」、idとして「ma」、nameとして「mail」が取得される。 In step S502, the test scenario generation unit 12 acquires the peripheral information (or attribute information) of the target form from the target HTML. In the present embodiment, the label (label), id, name and the like of the target form are acquired as the peripheral information. For example, if the target form is the third form in FIG. 12 (e-mail address input form) and the HTML descriptive information regarding the form is as shown in FIG. 14, the label (label) is “mail”. Please enter the address", "ma" as the id, and "mail" as the name.

続いて、テストシナリオ生成部12は、当該周辺情報と、対象画面のURL及びタイトルとの組み合わせが、入力情報補助ファイルに登録されているか否かを判定する(S503)。すなわち、対象フォームが入力情報補助ファイルに登録されているか否かが判定される。 Subsequently, the test scenario generation unit 12 determines whether the combination of the peripheral information and the URL and title of the target screen is registered in the input information auxiliary file (S503). That is, it is determined whether or not the target form is registered in the input information auxiliary file.

対象フォームが入力情報補助ファイルに登録されていない場合(S503でNo)、テストシナリオ生成部12は、ステップS502において取得された周辺情報としての各文字列を形態素解析技術を用いて単語に分割する(S504)。上記の例によれば、例えば、["メールアドレス"、"入力"、"mail"、"ma"]といった単語群が得られる。 When the target form is not registered in the input information auxiliary file (No in S503), the test scenario generation unit 12 divides each character string as the peripheral information acquired in step S502 into words using a morphological analysis technique. (S504). According to the above example, a word group such as ["mail address", "input", "mail", "ma"] is obtained.

続くステップS505〜S507では、当該単語群に含まれる単語ごとに、ステップS506が実行される。以下、処理対象の単語を「対象単語」という。ステップS506において、テストシナリオ生成部12は、予め用意された辞書から対象単語に対応する値を検索し、検索された値を対象フォームに対する入力値とする。 In subsequent steps S505 to S507, step S506 is executed for each word included in the word group. Hereinafter, the word to be processed will be referred to as a “target word”. In step S506, the test scenario generation unit 12 retrieves a value corresponding to the target word from a dictionary prepared in advance and sets the retrieved value as an input value for the target form.

図15は、辞書の一例を示す図である。図15に示されるように、辞書は、項目ごとに項目名と、当該項目に関する具体的な値とを含む情報であり、例えば、補助記憶装置102等に記憶されている。又は、何らかのシステムのユーザの属性情報を記憶したDBが辞書として利用されてもよい。 FIG. 15 is a diagram showing an example of the dictionary. As shown in FIG. 15, the dictionary is information including an item name for each item and a specific value regarding the item, and is stored in, for example, the auxiliary storage device 102 or the like. Alternatively, a DB that stores attribute information of users of some system may be used as a dictionary.

ステップS506において、テストシナリオ生成部12は、対象単語に一致する項目名を辞書から検索する。但し、同意語辞書を用いて、対象単語に類似した意味を有する項目名が検索されてもよい。該当する項目名が検索された場合、テストシナリオ生成部12は、当該項目名に係る項目に登録されている具体的な値を入力値として取得する。該当する項目名が検索されない場合、入力値は取得されない。 In step S506, the test scenario generation unit 12 searches the dictionary for an item name that matches the target word. However, an item name having a meaning similar to the target word may be searched using the synonym dictionary. When the corresponding item name is searched, the test scenario generation unit 12 acquires a specific value registered in the item related to the item name as an input value. If the corresponding item name is not searched, the input value will not be obtained.

例えば、["メールアドレス"、"入力"、"mail"、"ma"]の中では、"メールアドレス"が対象単語である場合に、入力値として、例えば「xxx@xxx.xx」が取得される。なお、["メールアドレス"、"入力"、"mail"、"ma"]の例では、1つの入力値しか取得されないが、それぞれ別の項目名に一致するような複数の単語が周辺情報から抽出されたフォームに関しては、複数の入力値が生成される可能性も有る。 For example, in [“email address”, “input”, “mail”, “ma”], when “email address” is the target word, for example, “xxx@xxx.xx” is acquired as the input value. To be done. In addition, in the example of ["email address", "input", "mail", "ma"], only one input value is acquired, but a plurality of words that match different item names are obtained from the peripheral information. For the extracted form, multiple input values may be generated.

一方、対象フォームが入力情報補助ファイルに登録されている場合(S503でYes)、テストシナリオ生成部12は、対象フォームの周辺情報等に対応付けられて入力情報補助ファイルに記録されている値を入力値として取得する(S509)、この場合、対象フォームに関する処理は終了する。なお、対象フォームに関して図19のステップS111が実行されていれば、対象フォームに対する入力値が入力情報補助ファイルに記録されている。 On the other hand, when the target form is registered in the input information auxiliary file (Yes in S503), the test scenario generation unit 12 sets the value recorded in the input information auxiliary file in association with the peripheral information of the target form. When it is acquired as an input value (S509), in this case, the process regarding the target form ends. If step S111 of FIG. 19 is executed for the target form, the input value for the target form is recorded in the input information auxiliary file.

続いて、図11のステップS405及びS411の詳細について説明する。図16は、遷移先画面の判定処理の処理手順の一例を説明するためのフローチャートである。 Next, details of steps S405 and S411 in FIG. 11 will be described. FIG. 16 is a flowchart for explaining an example of the processing procedure of the transition destination screen determination processing.

ステップS601において、画面評価部14は、遷移リストの中のリクエストAを含むいずれかの要素の中に、現在の遷移先画面(すなわち、対象画面)のURLが遷移後画面のURLとして含まれているか否かを判定する。現在の遷移先画面のURLがリクエストAの遷移後画面のURLとして遷移リストに含まれていない場合(S601でNo)、画面評価部14は、リクエストA、遷移前画面のURL、現在の遷移先画面のURL、現在の遷移先画面のHTML(対象HTML)、及び対象テストシナリオに係るテストケースをセットとする要素を遷移リストに追加する(S602)。 In step S601, the screen evaluation unit 14 includes the URL of the current transition destination screen (that is, the target screen) as the URL of the post-transition screen in any element including the request A in the transition list. It is determined whether or not there is. When the URL of the current transition destination screen is not included in the transition list as the URL of the post-transition screen of request A (No in S601), the screen evaluation unit 14 requests the request A, the URL of the pre-transition screen, and the current transition destination. An element that sets the screen URL, the HTML of the current transition destination screen (target HTML), and the test case related to the target test scenario is added to the transition list (S602).

一方、現在の遷移先画面のURLがリクエストAの遷移後画面のURLとして遷移リストに含まれている場合(S601でYes)、画面評価部14は、遷移リストにおいてリクエストAを含み、かつ、現在の遷移先画面のURLを遷移後画面のURLとして含む要素の遷移後画面のHTMLデータごとに、ステップS603〜S611を実行する。以下、処理対象とされているHTMLを「対象遷移済みHTML」という。また、現在の遷移先画面のHTMLを、上記において定義した通り「対象HTML」という。 On the other hand, when the URL of the current transition destination screen is included in the transition list as the URL of the post-transition screen of the request A (Yes in S601), the screen evaluation unit 14 includes the request A in the transition list, and Steps S603 to S611 are executed for each HTML data of the post-transition screen of the element that includes the URL of the post-transition screen as the URL of the post-transition screen. Hereinafter, the HTML to be processed is referred to as "target transition completed HTML". Further, the HTML of the current transition destination screen is referred to as "target HTML" as defined above.

続いて、画面評価部14は、対象遷移済みHTML及び対象HTMLのそれぞれについて、ステップS604〜S608を実行する。対象遷移済みHTML及び対象HTMLのうち、処理対象とされているHTMLを、「着目HTML」という。 Subsequently, the screen evaluation unit 14 executes steps S604 to S608 for each of the target transition completed HTML and the target HTML. Of the target transition completed HTML and the target HTML, the HTML targeted for processing is referred to as “target HTML”.

ステップS605において、画面評価部14は、着目HTMLのDOMツリーを生成する。図17にDOMツリーの一例を示す。図17に示されるように、DOMツリーは、各ノード(各画面要素)の階層構造を示す。 In step S605, the screen evaluation unit 14 creates a DOM tree of the HTML of interest. FIG. 17 shows an example of the DOM tree. As shown in FIG. 17, the DOM tree shows a hierarchical structure of each node (each screen element).

続いて、画面評価部14は、画面の役割に影響を与えない(すなわち、画面の識別に影響を与えない)ノードを、DOMツリーから削除する(S606)。画面の役割に影響を与えないノードとは、属性ノード、テキストノード、及び文字の大きさや字体、位置を表すノード(Centerタグ、Uタグなど)等の3種類である。したがって、図17において破線の矩形で示されているノードが削除される。 Subsequently, the screen evaluation unit 14 deletes the node that does not affect the role of the screen (that is, does not affect the identification of the screen) from the DOM tree (S606). There are three types of nodes that do not affect the role of the screen, such as attribute nodes, text nodes, and nodes that represent the size, font, and position of characters (Center tag, U tag, etc.). Therefore, the node indicated by the dashed rectangle in FIG. 17 is deleted.

続いて、画面評価部14は、DOMツリーにおいて並列関係を有するノード(並列ノード)を1つのノードに集約する(S607)。並列ノードとは、DOMツリーの階層構造において同じ階層に属する同じタグ名の複数のノードをいう。図17では、1点鎖線で囲まれている2つの<h1>タグに対応するノードが並列ノードに該当する。ノードの集約は、並列ノードのうちの1つを残して他を削除することによって実現されてもよいし、各ノードを抽象化した1つのノードによって、並列ノードを置換することによって実現されてもよい。 Subsequently, the screen evaluation unit 14 collects nodes (parallel nodes) having a parallel relationship in the DOM tree into one node (S607). The parallel node refers to a plurality of nodes having the same tag name and belonging to the same hierarchy in the hierarchical structure of the DOM tree. In FIG. 17, the nodes corresponding to the two <h1> tags surrounded by the one-dot chain line correspond to parallel nodes. Aggregation of nodes may be achieved by leaving one of the parallel nodes and deleting the other, or by replacing the parallel nodes by one node that abstracts each node. Good.

ステップS604〜S608が対象遷移済みHTML及び対象HTMLのそれぞれについて実行されることにより、それぞれについて抽象化されたDOMツリーが生成される。 By performing steps S604 to S608 for each of the target transition completed HTML and the target HTML, an abstracted DOM tree is generated for each.

続いて、画面評価部14は、抽象化された2つのDOMツリーのそれぞれをHTMLに変換し、変換結果を比較して、比較結果を出力する(S609)。すなわち、対象遷移済みHTMLに係る画面と、対象HTMLに係る画面との同一性が判定される。比較されたHTMLが一致する場合、「一致」が比較結果として出力される。そうでない場合、「不一致」が比較結果として出力される。なお、比較されたHTMLの一致には、完全一致が要求されなくてもよい。例えば、同一タグの出現順等が異なることが許容されてもよい。 Subsequently, the screen evaluation unit 14 converts each of the two abstracted DOM trees into HTML, compares the conversion results, and outputs the comparison result (S609). That is, the identity between the screen related to the target transition completed HTML and the screen related to the target HTML is determined. When the compared HTMLs match each other, “match” is output as the comparison result. Otherwise, "mismatch" is output as the comparison result. It should be noted that complete matching may not be required for matching the compared HTMLs. For example, the appearance order of the same tag may be different.

比較結果が「一致」である場合(S610でYes)、対象遷移済みHTMLに関する処理は終了する。比較結果が「不一致」である場合(S610でNo)、画面評価部14は、ステップS602と同じ処理を実行して(S612)、図16の処理を終了する。 When the comparison result is “match” (Yes in S610), the process regarding the target transition completed HTML ends. When the comparison result is “mismatch” (No in S610), the screen evaluation unit 14 executes the same process as step S602 (S612), and ends the process in FIG.

続いて、図7のステップS109の詳細について説明する。図18は、画面遷移図の生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S109 in FIG. 7 will be described. FIG. 18 is a flowchart for explaining an example of a processing procedure of screen transition diagram generation processing.

ステップS701〜S703は、遷移リストに含まれている要素(遷移前画面のURL、遷移後画面のURL、リクエスト、遷移後画面のHTML、及びテストケースのセット)ごとに実行される。以下、処理対象の要素を「対象要素」という。 Steps S701 to S703 are executed for each element (URL of screen before transition, URL of screen after transition, request, HTML of screen after transition, and set of test cases) included in the transition list. Hereinafter, the element to be processed is referred to as "target element".

ステップS702において、テスト資材生成部15は、画面遷移図リストに、対象要素のリクエスト、対象要素の遷移前画面のURL、対象要素の遷移後画面のURLを含む要素を追加する。すなわち、画面遷移図リストは、リクエスト、遷移前画面のURL、遷移後画面のURLのセットを一つの要素とするリストである。 In step S702, the test material generation unit 15 adds an element including the request of the target element, the URL of the screen before the transition of the target element, and the URL of the screen after the transition of the target element to the screen transition diagram list. That is, the screen transition diagram list is a list having a set of the request, the URL of the screen before transition, and the URL of the screen after transition as one element.

ステップS704〜S709は、画面遷移図リストの要素ごとに実行される。以下、処理対象の要素を「対象要素」という。 Steps S704 to S709 are executed for each element of the screen transition diagram list. Hereinafter, the element to be processed is referred to as "target element".

ステップS705において、テスト資材生成部15は、画面遷移図リストにおいて、リクエスト及び遷移前画面のURLが対象要素と共通する要素数をカウントする。当該要素数は、動的解析において同じ画面(遷移前画面)から同じリクエストに基づいて遷移した画面の数である。以下、当該要素数を「動的遷移数n」という。 In step S705, the test material generation unit 15 counts the number of elements in the screen transition diagram list in which the URL of the request and the screen before transition is common to the target element. The number of elements is the number of screens transitioned from the same screen (pre-transition screen) based on the same request in the dynamic analysis. Hereinafter, the number of elements is referred to as “dynamic transition number n”.

続いて、テスト資材生成部15は、対象要素のリクエストに対応する遷移先の数を画面遷移情報リストから取得する(S706)。当該遷移先の数は、静的解析においてソースコードから抽出された当該リクエストの遷移先の数である。以下、当該遷移先の数を「静的遷移数m」という。 Subsequently, the test material generation unit 15 acquires the number of transition destinations corresponding to the request of the target element from the screen transition information list (S706). The number of transition destinations is the number of transition destinations of the request extracted from the source code in the static analysis. Hereinafter, the number of transition destinations is referred to as “static transition number m”.

続いて、テスト資材生成部15は、動的遷移数nが静的遷移数m以上であるか否かを判定する(S707)。動的遷移数nが静的遷移数m以上である場合(S707でYes)、対象要素に対する処理は終了する。動的遷移数nが静的遷移数m未満である場合(S707でNo)、テスト資材生成部15は、動的な遷移と静的な遷移との差異を検出する。すなわち、動的解析において遷移していない画面の存在が検出される。そこで、テスト資材生成部15は、対象要素のリクエストと対象要素の遷移前画面のURLとを含む要素を、m−nの数だけ画面遷移図リストに追加する(S708)。すなわち、図9の破線の矩形に対応する遷移に係る要素が追加される。 Subsequently, the test material generation unit 15 determines whether or not the number of dynamic transitions n is equal to or more than the number of static transitions m (S707). When the dynamic transition number n is equal to or greater than the static transition number m (Yes in S707), the process for the target element ends. When the number n of dynamic transitions is less than the number m of static transitions (No in S707), the test material generation unit 15 detects a difference between the dynamic transition and the static transition. That is, the presence of a screen that has not changed in the dynamic analysis is detected. Therefore, the test material generation unit 15 adds the elements including the request of the target element and the URL of the pre-transition screen of the target element to the screen transition diagram list by the number of mn (S708). That is, the element related to the transition corresponding to the rectangle of the broken line in FIG. 9 is added.

画面遷移図リストの全ての要素に対してステップS704〜S709が実行されると、テスト資材生成部15は、画面遷移図リストに基づいて、画面遷移図を生成する(S710)。この際、遷移後画面のURLが無い要素については、破線の矩形等、遷移できなかった画面として表現される。なお、生成された画面遷移図は、表示装置106に表示されてもよいし、画面遷移図を示すデータが、補助記憶装置102に保存されてもよい。 When steps S704 to S709 are executed for all the elements of the screen transition diagram list, the test material generation unit 15 generates a screen transition diagram based on the screen transition diagram list (S710). At this time, an element that does not have the URL of the post-transition screen is represented as a screen that cannot be transited, such as a dashed rectangle. The generated screen transition diagram may be displayed on the display device 106, or data indicating the screen transition diagram may be stored in the auxiliary storage device 102.

続いて、図7のステップS111の詳細について説明する。図19は、テストケースに対する入力値の補助処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S111 in FIG. 7 will be described. FIG. 19 is a flowchart for explaining an example of a processing procedure of auxiliary processing of an input value for a test case.

ステップS801において、テスト資材生成部15は、入力情報補助ファイルを表示装置106に表示する。 In step S801, the test material generation unit 15 displays the input information auxiliary file on the display device 106.

図20は、入力情報補助ファイルの表示例を示す図である。図20に示されるように、入力情報補助ファイルは、全ての画面遷移を達成することの出来なかった画面ごとに「URL」及び「タイトル」と、当該画面のフォームごとに、「ラベル」、「id」、「name」、「値」等を記憶可能な形式を有する。このうち、「URL」、「タイトル」、「ラベル」、「id」及び「name」の値は、図11のステップS415において登録されている。 FIG. 20 is a diagram showing a display example of the input information auxiliary file. As shown in FIG. 20, the input information auxiliary file includes “URL” and “title” for each screen that could not achieve all screen transitions, and “label” and “label” for each form of the screen. It has a format capable of storing “id”, “name”, “value” and the like. Among these, the values of “URL”, “title”, “label”, “id”, and “name” are registered in step S415 of FIG.

続いて、テスト資材生成部15は、入力情報補助ファイルを介して、各フォームの「値」の入力をユーザから受け付ける(S802)。すなわち、ユーザは、入力情報補助ファイルに登録されている各フォームについて、「ラベル」、「id」及び「name」等を手がかりとして、該フォームに対して適切な値を推測し、当該値を各フォームの「値」に入力する。 Subsequently, the test material generation unit 15 receives the input of the “value” of each form from the user via the input information auxiliary file (S802). That is, for each form registered in the input information auxiliary file, the user uses the “label”, “id”, “name”, and the like as clues to infer an appropriate value for the form, and Fill in the "Value" of the form.

続いて、テスト資材生成部15は、「値」が入力された状態の入力情報補助ファイルを保存する(S803)。 Subsequently, the test material generation unit 15 saves the input information auxiliary file in the state where the “value” is input (S803).

なお、入力情報補助ファイルの「値」に対して値が入力された後で、ステップS101が実行された場合、図13のステップS503では、入力情報補助ファイルに登録された各フォームに関してYesの判定となる。したがて、ステップS509において、当該各フォームについては、入力情報補助ファイルから入力値が取得される。その結果、前回では実現できなかった画面遷移を実現できる可能性が高まる。 When step S101 is executed after the value is input for the “value” of the input information auxiliary file, it is determined Yes in step S503 of FIG. 13 for each form registered in the input information auxiliary file. Becomes Therefore, in step S509, an input value is acquired from the input information auxiliary file for each form. As a result, there is an increased possibility that screen transitions that could not be achieved last time can be realized.

続いて、図7のステップS112の詳細について説明する。図21は、テストスクリプトの出力処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S112 in FIG. 7 will be described. FIG. 21 is a flowchart for explaining an example of a processing procedure of test script output processing.

ステップS901〜S903において、テスト資材生成部15は、遷移リストの各要素に含まれているテストケースをスクリプトの形式で出力することで、テストスクリプトを出力する(S902)。 In steps S901 to S903, the test material generation unit 15 outputs the test script by outputting the test case included in each element of the transition list in the script format (S902).

上述したように、本実施の形態によれば、Webアプリケーションの仕様として予定された画面遷移の情報(静的な画面遷移の情報)をソースコードから抽出し、Webアプリケーションに対する操作を自動的に実行して画面遷移を繰り返すことで発生した画面遷移の情報(動的な画面遷移の情報)を自動的に抽出し、静的な画面遷移の情報と動的な画面遷移の情報との差異を検出することができる。その結果、ソースコード上で定義されていながらテストスクリプトでは発生させることができない画面遷移を検出することができる。この際に、本実施の形態では、テストスクリプトでは発生させることができなかった画面遷移の遷移元の画面の各入力領域(各フォーム)に関する周辺情報が、入力情報補助ファイルに記録される。その後、入力情報補助ファイルが表示され、当該各入力領域に対する入力値がユーザによって入力される。 As described above, according to the present embodiment, the screen transition information (static screen transition information) scheduled as the Web application specifications is extracted from the source code, and the operation for the Web application is automatically executed. The screen transition information (dynamic screen transition information) generated by repeating the screen transition is automatically extracted, and the difference between the static screen transition information and the dynamic screen transition information is detected. can do. As a result, screen transitions that are defined in the source code but cannot be generated by the test script can be detected. At this time, in the present embodiment, peripheral information regarding each input area (each form) of the screen of the transition source of the screen transition that could not be generated by the test script is recorded in the input information auxiliary file. After that, the input information auxiliary file is displayed, and the input value for each input area is input by the user.

したがって、ユーザによる入力値の入力負担を出来るだけ小さくすることができると共に、テストスクリプトでは発生させることができなかった画面遷移が実現される可能性を高めることができる。その結果、Webアプリケーションに関するテストの実行を効率化することができる。 Therefore, it is possible to reduce the input load of the input value by the user as much as possible, and it is possible to increase the possibility that the screen transition that cannot be generated by the test script is realized. As a result, it is possible to improve the efficiency of executing the test related to the Web application.

また、ユーザから入力値を受け付ける際には、各入力フォームの周辺情報が表示される。したがって、ユーザは、当該周辺情報を手がかりとして、各入力フォームに適した値を推測することができる。 Further, when the input value is received from the user, the peripheral information of each input form is displayed. Therefore, the user can infer a value suitable for each input form by using the peripheral information as a clue.

また、本実施の形態によれば、テスト対象から仕様をリバースし、リバースした仕様に基づいてテストケースを自動生成し、テストスクリプトとして出力することができる。これによりWebアプリケーションにおける網羅的な画面遷移テストのテストスクリプト生成を追加の稼働を必要とせずに自動で行うことができる。その結果、例えば、ソフトウェアテストにかかる費用を削減することができる。 Further, according to the present embodiment, it is possible to reverse the specification from the test target, automatically generate a test case based on the reversed specification, and output it as a test script. This makes it possible to automatically generate a test script for a comprehensive screen transition test in a Web application without requiring additional operation. As a result, for example, the cost of software testing can be reduced.

また、本実施の形態によれば、技術課題1に関して、テスト対象から自動で、テスト対象を構成する画面と画面間の繋がり、各画面に到達するための手段を漏れなくリバースすることができる。また、静的解析によって、予めリクエストに対する画面遷移数の情報が入手できるため、動的解析中に探索打切りの判断を下しやすくなり、現実的な時間内で処理を行うことができる。本実施の形態ではサーバサイドの情報は必要としないため、ユーザはサーバサイドの情報を取得できるようにする環境を整える必要が無く、ツール導入のための追加稼働を抑えることができる。 Further, according to the present embodiment, with respect to the technical problem 1, it is possible to automatically reverse the means for reaching each screen automatically from the test target, the screens constituting the test target and the screens. In addition, since information on the number of screen transitions with respect to the request can be obtained in advance by the static analysis, it becomes easy to make a decision of search termination during the dynamic analysis, and the processing can be performed within a realistic time. In the present embodiment, server-side information is not required, so that the user does not need to prepare an environment for obtaining server-side information, and it is possible to suppress additional operation for introducing a tool.

また、本実施の形態によれば、技術課題2に関して、クライアントサイドの情報(HTML)を用いて、画面遷移を実現するための適切なテスト入力値を生成することができる。従来技術と異なり、サーバサイドの情報は必要としないため、ユーザはサーバサイドの情報を取得できるようにする環境を整える必要が無く、ツール導入のための追加稼働を抑えることができる。また、適切なテスト入力値を生成できなかった場合であっても、上記したようにユーザによる補助を受けることができるため、画面遷移を網羅できる可能性を高めることができる。 Further, according to the present embodiment, regarding the technical problem 2, it is possible to generate an appropriate test input value for realizing the screen transition by using the client side information (HTML). Unlike the conventional technology, since the server side information is not required, the user does not need to prepare an environment that allows the server side information to be acquired, and it is possible to suppress the additional operation for introducing the tool. Further, even when the appropriate test input value cannot be generated, the user can assist the user as described above, and thus the possibility of covering the screen transition can be increased.

更に、本実施の形態によれば、技術課題3に関して、閾値の設定を必要とせずに機能テストにおける適切な画面識別が可能となり、検証パターンの質を向上させることができる。 Further, according to the present embodiment, with respect to the technical problem 3, it is possible to appropriately identify the screen in the functional test without the need to set the threshold value, and improve the quality of the verification pattern.

なお、本実施の形態において、クライアント装置10は、テスト実行装置の一例である。画面遷移情報抽出部11は、抽出部の一例である。テストシナリオ生成部12は、第1の生成部の一例である。画面自動操作部13は、操作部の一例である。画面評価部14は、第2の生成部の一例である。テスト資材生成部15は、受付部及び記録部、の一例である。HTMLデータは、画面の記述情報の一例である。画面遷移情報リストは、第1の画面遷移の情報の一例である。遷移リストは、第2の画面遷移の情報の一例である。入力情報補助ファイル(補助記憶装置102)は、記憶部の一例である。 Note that in the present embodiment, the client device 10 is an example of a test execution device. The screen transition information extraction unit 11 is an example of an extraction unit. The test scenario generation unit 12 is an example of a first generation unit. The screen automatic operation unit 13 is an example of an operation unit. The screen evaluation unit 14 is an example of a second generation unit. The test material generation unit 15 is an example of a reception unit and a recording unit. HTML data is an example of screen description information. The screen transition information list is an example of information on the first screen transition. The transition list is an example of information on the second screen transition. The input information auxiliary file (auxiliary storage device 102) is an example of a storage unit.

以上、本発明の実施例について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 Although the examples of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications can be made within the scope of the gist of the present invention described in the claims. -Can be changed.

10 クライアント装置
11 画面遷移情報抽出部
12 テストシナリオ生成部
13 画面自動操作部
14 画面評価部
15 テスト資材生成部
20 サーバ装置
100 ドライブ装置
101 記録媒体
102 補助記憶装置
103 メモリ装置
104 CPU
105 インタフェース装置
106 表示装置
107 入力装置
B バス
10 Client Device 11 Screen Transition Information Extraction Unit 12 Test Scenario Generation Unit 13 Screen Automatic Operation Unit 14 Screen Evaluation Unit 15 Test Material Generation Unit 20 Server Device 100 Drive Device 101 Recording Medium 102 Auxiliary Storage Device 103 Memory Device 104 CPU
105 interface device 106 display device 107 input device B bus

Claims (4)

Webアプリケーションのソースコードから、前記ソースコードにおいて定義された第1の画面遷移の情報を抽出する抽出部と、
前記Webアプリケーションに関して表示される画面に対する入力値を生成する第1の生成部と、
前記第1の生成部が生成した入力値を前記画面に入力し、前記画面を自動的に操作する操作部と、
自動的な操作によって実現される第2の画面遷移の情報を生成する第2の生成部と、
前記第2の画面遷移が前記第1の画面遷移に対して不足する場合に、不足する画面遷移の遷移元の画面に対する各入力領域に対する値の入力をユーザから受け付ける受付部とを有し、
前記操作部は、前記受付部が受け付けた値を前記遷移元の画面に対して入力する、
ことを特徴とするテスト実行装置。
An extraction unit for extracting information on the first screen transition defined in the source code from the source code of the Web application;
A first generation unit that generates an input value for a screen displayed regarding the Web application;
An operation unit for inputting an input value generated by the first generation unit to the screen and automatically operating the screen;
A second generation unit that generates information on a second screen transition realized by automatic operation;
When the second screen transition is insufficient for the first screen transition, a reception unit that receives a value input from the user for each input area for the transition source screen of the insufficient screen transition,
The operation unit inputs the value received by the reception unit to the transition source screen,
A test execution device characterized by the above.
前記不足する画面遷移の遷移元の画面の各入力領域に関する情報を記憶部に記録する記録部を有し、
前記受付部は、前記記憶部に記録された情報を当該情報に係る入力領域ごとに表示して、当該入力領域に対する値の入力をユーザから受け付ける、
ことを特徴とする請求項1記載のテスト実行装置。
A recording unit that records information about each input area of the transition source screen of the insufficient screen transition in the storage unit,
The reception unit displays the information recorded in the storage unit for each input area related to the information, and receives a value input from the user from the input area.
The test execution device according to claim 1, wherein
前記入力領域に関する情報は、当該入力領域を含む画面の記述情報において、当該入力領域に関する記述部分から抽出される情報である、
ことを特徴とする請求項2記載のテスト実行装置。
The information regarding the input area is information extracted from the description portion regarding the input area in the description information of the screen including the input area.
The test execution device according to claim 2, wherein
Webアプリケーションのソースコードから、前記ソースコードにおいて定義された第1の画面遷移の情報を抽出する抽出手順と、
前記Webアプリケーションに関して表示される画面に対する入力値を生成する第1の生成手順と、
前記第1の生成手順が生成した入力値を前記画面に入力し、前記画面を自動的に操作する操作手順と、
自動的な操作によって実現される第2の画面遷移の情報を生成する第2の生成手順と、
前記第2の画面遷移が前記第1の画面遷移に対して不足する場合に、不足する画面遷移の遷移元の画面に対する各入力領域に対する値の入力をユーザから受け付ける受付手順とをコンピュータに実行させ、
前記操作手順は、前記受付手順が受け付けた値を前記遷移元の画面に対して入力する、
ことを特徴とするプログラム。
An extraction procedure for extracting information on the first screen transition defined in the source code from the source code of the Web application;
A first generation procedure for generating an input value for a screen displayed for the Web application,
An operation procedure of inputting an input value generated by the first generation procedure to the screen and automatically operating the screen,
A second generation procedure for generating information on the second screen transition realized by automatic operation,
When the second screen transition is insufficient for the first screen transition, the computer is made to execute an acceptance procedure for accepting a value input from the user for each input area for the transition source screen of the insufficient screen transition. ,
The operation procedure inputs the value accepted by the acceptance procedure to the transition source screen,
A program characterized by that.
JP2017233974A 2017-12-06 2017-12-06 Test execution device and program Active JP6723976B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017233974A JP6723976B2 (en) 2017-12-06 2017-12-06 Test execution device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017233974A JP6723976B2 (en) 2017-12-06 2017-12-06 Test execution device and program

Publications (2)

Publication Number Publication Date
JP2019101889A JP2019101889A (en) 2019-06-24
JP6723976B2 true JP6723976B2 (en) 2020-07-15

Family

ID=66973972

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017233974A Active JP6723976B2 (en) 2017-12-06 2017-12-06 Test execution device and program

Country Status (1)

Country Link
JP (1) JP6723976B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11886328B2 (en) 2019-10-28 2024-01-30 Nippon Telegraph And Telephone Corporation Test information extraction apparatus, test information extraction method and program
US12001324B2 (en) * 2019-11-07 2024-06-04 Nippon Telegraph And Telephone Corporation Operation pattern generation apparatus, operation pattern generation method and program
WO2023224013A1 (en) * 2022-05-17 2023-11-23 オン・デマンド・ワン株式会社 Test pattern generation device and test pattern generation program

Also Published As

Publication number Publication date
JP2019101889A (en) 2019-06-24

Similar Documents

Publication Publication Date Title
JP6514244B2 (en) Difference detection device and program
JP5947888B2 (en) Live browser tooling in an integrated development environment
US8281284B2 (en) Method and software for editing web documents
WO2016107126A1 (en) Image search method and device
JP6723976B2 (en) Test execution device and program
US10452730B2 (en) Methods for analyzing web sites using web services and devices thereof
US10572566B2 (en) Image quality independent searching of screenshots of web content
JP6535038B2 (en) Screen determination apparatus, screen determination method and program
US9747385B2 (en) Compression of cascading style sheet files
CN111367595B (en) Data processing method, program running method, device and processing equipment
CN110727417B (en) Data processing method and device
US20220035661A1 (en) Task generation
WO2018148926A1 (en) Card-based information management method and system
EP3624403A1 (en) File sending in instant messaging application
US10372760B2 (en) Building queries directed to objects hosted on clouds
CN110209780B (en) Question template generation method and device, server and storage medium
US20100007919A1 (en) Document management apparatus, document management method, and document management program
CN113806647A (en) Method for identifying development framework and related equipment
JP2006065467A (en) Device for creating data extraction definition information and method for creating data extraction definition information
US10803308B2 (en) Apparatus for deciding whether to include text in searchable data, and method and storage medium thereof
US20190095538A1 (en) Method and system for generating content from search results rendered by a search engine
KR100880709B1 (en) Auto-analysing method for javascript function and active web collecting robot system using the same method
CN109635175B (en) Page data splicing method and device, readable storage medium and electronic equipment
CN111143186A (en) Method and apparatus for application program interface API testing
US12001324B2 (en) Operation pattern generation apparatus, operation pattern generation method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190517

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200525

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200623

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200624

R150 Certificate of patent or registration of utility model

Ref document number: 6723976

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150