JP6535038B2 - Screen determination apparatus, screen determination method and program - Google Patents
Screen determination apparatus, screen determination method and program Download PDFInfo
- Publication number
- JP6535038B2 JP6535038B2 JP2017006985A JP2017006985A JP6535038B2 JP 6535038 B2 JP6535038 B2 JP 6535038B2 JP 2017006985 A JP2017006985 A JP 2017006985A JP 2017006985 A JP2017006985 A JP 2017006985A JP 6535038 B2 JP6535038 B2 JP 6535038B2
- Authority
- JP
- Japan
- Prior art keywords
- screen
- test
- transition
- html
- target
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、画面判定装置、画面判定方法及びプログラムに関する。 The present invention relates to a screen determination apparatus , a screen determination method, and a program.
近年、ニーズに合ったサービスを迅速に提供するため、サービスを短いサイクルで提供する開発スタイルが増加しており、それに伴いソフトウェアテストの頻度も増加している。このような中、Webアプリケーションにおいて、機能テストにおける画面遷移テストに稼働がかかることが問題となっている。機能テストとはJSTQB(非特許文献1)によると「コンポーネント(独立してテストできるソフトウェアの最小単位)やシステム(コンポーネントのセット)の機能仕様の分析に基づいて実施するテスト」と定義され、コンポーネントレベルの機能を確認するテストから、システムレベルの機能を確認するテストまで存在する。 In recent years, in order to provide services meeting needs quickly, development styles for providing services in a short cycle have been increasing, and the frequency of software testing has been increasing accordingly. Under these circumstances, in Web applications, there is a problem that the screen transition test in the function test takes work. Functional test is defined according to JSTQB (Non-Patent Document 1) as “test performed based on analysis of functional specification of component (minimum unit of software that can be independently tested) or system (set of components)”. There is a test to confirm the level function, and a test to confirm the system level function.
機能テストにおける画面遷移テストは、機能テストの中でも、「クライアントサイドからのインタラクションに対し、クライアントサイドに表示される画面から、仕様通りに実装されているかどうかを確認することができる機能に対するテスト」とここでは定義する。 The screen transition test in the functional test is, among the functional tests, "a test for a function that can confirm whether or not it is implemented as specified from a screen displayed on the client side with respect to interaction from the client side". Here we define it.
機能テストにおける画面遷移テストに稼働がかかるのは、クライアントサイドからのインタラクションとして、画面にあるリンクやボタンをクリックしたり、フォームに適切な値を入力するなどの人間の操作が求められるためである。このような画面遷移テストを自動化し、稼働削減を狙う方法として、テストケースのスクリプト化し、自動実行する手法が広く知られている。 The function of screen transition test in functional test takes place because human interaction such as clicking on a link or button on the screen or entering an appropriate value in a form is required as interaction from the client side. . As a method of automating such screen transition test and aiming at operation reduction, there is widely known a method of scripting test cases and automatically executing them.
テストケースを人手でスクリプト化するには稼働がかかるため、以下の2つのテストスクリプト自動生成技術が存在する。
・Capture and Replay技術を用いたテストスクリプトの自動生成(非特許文献2)
・モデルベーステストによるテストスクリプトの自動生成(非特許文献3)
Manual scripting of test cases takes time, so the following two test script automatic generation techniques 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)
Capture and Replay技術では、仕様から人手で作成したテストケースをユーザが実行することで、ユーザの画面に対する操作を記録してテストスクリプトとして出力することができる。しかし、Capture and Replay技術を用いた場合、画面操作を記録するためのツール操作といった追加の稼働が発生するため、一般的に3回以上同等のテストを実施しない場合は、稼働の元が取れないという欠点が存在する。 In the Capture and Replay technology, the user can execute a test case created manually from the specification, thereby recording the operation on the user's screen and outputting it as a test script. However, when using the Capture and Replay technology, additional operations such as tool operations for recording screen operations occur, so if you do not perform equivalent tests three or more times in general, you can not get the source of the operation. There is a drawback of that.
モデルベーステストでは、仕様をマシンが読み取れる形式のモデルで記述することで、読み取った仕様からテストケースを自動生成し、テストスクリプトとして出力することができる。しかし、モデルを記述するための追加の稼働がかかるという欠点が存在する。 In model-based testing, by describing the specifications in a form that can be read by a machine, test cases can be automatically generated from the read specifications and output as test scripts. However, there is a disadvantage that it takes 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 an additional operation for generating a test script occurs.
一方で、追加の稼動を削減することでテストスクリプトの自動生成の効率化を図ろうとした場合、テストスクリプトによって実現される画面遷移の網羅性が問題となる。すなわち、一般的に画面はURLで識別されるが、同一URLの画面同士でも、機能テストでは異なる画面と判別される必要が有ることがある。例えば、検索サイトにおいて、検索結果が無かったときの画面と検索結果が有ったときの画面はURLで見た場合、同一となることがあるが、機能テストの観点では別々の画面としてみなされるのが望ましい。また、多少の相違が有っても、機能テストの観点では機能的に同じ画面であれば同じ画面としてみなされるのが望ましい。各画面の同一性が適切に判定されなければ、各画面への遷移を網羅することが困難となり、テストの網羅性が低下してしまう。したがって、Webアプリケーションに関する画面の同一性を適切に判定できる技術が望まれる。 On the other hand, when attempting to improve the automatic generation of test scripts by reducing the additional operation, the exhaustivity of the screen transition realized by the test script becomes a problem. That is, in general, screens are identified by URLs, but even screens of the same URL may need to be distinguished as different screens in a functional test. For example, in 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 by URL, but they are regarded as separate screens from the viewpoint of functional test Is desirable. Moreover, even if there is a slight difference, it is desirable from the viewpoint of functional testing that the same screen is regarded as the same screen if it is functionally the same. If the identity of each screen is not properly determined, it is difficult to cover the transition to each screen, and the test coverage is reduced. Therefore, a technique that can appropriately determine the identity of screens related to web applications is desired.
本発明は、上記の点に鑑みてなされたものであって、Webアプリケーションに関する画面の同一性を適切に判定可能とすることを目的とする。 The present invention has been made in view of the above-described points, and an object of the present invention is to make it possible to appropriately determine the identity of a screen related to a Web application.
そこで上記課題を解決するため、画面判定装置は、Webアプリケーションに関する第1の画面の記述情報と、前記Webアプリケーションと同一又は異なるWebアプリケーションに関する第2の画面の記述情報とのそれぞれに対して、並列関係を有する画面要素を一つに集約する編集を行う編集部と、編集後の記述情報を比較して、前記第1の画面と前記第2の画面との同一性を判定する判定部と、を有する。
Then, in order to solve the above-mentioned subject, a screen judging device is paralleled to each of the descriptive information of the 1st screen about Web application, and the descriptive information of the 2nd screen about the same or different Web application as the Web application. An editing unit that edits to combine screen elements having a relationship into one, and a determination unit that compares the description information after editing and determines the identity between the first screen and the second screen; Have.
Webアプリケーションに関する画面の同一性を適切に判定可能とすることができる。 It is possible to appropriately determine the identity of the screen related to the web application.
以下、図面に基づいて本発明の実施の形態を説明する。本実施の形態では、テスト対象から仕様をリバースし、リバースした仕様に基づいて網羅的なテストケースを自動生成し、テストスクリプトとして出力するといったアプローチを提案する。本アプローチによって、追加の稼働を必要とせずに網羅的なテストスクリプトを自動生成することができる。 Hereinafter, embodiments of the present invention will be described based on the drawings. In the present 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 a test script is output as a test script. With this approach, exhaustive test scripts can be generated automatically without the need for additional operations.
本実施の形態では、機能テストにおける画面遷移テストを対象としているため、以下のステップで処理が実行される。
(1)テスト対象を解析し、仕様としてテスト対象を構成する画面と画面間の繋がり、各画面に到達するための手段を抽出する。
(2)(1)で取得した仕様から機能テストにおける画面遷移テストに適した画面遷移図を生成する。
(3)(2)で生成した画面遷移図の各遷移に対応するテストスクリプトを、(1)で抽出した画面に到達するための手段の情報に基づいて、出力したいスクリプト形式に合わせて出力する。
In the present embodiment, since the screen transition test in the function test is targeted, the process is executed in the following steps.
(1) The test object is analyzed, and a screen and a connection between the screens constituting the test object are extracted as specifications, and means for reaching each screen are extracted.
(2) The screen transition diagram suitable for the screen transition test in the function 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)の元となるファイルから、クライアントサイドからのリクエストに応じて、動的に画面を生成するケースが一般的である。したがって、動的解析技術を用いてテスト対象を探索しつつ、情報を収集する。具体的には、動的解析において遷移する各画面のHTMLを解析し、ボタンやリンク等の情報を自動取得し、すべてのボタンやリンクをクリックするようなテストケースを生成する。また、入力フォームが存在する場合は無作為な値をテスト入力値とする。各画面に対し、上記を繰り返すことで画面遷移の網羅を目指す。 In (1), the screen that constitutes the test object and the means for reaching that screen are extracted. In Web applications, it is common to dynamically generate screens in response to requests from the client side from files that are the origin of screens (HTML) such as jsp files. Therefore, information is collected while searching for the test target using dynamic analysis technology. Specifically, the HTML of each screen transitioning in the dynamic analysis is analyzed, information such as buttons and links is automatically acquired, and a test case is generated in which all the buttons and links are clicked. Also, if there is an input form, a random value is used as a test input value. Aim for coverage of screen transitions by repeating the above for each screen.
(2)では、(1)で取得したテスト対象を構成する画面情報を用いて、機能テストにおける画面遷移テストに適した画面遷移図を生成する。機能テストにおける画面遷移テストでは、機能の粒度で画面を識別する必要がある。一般的に画面はURLで識別されるが、同一URLの画面同士でも、機能テストでは異なる画面と判別されることがある。例えば、検索サイトにおいて、検索結果が無かったときの画面と検索結果が有ったときの画面はURLで見た場合、同一となることがあるが、機能テストの観点では別々の画面としてみなされる。したがって、機能テストの観点に合った、適切な画面識別を行う必要がある(技術課題1:機能テストにおける適切な画面識別方法の検討)。 In (2), the screen transition diagram suitable for the screen transition test in the function test is generated using the screen information constituting the test object acquired in (1). The screen transition test in the function test needs to identify the screen by the function granularity. Generally, screens are identified by URLs, but even screens with the same URL may be determined to be different screens in a functional test. For example, in 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 by URL, but they are regarded as separate screens from the viewpoint of functional test . Therefore, it is necessary to perform appropriate screen identification in accordance with the viewpoint of functional test (Technical Problem 1: Examination of an appropriate screen identification method in functional test).
(3)は、出力したいスクリプト形式に合わせてテストスクリプトを生成するステップである。(1)で抽出した画面に到達するための手段(リンクやボタンのクリック、フォームへの入力等)を、出力したいスクリプト形式で記述する。本ステップについては、抽出した手段をそれに対応するメソッドで記述するだけなので技術的課題はないと考えられる。 Step (3) is a step of generating a test script in accordance with a script format desired to be output. Describe the means for reaching the screen extracted in (1) (clicks on links or buttons, input to a form, etc.) in the form of a script to be output. In this step, it is considered that there is no technical problem since only the extracted means is described by the corresponding method.
以上より、本アプローチには以下の技術的課題があると考えられる。
技術課題1:機能テストにおける適切な画面識別方法の検討。
From the above, this approach is considered to have the following technical issues.
Technical issue 1: Examination of appropriate screen identification method in functional test.
[技術課題1:機能テストにおける適切な画面識別方法の検討]
<従来技術と問題点>
本実施の形態では、機能テストにおける画面遷移テストを、機能テストの中でも、「クライアントサイドからのインタラクションに対し、クライアントサイドに表示される画面から、仕様通りに実装されているかどうかを確認することができる機能に対するテスト」と定義する。一般的に画面はURLで識別されるが、本定義における画面遷移テストでは、同一URLの画面同士でも画面によっては異なる画面としてテストすることが重要である。例えば、検索サイトにおいて、図1のように検索結果が無かったときの画面と検索結果が有ったときの画面はURLで見た場合、同一となることがあるが、機能テストの観点では別々の画面としてみなす。このような場合、URLではなく、表示される画面から識別するべきである。しかし、単純に表示された画面同士を画像として比較すると、確認したい機能部分が同一でも、それ以外の箇所が異なっていた場合、異なる画面と判別されてしまう。したがって、画面全体ではなく、画面を構成する要素の一部を比較する必要がある。画面は主にHTML、DOM(Document Object Model )構造、テキスト、画像、CSS(Cascading Style Sheets)等の要素で構成されている。
[Technical problem 1: Examination of appropriate screen identification method in functional test]
<Prior art and problems>
In the present embodiment, the screen transition test in the function test is also confirmed in the function test whether “the interaction from the client side is implemented according to the specification from the screen displayed on the client side. It defines as "the test for the function which can be done". Generally, screens are identified by URLs, but in the screen transition test in this definition, it is important to test screens of the same URL as different screens depending on the screen. For example, in the search site, the screen when there is no search result as shown in FIG. 1 and the screen when there is a search result may be the same when viewed in URL, but they are different in terms of functional test Consider it as a screen. In such a case, it should be identified from the displayed screen, not the URL. However, when the screens displayed simply are compared as images, even if the functional part to be confirmed is the same, if the other parts are different, it is determined that the screens are different. Therefore, it is necessary to compare some of the elements that make up the screen, not the entire screen. The screen is mainly composed of elements such as HTML, Document Object Model (DOM) structure, text, images, and Cascading Style Sheets (CSS).
試験観点によって着目すべき箇所は異なるが、本実施の形態では機能の違いが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 places to be focused differ depending on the test point of view, in the present embodiment, the case where the difference in function appears in the DOM structure of HTML is targeted. There is a method using Tree Edit Distance (hereinafter referred to as "TED") as an existing method for comparing DOM structures of HTML (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ツリーが一致するまでノードの削除・挿入を行ったときの削除・挿入の回数となる。例えば、図2においてDOMツリー1とDOMツリー2を一致させるには、DOMツリー2の<p>、<strong>、<U>の3つのノードを削除し、<img>ノードを挿入する必要があるため、TEDの値は4となる。閾値が3以下の場合、DOMツリー1とDOMツリー2の構造は不一致と判断することができ、閾値が4以上の場合、DOMツリー1とDOMツリー2の構造は一致すると判断することができる。
TED is the number of deletions / insertions when deleting / inserting nodes until both DOM trees match. For example, to match
TEDを用いた画面の構造比較の欠点として、画面ごとに適切な閾値が異なるため、閾値の設定が困難であるといった点が挙げられる。閾値(TEDに対する許容範囲)を必要とする原因として、以下の2つが考えられる。
原因1:機能テストにおける画面の識別に影響を与えないノードの存在
原因2:並列化されたノードの存在
原因1については、太字タグ<b>など、機能テストにおいて画面の識別に影響を与えないノードが存在することが挙げられる。原因2については、見出しタグなどが挙げられる。例えば、ニュースサイトにおいて、見出しの数が異なっている場合でもニュースを表示するという機能は同一であるため、見出しの数は機能に影響を与えないということがいえる。このように画面の識別に影響を与えないノードが存在し、それらのノードによってTEDの値が増加するため、閾値を設ける必要がある。
As a drawback of the structure comparison of the screen using TED, it is difficult to set the threshold because the appropriate threshold is different for each screen. There are two possible causes for the need for a threshold (acceptable range for TED):
Cause 1: Existence of node that does not affect screen identification in functional test Cause 2: Existence of parallelized node Does not affect screen identification in functional test such as bold tag <b> for
<本実施の形態における提案:HTMLのDOM構造の類似度を利用した画面識別技術>
本実施の形態では、原因1に関わるノードを削除し、原因2に関わるノードを集約することでHTMLを抽象化し、抽象化されたHTMLを比較することで、閾値の設定を必要とせずに機能テストにおける適切な画面識別を可能とする。
<Proposal in this Embodiment: Screen Identification Technology Using Similarity of HTML DOM Structure>
In the present embodiment, the function is performed without requiring the setting of the threshold value by abstracting the HTML by deleting the nodes related to the
以下、上記を実現するための具体例について説明する。図3は、本発明の実施の形態におけるシステム構成例を示す図である。図3において、サーバ装置20及びクライアント装置10は、例えば、LAN(Local Area Network)又はインターネット等のネットワークを介して接続される。
Hereinafter, specific examples for realizing the above will be described. FIG. 3 is a diagram showing an example of a system configuration in the embodiment of the present invention. In FIG. 3, the
サーバ装置20は、Webアプリケーションを含むテスト対象のシステムを含む1以上のコンピュータである。
The
クライアント装置10は、サーバ装置20が有するWebアプリケーションについてのテスト(検証)を支援する装置である。
The
図4は、本発明の実施の形態におけるクライアント装置10のハードウェア構成例を示す図である。図4のクライアント装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、インタフェース装置105、表示装置106、及び入力装置107等を有する。
FIG. 4 is a diagram showing an example of the hardware configuration of the
クライアント装置10での処理を実現するプログラムは、CD−ROM等の記録媒体101によって提供される。プログラムを記憶した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。
A program for realizing the processing in the
メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従ってクライアント装置10に係る機能を実現する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。表示装置106はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置107はキーボード及びマウス等で構成され、様々な操作指示を入力させるために用いられる。
The
図5は、本発明の実施の形態におけるクライアント装置10の機能構成例を示す図である。図5において、クライアント装置10は、テストシナリオ生成部11、画面自動操作部12、画面評価部13及びテスト資材生成部14等を有する。これら各部は、クライアント装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。
FIG. 5 is a diagram showing an example of a functional configuration of the
テストシナリオ生成部11は、テストにおいて表示された各画面に対するテストシナリオとテスト入力値とを生成する。
The test
画面自動操作部12は、生成されたテストシナリオとテスト入力値とをテストケースとして、画面操作を自動的に実行することで、動的解析を実現する。
The screen
画面評価部13は、画面操作の実行により遷移した画面が既に遷移したことのある画面か否かをURLやHTML等の情報を用いて判定する。画面評価部13は、画面操作の実行により遷移した画面のHTMLデータと、既に遷移したことのある画面のHTMLデータとについて、それぞれを抽象化するための編集処理を行って、編集後のHTMLデータを比較する。
The
図5において、画面評価部13は、ノード削除部131、ノード集約部132及び比較部133を含む。ノード削除部131は、上記の編集処理の一部として、上記の原因1に関わるノードの削除を実行する。ノード集約部132は、上記の編集処理の一部として、上記の原因2に関わるノードの集約を実行する。比較部133は、ノードの削除やノードの集約等の編集処理によって抽象化された2つのHTMLを比較して、当該2つのHTMLに係る画面の同一性を判定する。
In FIG. 5, the
テスト資材生成部14は、静的解析及び動的解析により得られた情報に基づいて、画面遷移図を生成する。テスト資材生成部14は、また、テストシナリオ生成部11によって生成されたテストシナリオとテスト入力値をテストスクリプトの形式で出力する。
The test
以下、クライアント装置10が実行する処理手順について説明する。図6は、クライアント装置10が実行する処理手順の一例を説明するためのフローチャートである。
The processing procedure executed by the
ステップS101において、画面自動操作部12は、初期URLにアクセスして、初期URLに対応するHTMLデータ等を取得する。その結果、当該HTMLデータ等に基づく画面が表示装置106に表示される。初期URLは、例えば、ユーザによって入力されてもよいし、補助記憶装置102に予め記憶されていてもよい。
In step S101, the screen
続くステップS102〜S107では、初期URLに対応するHTMLデータ、及び当該HTMLデータに係る画面を起点として遷移可能な全てのHTMLデータに関して、動的解析等が実行される。具体的には、動的解析として、初期URLに対応する画面を起点として実際にテスト対象の画面操作が自動的に実施される。動的解析では、各画面上の全てのリンクに対してクリックを実施し、入力フォームとそれに対応するサブミットボタンが有る場合には、サブミットボタンを押したときのリクエストに対してテスト入力値が生成され、画面操作が繰り返される。遷移先の画面について、既に遷移した画面との比較を行い、新規に遷移した画面かどうかの判断を行って、到達画面数をカウントする。以上の動的解析によって遷移先画面の情報(HTML、URL等)と画面間の繋がり、画面に到達するための手段が取得される。また、コントローラを通らない画面遷移が動的解析で発見された場合、その画面遷移の情報も追加される。コントローラを通らない画面遷移とは、例えば、aタグでのリンクがクリックされた場合に発生する画面遷移である。コントローラとは、Webアプリケーションにおいて一般的に用いられているデザインパターンであるMVC(Model View Controller)の構成において、クライアントサイドからのリクエストに対して実行する処理を決定する部分をいう。例えば、サーブレットがコントローラの一例である。 In the subsequent steps S102 to S107, dynamic analysis or the like is performed on the HTML data corresponding to the initial URL and all HTML data that can be transited from the screen related to the HTML data as a starting point. Specifically, as the dynamic analysis, the screen operation of the test target is automatically implemented automatically from the screen corresponding to the initial URL. In dynamic analysis, clicks are performed for all links on each screen, and if there is an input form and a corresponding submit button, test input values are generated for the request when the submit button is pressed. And the screen operation is repeated. The screen of the transition destination is compared with the screen that has already transitioned, and it is determined whether the screen has newly transitioned, and the number of arrived screens is counted. Through the above dynamic analysis, information on the transition destination screen (HTML, URL, etc.) and the connection between the screens, and means for reaching the screen are acquired. In addition, when a screen transition not passing through the controller is found by dynamic analysis, information on the screen transition is also added. The screen transition not passing through the controller is, for example, a screen transition that occurs when the link in the a tag is clicked. The controller is a part that determines processing to be executed for a request from the client side in the configuration of a model view controller (MVC), which is a design pattern generally used in Web applications. For example, a servlet is an example of a controller.
以下、ステップS102〜S107の間で処理対象とされているHTMLデータを、「対象HTML」という。 Hereinafter, the HTML data to be processed in steps S102 to S107 will be referred to as "target HTML".
ステップS103において、テストシナリオ生成部11は、対象HTMLに係る画面(以下、「対象画面」という。)に対するテストシナリオを生成する。すなわち、対象画面において画面の遷移を発生させる画面要素(リンクやサブミットボタン等)ごとに、操作及びロケータの組からなるテストシナリオが生成される。操作は、クリック等の操作である。ロケータは、操作の対象とされる画面要素の識別情報である。
In step S103, the test
続くステップS104〜S106は、ステップS103において生成されたテストシナリオごとに実行される。S104〜S106において処理対象とされているテストシナリオを、以下「対象テストシナリオ」という。 The following steps S104 to S106 are executed for each of the test scenarios generated in step S103. The test scenario to be processed in S104 to S106 is hereinafter referred to as "target test scenario".
ステップS105において、テストシナリオ生成部11が、対象テストシナリオに基づいてテストケースを生成し、画面自動操作部12が、当該テストケースを対象画面に対して実行する。その結果、画面遷移が発生する。なお、対象テストシナリオが、入力値を必要とする場合、ステップS105において、テスト入力値の生成が行われる。
In step S105, the test
遷移先の全ての画面(HTML)に対してステップS102〜S107が実行されると、テスト資材生成部14は、画面遷移図を生成する(S108)。具体的には、テスト資材生成部14は、ステップS102〜S107において実際に発生した画面遷移を示す画面遷移図を生成する。
When steps S102 to S107 are executed for all screens (HTML) of the transition destination, the test
図7は、画面遷移図の一例を示す図である。図7では、画面Aから画面B及び画面Cに遷移し、画面Cから画面Bに遷移することが示されている。 FIG. 7 is a diagram showing an example of the screen transition diagram. FIG. 7 shows transition from screen A to screen B and screen C, and transition from screen C to screen B.
続いて、テスト資材生成部14は、各画面遷移が発生したときのテストシナリオとテスト入力値とをテストスクリプトの形式で出力する(S109)。
Subsequently, the test
続いて、図6のステップS105の詳細について説明する。図8は、テストケースの生成及び実行処理の処理手順の一例を説明するためのフローチャートである。 Subsequently, details of step S105 in FIG. 6 will be described. FIG. 8 is a flowchart for explaining an example of a processing procedure of test case generation and execution processing.
ステップS201において、テストシナリオ生成部11は、対象テストシナリオの操作にフォームへの入力操作が含まれているか否かを判定する。対象テストシナリオの操作にフォームへの入力操作が含まれていない場合(S201でNo)、テストシナリオ生成部11は、対象テストシナリオをそのままテストケースとする(S202)。続いて、画面自動操作部12は、当該テストケースを対象画面に対して実行する(S203)。当該テストケースの実行により、画面遷移が発生する。続いて、画面評価部13は、テストケースの実行によるリンクのクリックやボタンの押下により発生したリクエストを「リクエストA」として記憶する(S205)。
In step S201, the test
続いて、画面評価部13は、ステップS203で遷移した画面が既に遷移したことのある画面か否かをURLやHTML等の情報を用いて判定する(S205)。この際、ステップS203で遷移した画面が未だ遷移したことのない画面である場合、当該遷移に関する情報が、遷移リストの要素として追加される。遷移リストとは、動的解析において発生した画面間の遷移に関する情報を要素とするリストである。当該要素は、遷移前画面のURL、遷移後画面のURL、リクエストA、遷移後画面のHTML、及びテストケース等を含む。
Subsequently, the
一方、対象テストシナリオの操作にフォームへの入力操作が含まれている場合(S201でYes)、テストシナリオ生成部11は、変数iに0を代入する。変数iは、ステップS207以降の実行回数を記憶するための変数である。続いて、テストシナリオ生成部11は、フォームへの入力値(テスト入力値)を生成する(S207)。例えば、対象画面が図9に示される通りであれば、対象テストシナリオには、姓に対応するフォームへの入力操作、名に対応するフォームへの入力操作、メールアドレスに対応するフォームへの入力操作、及び登録ボタンの押下等が含まれている。したがって、この場合、フォームごとに1つのテスト入力値が無作為に(ランダムに)生成される。
On the other hand, when the operation of the target test scenario includes the input operation to the form (Yes in S201), the test
ステップS208において、テストシナリオ生成部11は、生成された各テスト入力値がそれぞれに対応するフォームへの入力対象とされたテストケースを、対象テストシナリオに基づいて生成する。続いて、画面自動操作部12は、当該テストケースを対象画面に対して実行する(S209)。すなわち、対象テストシナリオにおいて値の入力先とされている各フォームに対してテスト入力値が入力され、対象テストシナリオにおいて押下対象とされているサブミットボタンが押下される。その結果、画面遷移が発生する。
In step S208, the test
続いて、画面評価部13は、ボタンの押下により発生したリクエストを「リクエストA」として記憶する(S210)。続いて、画面評価部13は、ステップS205と同様の処理を実行する(S211)。
Subsequently, the
続いて、画面評価部13は、変数iに1を加算する(S212)。続いて、画面評価部13は、変数iの値が、Nに到達したか否かを判定する(S213)。Nは、ステップS207以降のループ回数として予め設定された定数である。Nの値を大きくすればするほど、動的解析における画面遷移の網羅性を高めることができるが、処理時間が長くなる。
Subsequently, the
変数iの値が、Nに等しい場合(S213でYes)、対象テストシナリオについては、図8の処理が終了する。変数iの値が、Nに達していない場合(S213でNo)、ステップS207以降が繰り返される。すなわち、対象テストシナリオについて、異なるテスト入力値が生成されてテストケースが実行される。 If the value of the variable i is equal to N (Yes in S213), the process of FIG. 8 ends for the target test scenario. If the value of the variable i has not reached N (No in S213), step S207 and subsequent steps are repeated. That is, for the target test scenario, different test input values are generated and the test case is executed.
続いて、図8のステップS205及びS211の詳細について説明する。図10は、遷移先画面の判定処理の処理手順の一例を説明するためのフローチャートである。 Subsequently, details of steps S205 and S211 in FIG. 8 will be described. FIG. 10 is a flowchart for describing an example of a processing procedure of determination processing of a transition destination screen.
ステップS301において、画面評価部13は、遷移リストの中のリクエストAを含むいずれかの要素の中に、現在の遷移先画面(すなわち、対象画面)のURLが遷移後画面のURLとして含まれているか否かを判定する。現在の遷移先画面のURLがリクエストAの遷移後画面のURLとして遷移リストに含まれていない場合(S301でNo)、画面評価部13は、リクエストA、遷移前画面のURL、現在の遷移先画面のURL、現在の遷移先画面のHTML(対象HTML)、及び対象テストシナリオに係るテストケースをセットとする要素を遷移リストに追加する(S302)。
In step S301, the
一方、現在の遷移先画面のURLがリクエストAの遷移後画面のURLとして遷移リストに含まれている場合(S301でYes)、画面評価部13は、遷移リストにおいてリクエストAを含み、かつ、現在の遷移先画面のURLを遷移後画面のURLとして含む要素の遷移後画面のHTMLデータごとに、ステップS303〜S311を実行する。以下、処理対象とされている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 request A (Yes in S301), the
続いて、画面評価部13は、対象遷移済みHTML及び対象HTMLのそれぞれについて、ステップS304〜S308を実行する。対象遷移済みHTML及び対象HTMLのうち、処理対象とされているHTMLを、「着目HTML」という。
Subsequently, the
ステップS305において、画面評価部13は、着目HTMLのDOMツリーを生成する。図11にDOMツリーの一例を示す。図11に示されるように、DOMツリーは、各ノード(各画面要素)の階層構造を示す。
In step S305, the
続いて、ノード削除部131は、画面の役割に影響を与えない(すなわち、画面の識別に影響を与えない)ノードを、DOMツリーから削除する(S306)。画面の役割に影響を与えないノードとは、属性ノード、テキストノード、及び文字の大きさや字体、位置を表すノード(Centerタグ、Uタグなど)等の3種類である。したがって、図11において破線の矩形で示されているノードが削除される。
Subsequently, the
続いて、ノード集約部132は、DOMツリーにおいて並列関係を有するノード(並列ノード)を1つのノードに集約する(S307)。並列ノードとは、DOMツリーの階層構造において同じ階層に属する同じタグ名の複数のノードをいう。図11では、1点鎖線で囲まれている2つの<h1>タグに対応するノードが並列ノードに該当する。ノードの集約は、並列ノードのうちの1つを残して他を削除することによって実現されてもよいし、各ノードを抽象化した1つのノードによって、並列ノードを置換することによって実現されてもよい。
Subsequently, the
ステップS304〜S308が対象遷移済みHTML及び対象HTMLのそれぞれについて実行されることにより、それぞれについて抽象化されたDOMツリーが生成される。 By executing steps S304 to S308 for each of the target transitioned HTML and the target HTML, an abstracted DOM tree is generated for each of the target transitioned HTML and the target HTML.
続いて、比較部133は、抽象化された2つのDOMツリーのそれぞれをHTMLに変換し、変換結果を比較して、比較結果を出力する(S309)。すなわち、対象遷移済みHTMLに係る画面と、対象HTMLに係る画面との同一性が判定される。比較されたHTMLが一致する場合、「一致」が比較結果として出力される。そうでない場合、「不一致」が比較結果として出力される。なお、比較されたHTMLの一致には、完全一致が要求されなくてもよい。例えば、同一タグの出現順等が異なることが許容されてもよい。
Subsequently, the
比較結果が「一致」である場合(S310でYes)、対象遷移済みHTMLに関する処理は終了する。比較結果が「不一致」である場合(S310でNo)、画面評価部13は、ステップS302と同じ処理を実行して(S312)、図10の処理を終了する。
If the comparison result is “matched” (Yes in S310), the process regarding the target transitioned HTML ends. When the comparison result is “mismatch” (No in S310), the
続いて、図6のステップS108の詳細について説明する。図12は、画面遷移図の生成処理の処理手順の一例を説明するためのフローチャートである。 Subsequently, details of step S108 in FIG. 6 will be described. FIG. 12 is a flowchart for explaining an example of the processing procedure of the screen transition diagram generation process.
ステップS401〜S403は、遷移リストに含まれている要素(遷移前画面のURL、遷移後画面のURL、リクエスト、遷移後画面のHTML、及びテストケースのセット)ごとに実行される。以下、処理対象の要素を「対象要素」という。 Steps S401 to S403 are executed for each element included in the transition list (the URL of the screen before transition, the URL of the screen after transition, the request, the HTML of the screen after transition, and the set of test cases). Hereinafter, the element to be processed is referred to as a "target element".
ステップS402において、テスト資材生成部14は、画面遷移図リストに、対象要素のリクエスト、対象要素の遷移前画面のURL、対象要素の遷移後画面のURLを含む要素を追加する。すなわち、画面遷移図リストは、リクエスト、遷移前画面のURL、遷移後画面のURLのセットを一つの要素とするリストである。
In step S402, the test
続いて、テスト資材生成部14は、画面遷移図リストに基づいて、画面遷移図を生成する(S404)。なお、生成された画面遷移図は、表示装置106に表示されてもよいし、画面遷移図を示すデータが、補助記憶装置102に保存されてもよい。
Subsequently, the test
続いて、図6のステップS109の詳細について説明する。図13は、テストスクリプトの出力処理の処理手順の一例を説明するためのフローチャートである。 Subsequently, the details of step S109 in FIG. 6 will be described. FIG. 13 is a flowchart for explaining an example of the processing procedure of the test script output process.
ステップS501〜S503において、テスト資材生成部14は、遷移リストの各要素に含まれているテストケースをスクリプトの形式で出力することで、テストスクリプトを出力する。
In steps S501 to S503, the test
上述したように、本実施の形態によれば、遷移先の画面と、遷移済みの画面との比較において、それぞれのHTMLデータに所定の編集処理を行い、編集後のHTMLデータを比較して同一性が判定される。その結果、検索結果画面のように、同一のURLの画面であっても、異なる画面であることを判定することができる。また、機能的又は役割的に同じ画面が異なる画面であると判定される可能性を低下させることができる。すなわち、Webアプリケーションに関する画面の同一性を適切に判定可能とすることができる。その結果、例えば、Webアプリケーションの不具合を市場流出前において検知できる可能性と高めることができ、短期開発をも可能とすることができる。なお、本実施の形態は、同一のWebアプリケーションに関する画面の同一性だけでなく、異なるWebアプリケーションに関する画面の同一性の判定に適用されてもよい。 As described above, according to the present embodiment, in comparison between the screen of the transition destination and the screen after transition, each HTML data is subjected to predetermined editing processing, and the HTML data after editing is compared and identical. Sex is determined. As a result, even if it is a screen of the same URL like a search result screen, it can be determined that it is a different screen. In addition, it is possible to reduce the possibility that it is determined that the same screen is functionally or functionally different. That is, it is possible to appropriately determine the identity of the screen related to the web application. As a result, for example, it is possible to enhance the possibility of detecting a failure of a web application before the market outflow, and also enable short-term development. The present embodiment may be applied not only to the sameness of the screens related to the same Web application, but also to the judgment of the sameness of the screens related to different Web applications.
また、本実施の形態によれば、テスト対象から仕様をリバースし、リバースした仕様に基づいてテストケースを自動生成し、テストスクリプトとして出力することができる。これにより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. As a result, test script generation for comprehensive screen transition test in Web application can be automatically performed without the need for additional operation. As a result, for example, the cost for software testing can be reduced.
更に、本実施の形態によれば、技術課題1に関して、閾値の設定を必要とせずに機能テストにおける適切な画面識別が可能となり、検証パターンの質を向上させることができる。
Furthermore, according to the present embodiment, with regard to
なお、本実施の形態において、クライアント装置10は、画面判定装置の一例である。ノード削除部131及びノード集約部132は、編集部の一例である。比較部133は、判定部の一例である。HTMLデータは、画面の記述情報の一例である。
In the present embodiment, the
以上、本発明の実施例について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 Although the embodiments of the present invention have been described above in detail, the present invention is not limited to such specific embodiments, and various modifications may be made within the scope of the present invention as set forth in the claims.・ Change is possible.
10 クライアント装置
11 テストシナリオ生成部
12 画面自動操作部
13 画面評価部
14 テスト資材生成部
20 サーバ装置
100 ドライブ装置
101 記録媒体
102 補助記憶装置
103 メモリ装置
104 CPU
105 インタフェース装置
106 表示装置
107 入力装置
131 ノード削除部
132 ノード集約部
133 比較部
B バス
DESCRIPTION OF
105
Claims (3)
編集後の記述情報を比較して、前記第1の画面と前記第2の画面との同一性を判定する判定部と、
を有することを特徴とする画面判定装置。 Editing that consolidates screen elements having a parallel relationship into one for each of the description information of the first screen related to the Web application and the description information of the second screen related to the Web application that is the same as or different from the Web application The editorial department to
A determination unit that compares the edited description information and determines the identity between the first screen and the second screen;
A screen determination apparatus characterized by having:
編集後の記述情報を比較して、前記第1の画面と前記第2の画面との同一性を判定する判定手順と、 A determination procedure of comparing the edited description information to determine the identity between the first screen and the second screen;
をコンピュータが実行することを特徴とする画面判定方法。And a computer executes the screen determination method.
編集後の記述情報を比較して、前記第1の画面と前記第2の画面との同一性を判定する判定部と、
としてコンピュータを機能させることを特徴とするプログラム。 Editing that consolidates screen elements having a parallel relationship into one for each of the description information of the first screen related to the Web application and the description information of the second screen related to the Web application that is the same as or different from the Web application The editorial department to
A determination unit that compares the edited description information and determines the identity between the first screen and the second screen;
A program characterized by causing a computer to function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017006985A JP6535038B2 (en) | 2017-01-18 | 2017-01-18 | Screen determination apparatus, screen determination method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017006985A JP6535038B2 (en) | 2017-01-18 | 2017-01-18 | Screen determination apparatus, screen determination method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018116497A JP2018116497A (en) | 2018-07-26 |
JP6535038B2 true JP6535038B2 (en) | 2019-06-26 |
Family
ID=62983904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017006985A Active JP6535038B2 (en) | 2017-01-18 | 2017-01-18 | Screen determination apparatus, screen determination method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6535038B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7070328B2 (en) * | 2018-10-25 | 2022-05-18 | 日本電信電話株式会社 | Test data generator, test data generation method and program |
JP7127601B2 (en) * | 2019-04-10 | 2022-08-30 | 日本電信電話株式会社 | Similar Transition Identifying Device, Similar Transition Identifying Method, and Program |
WO2020225912A1 (en) * | 2019-05-09 | 2020-11-12 | 日本電信電話株式会社 | Test device, test method, and program |
WO2021090427A1 (en) * | 2019-11-07 | 2021-05-14 | 日本電信電話株式会社 | Operation pattern generation device, operation pattern generation method, and program |
JP7494558B2 (en) | 2020-05-15 | 2024-06-04 | コニカミノルタ株式会社 | Program for generating user interface operation patterns and operation pattern generating device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4846029B2 (en) * | 2010-02-05 | 2011-12-28 | 株式会社野村総合研究所 | Operation verification apparatus, operation verification method, and operation verification program |
JP6455010B2 (en) * | 2014-07-31 | 2019-01-23 | 日本電気株式会社 | Information processing apparatus, information processing method, and program |
JP2016224481A (en) * | 2015-05-26 | 2016-12-28 | 株式会社日立製作所 | Display screen test system |
JP6491959B2 (en) * | 2015-06-03 | 2019-03-27 | 新日鉄住金ソリューションズ株式会社 | Information processing apparatus, information processing method, and program |
-
2017
- 2017-01-18 JP JP2017006985A patent/JP6535038B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018116497A (en) | 2018-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6535038B2 (en) | Screen determination apparatus, screen determination method and program | |
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 | |
US20180101525A1 (en) | Information processing apparatus, document display method, document display system, and medium | |
US20130191814A1 (en) | Test scenario generation method, test scenario generation system, and test scenario generation program | |
US20100058118A1 (en) | Storage medium recording information reacquisition procedure generation program and information reacquisition procedure generation apparatus | |
US8839126B1 (en) | Secure HTML components for building client-side user interface | |
JP2008015709A (en) | Test support program, device, and method | |
JP6723976B2 (en) | Test execution device and program | |
US20220229767A1 (en) | Test script generation apparatus, test script generation method and program | |
CN111240967B (en) | Code generation method and device | |
US11481546B2 (en) | Screen discrimination apparatus, screen discrimination method and program | |
JP7318704B2 (en) | Test equipment, test method and program | |
JP5186880B2 (en) | File management system, file management method, and file management program | |
CN115495372A (en) | Analog data processing method, device, equipment and medium | |
Liu et al. | Testing of AJAX-based Web applications using hierarchical state model | |
JP7409104B2 (en) | Information processing device and program | |
JP2003280943A (en) | Support system for generating test data | |
KR20130022485A (en) | A method for providing web-page and a computer-readable recording medium recording program for implementing the method | |
WO2020088087A1 (en) | Method and device for testing application program interface (api) | |
JP2017162182A (en) | Test device, test method, and test program | |
JP7283569B2 (en) | Operation pattern generation device, operation pattern generation method and program | |
JP5476867B2 (en) | Mashup program, mashup device, and mashup method | |
JP6261244B2 (en) | WEB application test apparatus and program thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180727 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190328 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190402 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190510 |
|
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: 20190528 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190530 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6535038 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |