WO2022249421A1 - コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム - Google Patents

コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム Download PDF

Info

Publication number
WO2022249421A1
WO2022249421A1 PCT/JP2021/020309 JP2021020309W WO2022249421A1 WO 2022249421 A1 WO2022249421 A1 WO 2022249421A1 JP 2021020309 W JP2021020309 W JP 2021020309W WO 2022249421 A1 WO2022249421 A1 WO 2022249421A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
coverage
system under
under test
code implementation
Prior art date
Application number
PCT/JP2021/020309
Other languages
English (en)
French (fr)
Inventor
シュメール ウル
ジヴ グラスバーグ
ラン レアー
イレズ ケイナン
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to PCT/JP2021/020309 priority Critical patent/WO2022249421A1/ja
Publication of WO2022249421A1 publication Critical patent/WO2022249421A1/ja

Links

Images

Classifications

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

Definitions

  • the present invention relates to technology for detecting code implementation omissions in software development.
  • a method of testing software there is a method of determining whether the software is normal by giving input to the software, executing the software, and comparing the output (execution result) with the expected result.
  • the expected result is the result when the software executes correctly.
  • code implementation omissions are bugs that occur frequently, debugging operations can be reduced if code implementation omissions can be automatically detected.
  • the present invention has been made in view of the above points, and aims to provide a technique that enables automatic detection of code implementation omissions in software.
  • an acquisition unit that acquires execution results and coverage of tests executed by a system under test based on certain inputs and execution results and coverage of tests executed by a reference model based on the inputs; code implementation in the system under test by comparing the coverage of the test in the system under test with the coverage of the test in the reference model when the execution result of the test by the system under test is incorrect
  • a code implementation omission detection device comprising: a determination unit for determining whether or not there is omission.
  • FIG. 1 is a configuration diagram of a system according to an embodiment of the present invention
  • FIG. 1 is a configuration diagram of a code mounting omission detection device
  • FIG. It is a flow chart of processing. It is a figure which shows the example of a table.
  • FIG. 11 is a table for explaining an example of using two tests;
  • FIG. It is a figure which shows the hardware structural example of a code implementation omission detection apparatus.
  • the test method (setup) itself in this embodiment is a general method used for unit tests and the like. Specifically, first, the code of the software to be tested is created.
  • code when developing by combining multiple programming languages (mix & match), code may be created using a method of converting one language into the other.
  • a development technique may be used in which a code is created in a high-level language and then converted into a code in a low-level language (production code).
  • Input creation can be done manually or using an automated test generator.
  • the test inputs are then used to perform tests on the software under test. Note that "software” may also be called “system”.
  • both system A e.g., system under test
  • system B reference model
  • this system has a test execution device A, a test execution device B, and a code implementation omission detection device 100 .
  • the test execution device A and the test execution device B are each connected to the code implementation omission detection device 100 via a network.
  • the test execution device A, the test execution device B, and the code implementation omission detection device 100 are each computers capable of executing software (programs). Each of the test execution device A, the test execution device B, and the code implementation omission detection device 100 may be a physical machine or a virtual machine on the cloud.
  • test execution device A the test execution device A
  • test execution device B the test execution device B
  • code implementation omission detection device 100 this is only an example.
  • a single device that includes the functions of test execution device A, test execution device B, and code implementation omission detection device 100 may be used.
  • test execution device A and test execution device B execute software using test inputs and output execution results. "Executing software using test inputs” may also be referred to as “testing.”
  • test execution device A In either test execution device A or test execution device B, inputting and operating the software may be done manually, or may be done automatically by a script or the like.
  • test execution results (outputs) of the test execution device A and the test execution device B are input to the code implementation omission detection device 100 .
  • the output execution results can be any information, such as numerical values, screen images, tables saved in databases, execution logs, and so on.
  • the code implementation omission detection device 100 compares the output from the test execution device A and the output from the test execution device B, judges whether the execution result of the system under test is correct or not, and acquires the coverage of the executed test. , based on these, the presence or absence of code implementation omissions in the system under test is determined.
  • FIG. 2 shows a configuration example of the code implementation omission detection device 100 .
  • the code implementation omission detection device 100 includes an input unit 110 , a correctness determination unit 120 , a coverage acquisition unit 130 , a determination unit 140 , an output unit 150 and a storage unit 160 .
  • the function of acquiring execution results and coverage executed by the input unit 110, the correctness determination unit 120, the coverage acquisition unit 130, etc. may be called an “acquisition unit”. Also, the function of making judgments executed by the correctness judgment section 120 and the judgment section 140 may be called a “judgment section.”
  • test execution device A tests the system under test (software), and the test execution device B tests the reference model.
  • a reference model is a system that is known to behave correctly (output the correct output). By comparing the output of the system under test with the output of the reference model, the correctness of the output of the system under test can be determined. can do.
  • the reference model is software that operates stably before the upgrade
  • the test system is the upgraded software that has the same functions as the reference model. Testing for such cases is also called regression testing.
  • test execution device B that executes the reference model is a terminal of a certain model that performs stable operation, and software modified from the reference model is tested for the test execution device A that is a terminal of a different model than the terminal. In some cases, it is the target system.
  • code before and after conversion when developing by mix & match may be used as a reference model and a system to be tested, respectively.
  • test execution device A and the test execution device B may execute the system under test.
  • test input may be, for example, a numerical value to be entered into the system, or an input procedure to the system (pressing button A, entering value B, clicking OK, etc.) It can be anything else.
  • Inputs for testing can be created manually or automatically.
  • test inputs created in S1 are given to the test target system of test execution device A and the reference model of test execution device B, respectively.
  • test inputs created in S1 are stored in the storage unit 160 of the code implementation omission detection device 100 together with identification information such as "test 1, test 2, ".
  • identification information such as "test 1, test 2, ".
  • S2 to S7 are executed for each of various inputs.
  • the storage unit 160 stores information necessary for performing the processing described below.
  • test execution device A executes the system under test based on the given input.
  • the execution result (output) is input to the input unit 110 of the code implementation omission detection device 100 .
  • test execution device B executes the reference model based on the given input.
  • the execution result (output) is input to the input unit 110 of the code implementation omission detection device 100 .
  • the correct/wrong judging section 120 (which may also be called a "comparing section") of the code implementation omission detection device 100 compares the output of the system under test and the output of the reference model. Although it is assumed here that the comparison is performed automatically, the comparison and the correct/wrong determination in S5 below may be performed manually.
  • the correctness determination unit 120 determines whether the output of the system under test and the output of the reference model are correct based on the comparison result.
  • the assumption here is that the output of the reference model is correct, so if the output of the system under test and the output of the reference model do not match, the output of the system under test is wrong, and if they match, the test Judge that the output of the target system is correct.
  • the output of the reference model is not necessarily correct (that is, when the reference model is another system under test), for example, if the output of the system under test and the output of the reference model match, both are correct, If they do not match, it may be determined that it is more correct to match with an expected result prepared separately.
  • the coverage acquisition unit 130 acquires coverage for the tests executed on the system under test.
  • Coverage is, for example, information indicating which lines of the system (software) were executed (covered) in execution of the test. For example, out of 200 lines, if lines 1 to 4 and lines 89 to 108 are covered, "lines 1 to 4, lines 89 to 108" are coverage information becomes.
  • the coverage information may be obtained by actual measurement using a tool or the like in the test execution device A, or may be prepared in advance for each test.
  • the coverage acquisition unit 130 also acquires coverage for tests executed on the reference model.
  • the correct/wrong judgment result by the correct/wrong judgment section 120 is recorded in the storage section 160 in association with the corresponding test. Also, coverage information obtained by the coverage acquisition unit 130 is recorded in the storage unit 160 in association with the corresponding test.
  • FIG. 4 shows an example of a table stored in the storage unit 160 for the system under test. As shown in FIG. 4, for each test, coverage and correctness of output are recorded. A similar table is recorded for the reference model. However, here, it is assumed that all execution results in the reference model are correct.
  • the determination unit 140 groups the tests in the system under test by tests having the same coverage. For example, in the example of FIG. 4, if test 1 and test 2 have the same coverage (coverage 1) and test 3 and test 4 have the same coverage (coverage 2 different from coverage 1), test 1 and test 2 are It will be in one group, and Test 3 and Test 4 will be in another group.
  • the determination unit 140 extracts groups including tests with correct execution results and tests with incorrect execution results from among the plurality of groups divided in S8.
  • the determination unit 140 divides the test groups included in the groups extracted in S9 into test groups with correct execution results and test groups with incorrect execution results. For example, if the test groups (test groups with the same coverage) included in the group are tests 6, 7, 8, and 9, the execution results of tests 6 and 7 are correct, and the execution results of tests 8 and 9 are incorrect. Then, it is divided into "tests 6 and 7" and "tests 8 and 9".
  • the determination unit 140 determines the coverage of the reference model for each test in the test group divided in S10 for which the execution result is false for each group extracted in S9 (for each same coverage group in the system under test). Confirm.
  • the determination unit 140 determines whether or not the coverage of a test whose execution result is incorrect in a certain coverage group differs from the coverage of the test (execution result is correct) in the reference model in the system under test, If they are different, it is determined that the system under test contains code that has not been implemented.
  • the determination unit 140 determines that the code related to test 9 is not implemented in the system under test.
  • the difference between the coverage of the reference model that outputs correct output for Test 9 and the coverage of the system under test that outputs incorrect output for Test 9 means that there is a code implementation omission in the system under test. Since it can be estimated that the output is erroneous, the above judgment can be made.
  • code implementation omission includes not only missing code, but also incorrect operation due to additional code being written. Either of these cases can be detected by the coverage comparison described above.
  • the output unit 150 notifies, for example, the team that developed the system under test that there is a code implementation omission regarding a certain test.
  • the output unit 150 determines that there is an implementation omission code in the code in the coverage of test 9 in the reference model. , with the code in the coverage of test 9 in the reference model.
  • FIG. 5 shows an example of determination (output example of determination results) executed by the code implementation omission detection device 100 when two tests are performed on each of the system under test A and the system under test B.
  • FIG. 5 shows an example of determination (output example of determination results) executed by the code implementation omission detection device 100 when two tests are performed on each of the system under test A and the system under test B.
  • System under test A and system under test B are software with the same functions, for example, software created for different devices. Assume that whether or not the output for each test is correct can be determined from the expected results prepared in advance.
  • system under test A and system B under test are referred to as “system A” and “system B”, respectively.
  • “Match” means that the execution results of the system under test A and the system under test B match, and here, the execution results of both are assumed to be correct. Each line in FIG. 5 will be described.
  • the code implementation omission detection device 100 can be implemented by, for example, causing a computer to execute a program.
  • This computer may be a physical computer or a virtual machine on the cloud.
  • the code implementation omission detection device 100 is realized by executing a program corresponding to the processing performed by the code implementation omission detection device 100 using hardware resources such as a CPU and memory built into the computer. is possible.
  • the above program can be recorded in a computer-readable recording medium (portable memory, etc.), saved, or distributed. It is also possible to provide the above program through a network such as the Internet or e-mail.
  • FIG. 6 is a diagram showing a hardware configuration example of the computer.
  • the computer of FIG. 6 has a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, etc., which are interconnected by a bus BS.
  • a program that implements the processing in the computer is provided by a recording medium 1001 such as a CD-ROM or memory card, for example.
  • a recording medium 1001 such as a CD-ROM or memory card
  • the program is installed from the recording medium 1001 to the auxiliary storage device 1002 via the drive device 1000 .
  • the program does not necessarily need to be installed from the recording medium 1001, and may be downloaded from another computer via the network.
  • the auxiliary storage device 1002 stores installed programs, as well as necessary files and data.
  • the memory device 1003 reads and stores the program from the auxiliary storage device 1002 when a program activation instruction is received.
  • the CPU 1004 implements functions related to the code implementation omission detection device 100 according to the programs stored in the memory device 1003 .
  • the interface device 1005 is used as an interface for connecting to a network or the like.
  • a display device 1006 displays a GUI (Graphical User Interface) or the like by a program.
  • An input device 1007 is composed of a keyboard, a mouse, buttons, a touch panel, or the like, and is used to input various operational instructions.
  • the output device 1008 outputs the calculation result.
  • the technology according to the present embodiment makes it possible to automatically detect code implementation omissions in software.
  • This specification discloses at least a code implementation omission detection device, a code implementation omission detection method, and a program according to the following items.
  • (Section 1) an acquisition unit that acquires execution results and coverage of a test executed by a system under test based on an input, and execution results and coverage of a test executed by a reference model based on the input; code implementation in the system under test by comparing the coverage of the test in the system under test with the coverage of the test in the reference model when the execution result of the test by the system under test is incorrect
  • a cord mounting omission detection device comprising: a determination unit for determining whether or not there is omission.
  • the determination unit compares the execution result of the test by the system under test with the result of execution of the test by the reference model, and if the two do not match, the result of execution of the test by the system under test is 2.
  • the determination unit 3 When the execution result of the test by the system under test is erroneous and the coverage of the test in the system under test is different from the coverage of the test in the reference model, the determination unit 3.
  • the code implementation omission detection device according to claim 1 or 2 which determines that there is a code implementation omission in the system.
  • the determination unit determines that code in the coverage of the test in the reference model includes code of implementation omission in the system under test.
  • the code mounting omission detection device according to any one of items 1 to 3.
  • a computer implemented code implementation omission detection method comprising: obtaining execution results and coverage of tests executed by a system under test based on certain inputs and execution results and coverage of tests executed by a reference model based on the inputs; code implementation in the system under test by comparing the coverage of the test in the system under test with the coverage of the test in the reference model when the execution result of the test by the system under test is incorrect
  • a code implementation omission detection method comprising: determining whether there is an omission.
  • (Section 6) A program for causing a computer to function as each unit in the code implementation omission detection device according to any one of items 1 to 4.
  • A, B Test execution device 100 Code implementation omission detection device 110 Input unit 120 Correctness judgment unit 130 Coverage acquisition unit 140 Judgment unit 150 Output unit 160 Storage unit 1000 Drive device 1001 Recording medium 1002 Auxiliary storage device 1003 Memory device 1004 CPU 1005 interface device 1006 display device 1007 input device

Landscapes

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

Abstract

ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得する取得部と、前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定する判定部とを備えるコード実装漏れ検出装置。

Description

コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム
 本発明は、ソフトウェア開発におけるコードの実装漏れを検出する技術に関連するものである。
 ソフトウェアのテストを行う方法として、ソフトウェアに入力を与えて当該ソフトウェアを実行し、その出力(実行結果)と期待結果とを比較することで、ソフトウェアが正常か否かを判定する方法がある。期待結果とは、ソフトウェアが正しく実行されたときの結果である。
 実行結果が期待結果と異なる場合には、ソフトウェアをデバッグする必要がある。デバッグは、多くの専門知識を必要とする時間のかかるプロセスである。
「テスト自動化の基本的な考え方とNTTにおける研究開発の紹介」,第25回SPIトワイライトフォーラム,2019/3/26 http://www.jaspic.org/wordpress/wp-content/uploads/JASPIC_SPI-TwilightForum_20190326.pdf
 デバッグにおいてはバグを見つけることに多大な稼働がかかるため、ソフトウェアにおいて何が悪いのかを自動的に検出できることが望ましい。
 特に、コード実装漏れは頻繁に生じるバグであることから、コード実装漏れを自動的に検出できれば、デバッグの稼働を削減できる。
 本発明は上記の点に鑑みてなされたものであり、ソフトウェアにおけるコード実装漏れを自動的に検出することを可能とする技術を提供することを目的とする。
 開示の技術によれば、ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得する取得部と、
 前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定する判定部と
 を備えるコード実装漏れ検出装置が提供される。
 開示の技術によれば、ソフトウェアにおけるコード実装漏れを自動的に検出することが可能となる。
本発明の実施の形態におけるシステムの構成図である。 コード実装漏れ検出装置の構成図である。 処理のフローチャートである。 テーブルの例を示す図である。 2つのテストを用いた場合の例を説明するための表である。 コード実装漏れ検出装置のハードウェア構成例を示す図である。
 以下、図面を参照して本発明の実施の形態(本実施の形態)を説明する。以下で説明する実施の形態は一例に過ぎず、本発明が適用される実施の形態は、以下の実施の形態に限られるわけではない。
 (実施の形態の概要)
 本実施の形態におけるテストの方式(セットアップ)自体は、単体テスト等に使用される一般的な方式である。具体的には、まず、テスト対象となるソフトウェアのコードの作成を行う。
 なお、ソフトウェア開発において、複数のプログラミング言語を組み合わせて(ミックス&マッチ)で開発する際に、一方の言語を他方の言語に変換させる方法を用いてコードを作成してもよい。例えば、コードを高級言語で作成した後に、当該コードを低級言語のコード(プロダクションコード)に変換する開発手法を用いてもよい。
 次に、テストの入力を作成する。入力の作成は手動で行ってもよいし、自動テストジェネレータを使用して行ってもよい。続いて、テストの入力を用いてテスト対象のソフトウェアに対するテストを実施する。なお、「ソフトウェア」を「システム」と呼んでもよい。
 後述するように、本実施の形態では、様々なテスト入力を用いて、システムA(例:テスト対象システム)と、システムB(参照モデル)との両方を実行し、両者の出力、及び、使用した入力によるテストのカバレッジに基づいてコードの実装漏れを検出することとしている。以下、本実施の形態をより詳細に説明する。
 (システム構成例)
 以下、図1に本実施の形態におけるシステム構成例を説明する。図1に示すとおり、本システムは、テスト実行装置A、テスト実行装置B、及びコード実装漏れ検出装置100を有する。テスト実行装置Aとテスト実行装置Bはそれぞれコード実装漏れ検出装置100にネットワークを介して接続されている。
 テスト実行装置A、テスト実行装置B、及びコード実装漏れ検出装置100はそれぞれソフトウェア(プログラム)を実行可能なコンピュータである。テスト実行装置A、テスト実行装置B、及びコード実装漏れ検出装置100はそれぞれ物理的なマシンであってもよいし、クラウド上の仮想マシンでもよい。
 なお、本実施の形態では、テスト実行装置A、テスト実行装置B、及びコード実装漏れ検出装置100として3台の装置を使用しているが、これは一例に過ぎない。例えば、テスト実行装置A、テスト実行装置B、及びコード実装漏れ検出装置100の機能を含む1台の装置が使用されてもよい。
 テスト実行装置A、テスト実行装置Bはいずれも、テスト用の入力を用いてソフトウェアを実行し、実行結果を出力する。「テスト用の入力を用いてソフトウェアを実行する」ことを「テスト」と呼んでもよい。
 テスト実行装置A、テスト実行装置Bのいずれにおいても、入力を行ってソフトウェアを動作させることを手動で行ってもよいし、スクリプト等により自動的に行ってもよい。
 テスト実行装置Aとテスト実行装置Bのそれぞれのテストの実行結果(出力)は、コード実装漏れ検出装置100に入力される。
 出力される実行結果は、例えば、数値、画面の画像、データベースに保存されたテーブル、実行ログなど、どのような情報であってもよい。
 コード実装漏れ検出装置100は、テスト実行装置Aからの出力とテスト実行装置Bからの出力とを比較して、テスト対象システムの実行結果の正誤を判断するとともに、実行したテストのカバレッジを取得し、これらに基づいて、テスト対象システムにおけるコード実装漏れの有無を判断する。
 (コード実装漏れ検出装置の構成例、動作例)
 図2に、コード実装漏れ検出装置100の構成例を示す。図2に示すように、コード実装漏れ検出装置100は、入力部110、正誤判定部120、カバレッジ取得部130、判定部140、出力部150、及び記憶部160を備える。
 なお、入力部110、正誤判定部120、カバレッジ取得部130などにより実行される、実行結果とカバレッジを取得する機能を「取得部」と呼んでもよい。また、正誤判定部120と判定部140により実行される判定を行う機能を「判定部」と呼んでもよい。
 コード実装漏れ検出装置100を含むシステムの動作例について、図3のフローチャートを参照して説明する。
 以下の説明では、一例として、テスト実行装置Aでは、テスト対象システム(ソフトウェア)のテストを実行し、テスト実行装置Bでは参照モデルのテストを実行することを想定している。
 参照モデルとは、正しい動作をする(正しい出力をする)ことがわかっているシステムであり、テスト対象システムの出力と参照モデルの出力とを比較することで、テスト対象システムの出力の正誤を判定することができる。
 一例として、参照モデルはバージョンアップ前の安定した動作を行うソフトウェアであり、テスト対象システムは、参照モデルと同じ機能を有するソフトウェアをバージョンアップしたものである。このようなケースのテストは回帰テストとも呼ばれる。
 また、参照モデルを実行させるテスト実行装置Bが、安定した動作を行うある機種の端末であり、当該端末とは異なる機種の端末であるテスト実行装置A用に、参照モデルを改造したソフトウェアがテスト対象システムであるケースもある。また、ミックス&マッチで開発する際の変換前後のコードをそれぞれ参照モデル、テスト対象システムとしてもよい。
 なお、上記は例であり、参照モデルが必ずしも正しい結果を出力するとは限らないこととしてもよい。つまり、テスト実行装置Aとテスト実行装置Bのいずれにおいてもテスト対象システムを実行することとしてもよい。
 以下の例において、テスト対象システム及び参照モデルは既に作成されており、テスト可能なように、テスト実行装置A、Bにインストールされているものとする。
  <S1(ステップ1)>
 S1において、テスト用の入力を作成する。テスト用の入力とは、例えば、システムに入力する数値であってもよいし、システムへの入力手順(ボタンA押下、値Bを入力、OKをクリック、等のような手順)であってもよいし、その他のものであってもよい。テスト用の入力は、手動で作成してもよいし、自動で作成してもよい。
 S1で作成したテスト用の入力は、テスト実行装置Aのテスト対象システムとテスト実行装置Bの参照モデルのそれぞれに与えられる。
 また、S1で作成したテスト用の入力は、例えば、「テスト1、テスト2、...」のような識別情報とともに、コード実装漏れ検出装置100の記憶部160に格納される。なお、種々の入力のそれぞれに対して、下記のS2~S7の実行がなされる。また、記憶部160には、以下で説明する処理を行うために必要な情報が格納されている。
  <S2>
 S2において、テスト実行装置Aは、与えられた入力に基づきテスト対象システムを実行する。実行結果(出力)は、コード実装漏れ検出装置100の入力部110に入力される。
  <S3>
 S3において、テスト実行装置Bは、与えられた入力に基づき参照モデルを実行する。実行結果(出力)は、コード実装漏れ検出装置100の入力部110に入力される。
  <S4>
 S4において、コード実装漏れ検出装置100の正誤判定部120("比較部"と呼んでもよい)は、テスト対象システムの出力と参照モデルの出力とを比較する。なお、ここでは比較を自動で行うことを想定しているが、比較と下記のS5の正誤判定を人手で行うこととしてもよい。
  <S5>
 S5において、正誤判定部120は、比較結果に基づいて、テスト対象システムの出力と参照モデルの出力の正誤を判定する。ここでの想定では、参照モデルの出力は正しいものであるとしているので、テスト対象システムの出力と参照モデルの出力とが一致しなければ、テスト対象システムの出力に誤りがあり、一致すればテスト対象システムの出力は正しいと判断する。
 また、参照モデルの出力が必ずしも正しくない場合(つまり、参照モデルが別のテスト対象システムである場合)においては、例えば、テスト対象システムの出力と参照モデルの出力とが一致すれば両方正しいとし、一致しなければ、別に用意した期待結果と一致するほうが正しいと判定することとしてもよい。
  <S6>
 S6において、カバレッジ取得部130は、テスト対象システムに対して実行されたテストについてのカバレッジを取得する。カバレッジは、例えば、当該テストの実行において、システム(ソフトウェア)のうちのどの行を実行したか(カバーしたか)を示す情報である。例えば、200行のうち、第1行~第4行、第89行~第108行をカバーするのであれば、「第1行~第4行、第89行~第108行」がカバレッジの情報となる。
 カバレッジの情報は、テスト実行装置Aにおけるツール等により実測することで取得してもよいし、テスト毎に予め用意しておいてもよい。
 同様に、カバレッジ取得部130は、参照モデルに対して実行されたテストについてのカバレッジも取得する。
  <S7>
 正誤判定部120による正誤判定結果は、該当のテストに対応付けて記憶部160に記録される。また、カバレッジ取得部130によるカバレッジの情報は、該当のテストに対応付けて記憶部160に記録される。
 図4に、テスト対象システムについて、記憶部160に格納されたテーブルの例を示す。図4に示すとおり、テスト毎に、カバレッジと出力の正誤が記録されている。参照モデルについても同様のテーブルが記録される。ただし、ここでは、参照モデルにおける実行結果は全て正しいものとなると想定している。
  <S8>
 S8において、判定部140は、記憶部160に格納された情報に基づいて、テスト対象システムにおけるテストを、同一カバレッジを持つテスト毎にグループ分けする。例えば、図4の例において、テスト1とテスト2のカバレッジ(カバレッジ1)が同じで、テスト3とテスト4のカバレッジ(カバレッジ1と異なるカバレッジ2)が同じである場合、テスト1とテスト2があるグループになり、テスト3とテスト4は別のグループになる。
  <S9>
 S9において、判定部140は、S8においてグループ分けした複数のグループの中から、実行結果が正しいテストと実行結果が誤っているテストを含むグループを抽出する。
  <S10>
 S10において、判定部140は、S9で抽出したグループに含まれるテスト群を、実行結果が正しいテスト群と実行結果が誤っているテスト群に分ける。例えば、当該グループに含まれるテスト群(カバレッジが同じテスト群)がテスト6、7、8、9であるとして、テスト6、7が実行結果=正、テスト8、9が実行結果=誤であるとすると、「テスト6、7」と「テスト8、9」に分けられる。
  <S11>
 S11において、判定部140は、S9で抽出したグループ毎(テスト対象システムでの同一カバレッジグループ毎)に、S10で分割した実行結果=誤であるテスト群における各テストについて、参照モデルでのカバレッジを確認する。
 判定部140は、テスト対象システムにおいて、あるカバレッジのグループにおける実行結果=誤であるテストの当該カバレッジと、参照モデルにおける当該テスト(実行結果は正しい)のカバレッジが異なっているか否かを判断し、異なっている場合には、テスト対象システムに実装漏れのコードがあると判断する。
 例えば、テスト対象システムにおいて、「カバレッジ2」である「テスト8、9」の実行結果が誤りである場合において、テスト8に対する参照モデルのカバレッジが「カバレッジ2」であり、テスト9に対する参照モデルのカバレッジが「カバレッジ3」であるとすると、判定部140は、テスト対象システムにおいて、テスト9に関連するコードの実装漏れがあると判断する。
 つまり、テスト9に対して正しい出力を行う参照モデルにおけるカバレッジと、テスト9に対して誤った出力を行うテスト対象システムのカバレッジが異なるということは、テスト対象システムにおいて、コード実装漏れがあり、そのために出力が誤っていると推定できるため、上記のような判断を行うことができる。
 なお、「コード実装漏れ」とは、コードが欠落している場合の他、余計なコードが追加で記載されることで、誤った動作を実行してしまうことを含む。これらいずれの場合でも、上述したカバレッジ比較で検出可能である。
  <S12>
 S12において、出力部150は、例えば、テスト対象システムを開発したチームに、あるテストに関してコード実装漏れがあることを通知する。
 例えば、出力部150(判定部140でもよい)は、テスト9に関してコード実装漏れがあることを検知した場合、参照モデルにおけるテスト9のカバレッジにあるコードの中に、実装漏れコードがあると判断し、参照モデルにおけるテスト9のカバレッジにあるコードとともに上記通知を行ってもよい。
 以上、S1~S12を説明した。なお、上記のようにグループ分けして処理を進めることは一例である。あるテストに対して、参照モデルとテスト対象システムとで実行結果が異なる場合に、当該テストに対するこれらのカバレッジを比較できるような方法であればどのような処理方法を用いてもよい。
 (テスト対象システムA,Bを使用する例)
 前述したように、参照モデルが、別のテスト対象システムであってもよい。図5は、テスト対象システムAとテスト対象システムBのそれぞれに対して、2つのテストを実行した場合における、コード実装漏れ検出装置100が実行する判断の例(判断結果の出力例)を示す。
 テスト対象システムAとテスト対象システムBは、同一機能を持つソフトウェアであり、例えば、異なる機器用に作成されたソフトウェアである。各テストに対する出力が正しいかどうかは、予め用意した期待結果から判断可能であるとする。
 以下の説明と図5において、テスト対象システムAとテスト対象システムBをそれぞれ「システムA」、「システムB」と記載する。また、「一致」は、テスト対象システムAとテスト対象システムBの実行結果が一致することであり、ここでは、両方とも実行結果が正しいとする。図5の行毎に説明する。
 システムA、Bそれぞれで両テストが同一カバレッジであり、かつ、あるテストで一致、別のテストでシステムAが正である場合、システムBにおいてカバーされるコードに誤ったコードがあると判断する。
 システムA、Bそれぞれで両テストが同一カバレッジであり、かつ、あるテストで一致、別のテストでシステムBが正である場合、システムAおいてカバーされるコードに誤ったコードがあると判断する。
 システムAで両テストが同一カバレッジであり、システムBは同一カバレッジでなく、かつ、あるテストで一致、別のテストでシステムAが正である場合、システムBにおける条件にバグがある可能性ありと判断する。
 システムAで両テストが同一カバレッジであり、システムBは同一カバレッジでなく、かつ、あるテストで一致、別のテストでシステムBが正である場合、システムAで誤ったテストに対してコード実装漏れの可能性ありと判断する。
 システムBで両テストが同一カバレッジであり、システムAは同一カバレッジでなく、かつ、あるテストで一致、別のテストでシステムAが正である場合、システムBで誤ったテストに対してコード実装漏れの可能性ありと判断する。
 システムBで両テストが同一カバレッジであり、システムAは同一カバレッジでなく、かつ、あるテストで一致、別のテストでシステムBが正である場合、システムAにおける条件にバグがある可能性ありと判断する。
  (ハードウェア構成例)
 コード実装漏れ検出装置100は、例えば、コンピュータにプログラムを実行させることにより実現できる。このコンピュータは、物理的なコンピュータであってもよいし、クラウド上の仮想マシンであってもよい。
 すなわち、コード実装漏れ検出装置100は、コンピュータに内蔵されるCPUやメモリ等のハードウェア資源を用いて、コード実装漏れ検出装置100で実施される処理に対応するプログラムを実行することによって実現することが可能である。上記プログラムは、コンピュータが読み取り可能な記録媒体(可搬メモリ等)に記録して、保存したり、配布したりすることが可能である。また、上記プログラムをインターネットや電子メール等、ネットワークを通して提供することも可能である。
 図6は、上記コンピュータのハードウェア構成例を示す図である。図6のコンピュータは、それぞれバスBSで相互に接続されているドライブ装置1000、補助記憶装置1002、メモリ装置1003、CPU1004、インタフェース装置1005、表示装置1006、入力装置1007、出力装置1008等を有する。
 当該コンピュータでの処理を実現するプログラムは、例えば、CD-ROM又はメモリカード等の記録媒体1001によって提供される。プログラムを記憶した記録媒体1001がドライブ装置1000にセットされると、プログラムが記録媒体1001からドライブ装置1000を介して補助記憶装置1002にインストールされる。但し、プログラムのインストールは必ずしも記録媒体1001より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置1002は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。
 メモリ装置1003は、プログラムの起動指示があった場合に、補助記憶装置1002からプログラムを読み出して格納する。CPU1004は、メモリ装置1003に格納されたプログラムに従って、コード実装漏れ検出装置100に係る機能を実現する。インタフェース装置1005は、ネットワーク等に接続するためのインタフェースとして用いられる。表示装置1006はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置1007はキーボード及びマウス、ボタン、又はタッチパネル等で構成され、様々な操作指示を入力させるために用いられる。出力装置1008は演算結果を出力する。
 (実施の形態の効果)
 以上説明したとおり、本実施の形態に係る技術により、ソフトウェアにおけるコード実装漏れを自動的に検出することが可能となる。
 また、コード実装漏れの有無のみでなく、欠落したコードも検出して、それをコメント等により通知することができる。
 (実施の形態のまとめ)
 本明細書には、少なくとも下記各項のコード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラムが開示されている。
(第1項)
 ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得する取得部と、
 前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定する判定部と
 を備えるコード実装漏れ検出装置。
(第2項)
 前記判定部は、前記テスト対象システムによる前記テストの実行結果と、前記参照モデルによる前記テストの実行結果とを比較し、両者が不一致である場合に、前記テスト対象システムによる前記テストの実行結果が誤りであると判定する
 第1項に記載のコード実装漏れ検出装置。
(第3項)
 前記判定部は、前記テスト対象システムによる前記テストの実行結果が誤りであり、かつ、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとが異なる場合に、前記テスト対象システムにおいてコード実装漏れがあると判定する
 第1項又は第2項に記載のコード実装漏れ検出装置。
(第4項)
 前記判定部は、前記テスト対象システムにおいてコード実装漏れがあると判定する場合において、前記参照モデルにおける前記テストのカバレッジにおけるコードの中に、前記テスト対象システムにおける実装漏れのコードがあると判断する
 第1項ないし第3項のうちいずれか1項に記載のコード実装漏れ検出装置。
(第5項)
 コンピュータが実行するコード実装漏れ検出方法であって、
 ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得するステップと、
 前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定するステップと
 を備えるコード実装漏れ検出方法。
(第6項)
 コンピュータを、第1項ないし第4項のうちいずれか1項に記載のコード実装漏れ検出装置における各部として機能させるためのプログラム。
 以上、本実施の形態について説明したが、本発明はかかる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。
A、B テスト実行装置
100 コード実装漏れ検出装置
110 入力部
120 正誤判定部
130 カバレッジ取得部
140 判定部
150 出力部
160 記憶部
1000 ドライブ装置
1001 記録媒体
1002 補助記憶装置
1003 メモリ装置
1004 CPU
1005 インタフェース装置
1006 表示装置
1007 入力装置

Claims (6)

  1.  ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得する取得部と、
     前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定する判定部と
     を備えるコード実装漏れ検出装置。
  2.  前記判定部は、前記テスト対象システムによる前記テストの実行結果と、前記参照モデルによる前記テストの実行結果とを比較し、両者が不一致である場合に、前記テスト対象システムによる前記テストの実行結果が誤りであると判定する
     請求項1に記載のコード実装漏れ検出装置。
  3.  前記判定部は、前記テスト対象システムによる前記テストの実行結果が誤りであり、かつ、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとが異なる場合に、前記テスト対象システムにおいてコード実装漏れがあると判定する
     請求項1又は2に記載のコード実装漏れ検出装置。
  4.  前記判定部は、前記テスト対象システムにおいてコード実装漏れがあると判定する場合において、前記参照モデルにおける前記テストのカバレッジにおけるコードの中に、前記テスト対象システムにおける実装漏れのコードがあると判断する
     請求項1ないし3のうちいずれか1項に記載のコード実装漏れ検出装置。
  5.  コンピュータが実行するコード実装漏れ検出方法であって、
     ある入力に基づきテスト対象システムにより実行されたテストの実行結果とカバレッジ、及び、前記入力に基づき参照モデルにより実行されたテストの実行結果とカバレッジを取得するステップと、
     前記テスト対象システムによる前記テストの実行結果が誤りである場合に、前記テスト対象システムにおける前記テストのカバレッジと、前記参照モデルにおける前記テストのカバレッジとを比較することにより、前記テスト対象システムにおいてコード実装漏れがあるか否かを判定するステップと
     を備えるコード実装漏れ検出方法。
  6.  コンピュータを、請求項1ないし4のうちいずれか1項に記載のコード実装漏れ検出装置における各部として機能させるためのプログラム。
PCT/JP2021/020309 2021-05-27 2021-05-27 コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム WO2022249421A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/020309 WO2022249421A1 (ja) 2021-05-27 2021-05-27 コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/020309 WO2022249421A1 (ja) 2021-05-27 2021-05-27 コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム

Publications (1)

Publication Number Publication Date
WO2022249421A1 true WO2022249421A1 (ja) 2022-12-01

Family

ID=84228500

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/020309 WO2022249421A1 (ja) 2021-05-27 2021-05-27 コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム

Country Status (1)

Country Link
WO (1) WO2022249421A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080256393A1 (en) * 2007-04-16 2008-10-16 Shmuel Ur Detecting unexpected impact of software changes using coverage analysis
JP2009163636A (ja) * 2008-01-09 2009-07-23 Toyota Motor Corp 一致性検査方法、一致性検査装置およびプログラム

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080256393A1 (en) * 2007-04-16 2008-10-16 Shmuel Ur Detecting unexpected impact of software changes using coverage analysis
JP2009163636A (ja) * 2008-01-09 2009-07-23 Toyota Motor Corp 一致性検査方法、一致性検査装置およびプログラム

Similar Documents

Publication Publication Date Title
US8898647B2 (en) Method and apparatus for test coverage analysis
WO2016177124A1 (zh) 一种实现持续集成测试的方法及装置
US20040078784A1 (en) Collection and detection of differences of values of expressions/variables when debugging a computer process
US20150089297A1 (en) Using Crowd Experiences for Software Problem Determination and Resolution
US20140165040A1 (en) Test script generation for application image validation
US9594670B2 (en) Managing software dependencies during software testing and debugging
US9645911B2 (en) System and method for debugging firmware/software by generating trace data
US7624304B2 (en) Defect detection for integers
US20140229923A1 (en) Commit sensitive tests
CN112911283B (zh) 智能电视测试方法及装置
CN113918465A (zh) 兼容性测试方法、装置、电子设备及可读存储介质
KR20140088963A (ko) 애플리케이션 개발을 위한 런타임 에러 테스팅 시스템 및 방법
US20220214963A1 (en) Analysis apparatus, analysis method and program
CN113742215A (zh) 一种自动配置和调用测试工具进行测试分析的方法及系统
WO2022249421A1 (ja) コード実装漏れ検出装置、コード実装漏れ検出方法、及びプログラム
US9710360B2 (en) Optimizing error parsing in an integrated development environment
US20070168978A1 (en) Computer program code debugging method and system
CN108885574B (zh) 用于监视和报告设计、编译和运行时的性能和正确性问题的系统
CN113051582B (zh) 一种计算机软件技术开发调试系统
Al-Ashwal et al. A CASE tool for JAVA programs logical errors detection: Static and dynamic testing
JP2014126900A (ja) プログラム解析装置、プログラム解析方法、及び、プログラム解析プログラム
WO2022249420A1 (ja) テスト生成装置、テスト生成方法、及びプログラム
JPH11224211A (ja) ソフトウェア検査支援装置
CN114327648B (zh) 一种驱动调试方法、装置、电子设备及存储介质
Huang GUI Component Detection for Cross-Platform Applications–Using Input Device and Image Change Synergistic Detection Method

Legal Events

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

Ref document number: 21943067

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18561935

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21943067

Country of ref document: EP

Kind code of ref document: A1