Software testing device and software testing method
The software testing device and method address the challenge of lacking historical data by using timestamp correction and virtual date/time settings to perform efficient and realistic software testing without data generation, enhancing testing efficiency and reducing developer effort.
Patent Information
- Application Number
- PCT/JP2024/007880
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2025-09-04
AI Technical Summary
Existing software testing methods for IoT systems face challenges when there is a lack of historical data, requiring the generation of test data in advance, which is time-consuming and inefficient.
A software testing device and method that utilizes a clock unit, receiving unit, virtual date and time setting unit, and data correction unit to set and correct timestamps without modifying the software, enabling testing with virtual dates and times, and optionally includes a timekeeping control unit to accelerate testing by adjusting clock speed.
Enables efficient software testing without generating test data, reduces preparation time, and allows for realistic testing scenarios, thereby improving testing efficiency and reducing developer effort.
Smart Images

Figure JP2024007880_04092025_PF_FP_ABST
Abstract
Description
Software testing device and software testing method
[0001] The present disclosure relates to a software testing device and a software testing method.
[0002] Systems known as IoT systems collect and store operational data from machines and other devices via networks. These systems are powered by application software that analyzes the collected data daily and provides it to users. The development of such application software requires testing to ensure that the software operates normally over an extended period of time. The quality of application software can be improved by implementing test cases that are more realistic within a limited time frame.
[0003] For example, Patent Document 1 discloses a technology for improving the efficiency of testing by executing application software at double the speed. A virtual time is set for running the application software so that the operation times of the test data and the application software are synchronized. By advancing the virtual time faster than real time, it is possible to process test data faster than real time.
[0004] Japanese Patent Application Laid-Open No. 2018-159985
[0005] The technology described in Patent Document 1 is effective when past data that can be used as test data has been accumulated. However, when the IoT system itself is newly developed or has only recently been put into operation, there is a lack of data available for testing. If an attempt is made to test yearly or monthly processing with only a small amount of test data on hand, the test data must be padded in advance.
[0006] Therefore, an object of the present disclosure is to provide a software testing device and a software testing method that can perform software testing without modifying the software to be tested and without requiring the effort of generating test data.
[0007] The software testing device of the present disclosure comprises a clock unit that measures the date and time of the software testing device, a receiving unit that receives multiple data including timestamps consisting of the date and time from the outside, a virtual date and time setting unit that sets the date and time of the clock unit to a virtual date and virtual time, a data correction unit that corrects the data by correcting the date of the timestamp to a virtual date without correcting the time of the timestamp, and a software execution unit that executes the software to be tested using the data with the corrected timestamp according to the date and time of the clock unit.
[0008] The software testing method disclosed herein includes the steps of: a processor timing the date and time of the software testing device; a processor receiving a plurality of data from an external device, the data including a timestamp consisting of the date and time; a processor setting the date and time of the software testing device to a virtual date and virtual time; a processor correcting the data by correcting the date of the timestamp to the virtual date without correcting the time of the timestamp; and a processor executing the software to be tested using the data with the corrected timestamp according to the date and time of the software testing device.
[0009] According to the present disclosure, software testing can be performed without modifying the software to be tested and without taking the time and effort to generate test data.
[0010] 1 is a diagram showing the configuration of the software testing device 1 of embodiment 1. FIG. 1 is a diagram showing an example of data received by the receiving unit 2. FIG. 2 is a diagram showing an example of data corrected by the data correction unit 4. FIG. 3 is a diagram showing another example of data received by the receiving unit 2. FIG. 4 is a diagram showing another example of data corrected by the data correction unit 4. FIG. 5 is a flowchart showing the processing procedure of the software testing device 1 of embodiment 1. FIG. 6 is a diagram showing the configuration of the software testing device 1A of embodiment 2. FIG. 7 is a diagram showing an example of data received by the receiving unit 2. FIG. 8 is a diagram showing an example of data corrected by the data correction unit 4. FIG. 9 is a diagram showing an example of execution result data of the execution result data storage unit 6 after some execution results have been deleted by the execution result adjustment unit. FIG. 10 is a flowchart showing the processing procedure of the software testing device 1A of embodiment 2. FIG. 11 is a diagram showing the configuration of the software testing device 1B of embodiment 3. FIG. 12 is a diagram showing an example of execution of the software to be tested when the system time is measured in real time. 1 is a diagram showing an example of execution of software to be tested when system time is measured in this embodiment. 2 is a flowchart showing the processing procedure of a software testing device 1C according to an embodiment 3. 3 is a diagram showing a configuration in which part or all of the software testing devices 1, 1A, and 1B are realized using software.
[0011] Hereinafter, embodiments will be described with reference to the drawings. First Embodiment Fig. 1 is a diagram showing the configuration of a software testing device 1 according to a first embodiment.
[0012] The software testing device 1 of the first embodiment includes a clock unit 7 , a receiving unit 2 , a data correcting unit 4 , a software executing unit 5 , an execution result data storing unit 6 , and a virtual date and time setting unit 3 .
[0013] The clock unit 7 keeps track of the date and time of the software test device 1 (hereinafter also referred to as system time).
[0014] The receiving unit 2 receives a plurality of data items including a time stamp consisting of a date and a time from the external IoT system 90. The receiving unit 2 can acquire data information using an API (Application Program Interface) or the like.
[0015] The virtual date and time setting unit 3 receives input of a virtual date and virtual time from the tester (user) and sets the date and time of the clock unit 7 to the virtual date and virtual time.
[0016] The data correction unit 4 corrects the data by correcting the date of the timestamp to the virtual date without correcting the time of the timestamp.
[0017] By correcting the date in the timestamp to a virtual date, it is possible to perform tests for yearly or monthly changes, for example. Because the time in the timestamp is not corrected, even if the characteristics of the received data change depending on the time, such as operating data for an air conditioner, the received data can be used for software testing without changing the characteristics.
[0018] If data including a timestamp of a time later than the virtual time is received at the time when the date and time of clock unit 7 are set to the virtual date and virtual time, data correction unit 4 deletes the data including a timestamp of a time later than the virtual time. If data including a timestamp of the virtual time is received at the time when the date and time of clock unit 7 are set to the virtual date and virtual time, data correction unit 4 may delete the data including the timestamp of the virtual time.
[0019] The data correction unit 4 receives data including a timestamp of at least one time earlier than the virtual time when the date and time of the clock unit 7 are set to the virtual date and virtual time, and if data including a timestamp of at least one time earlier than the virtual time has not been received, the data correction unit 4 may complement the data including the timestamp of the virtual time when the date and time of the clock unit 7 are set to the virtual date and virtual time, but has not received the data. Specifically, the data correction unit 4 complements the data that has not been received using the received data. Alternatively, the data correction unit 4 may complement the data that has not been received using random data, fixed data, or a formula.
[0020] The data correction unit 4 can be realized by a technology called a network proxy.
[0021] The software execution unit 5 executes the software to be tested using data whose timestamp has been corrected according to the date and time (system time) of the clock unit 7 .
[0022] The execution result data storage unit 6 stores execution result data including a timestamp consisting of the date and time (system time) of the clock unit 7 when the software to be tested is executed by the software execution unit 5, and the execution results of the software to be tested.
[0023] Fig. 2 is a diagram showing an example of data received by the receiving unit 2. The example of Fig. 2 shows data received by the receiving unit 2 on the current date and one day before the current time (17:00, Dec. 21, 2022).
[0024] Even if an attempt is made to improve the efficiency of software testing by manipulating the date and time (system time) of the clock unit 7, inconsistencies will occur in the data input to the software because the system time does not match that of the external system. For example, if a test is attempted by changing the system time to a past time, future time data will be obtained from an external IoT system, resulting in inconsistencies. Therefore, the data correction unit 4, located midway between the software execution unit 5 that executes the software to be tested and the external IoT system, corrects the received data.
[0025] 3 is a diagram showing an example of data corrected by the data correction unit 4. The system time has been set to a virtual date and virtual time (7:00, November 1, 2022) by the virtual date and time setting unit 3. In the example of FIG. 3, the data correction unit 4 has corrected the date of the timestamp of the received data to the virtual date (November 1, 2022), and deleted data including a timestamp of the virtual time (7:00) and data including a timestamp later than the virtual time.
[0026] Fig. 4 is a diagram showing another example of data received by the receiving unit 2. The example of Fig. 4 shows data received by the receiving unit 2 on the current date and one day before the current time (7:00 on Dec. 21, 2022).
[0027] 5 is a diagram showing another example of data corrected by the data correction unit 4. The virtual date and time setting unit 3 has set the system time to a virtual date and virtual time (November 1, 2022, 17:00). In the example of FIG. 5, the data correction unit 4 has corrected the date of the timestamp of the received data to the virtual date (November 1, 2022), and data that has not been received and includes a timestamp of the virtual time (17:00) and data that includes a timestamp earlier than the virtual time (7:00:00 to 16:59:00) have been supplemented with the received data (data that includes a timestamp of November 1, 2022, 00:00:00).
[0028] FIG. 6 is a flowchart showing the processing procedure of the software testing device 1 according to the first embodiment.
[0029] In step S100, the clock unit 7 keeps track of the date and time (system time) of the software testing device.
[0030] In step S101, the receiving unit 2 receives a plurality of data including a timestamp consisting of a date and a time from the external IoT system 90.
[0031] In step S102, the virtual date and time setting unit 3 sets the date and time (system time) of the clock unit 7 to the virtual date and virtual time.
[0032] In step S103, the data correction unit 4 sets the date of the timestamp of the received data to the virtual date.
[0033] In step S104, if data including a timestamp of a time in the future than the virtual time has been received at the time when the date and time of the clock unit 7 are set to the virtual date and virtual time, the process proceeds to step S105. If not, the process proceeds to step S106.
[0034] In step S105, the data correction unit 4 deletes data including a time stamp of a time that is later than the virtual time. If the data correction unit 4 has received data including a time stamp of the virtual time at the time when the date and time of the clock unit 7 are set to the virtual date and virtual time, the data correction unit 4 may delete the data including the time stamp of the virtual time.
[0035] In step S106, at the time when the date and time of the clock unit 7 are set to the virtual date and virtual time, data including a timestamp of at least one time earlier than the virtual time is received, and if data including a timestamp of at least one time earlier than the virtual time is not received, processing proceeds to step S107.
[0036] In step S107, the data correction unit 4 complements the data that has not been received. If data including a timestamp of the virtual time has not been received at the time when the date and time of the clock unit 7 are set to the virtual date and virtual time, the data correction unit 4 may complement the data including the timestamp of the virtual time that has not been received. For example, the data correction unit 4 may use the received data to complement the data that has not been received.
[0037] In step S108, the software execution unit 5 executes the software to be tested using the data whose timestamp has been corrected in accordance with the date and time (system time) of the clock unit 7.
[0038] The execution result data storage unit 6 stores execution result data including a timestamp consisting of the date and time (system time) of the clock unit 7 when the software to be tested is executed by the software execution unit 5, and the execution results of the software to be tested.
[0039] According to this embodiment, in response to the problem of having to generate test data according to the test scenario in advance, it is possible to realize a test that is closer to the real thing using only the test scenario (setting of the virtual date and time).
[0040] Embodiment 2. Execution result data generated as a result of executing software to be tested is stored in the execution result data storage unit 6. However, if tests are repeated for the same system time, multiple pieces of execution result data for the same system time will be stored in the execution result data storage unit 6, resulting in a violation of the uniqueness constraint between the data. This embodiment solves this problem.
[0041] 7 is a diagram showing the configuration of a software testing device 1A according to embodiment 2. The software testing device 1A according to embodiment 2 includes an execution result adjustment unit 8 in addition to the components of the software testing device 1 according to embodiment 1.
[0042] When the execution result adjustment unit 8 sets the date and time of the clock unit 7 to the virtual date and virtual time, it deletes the execution result data stored in the execution result data storage unit 6 that includes the virtual date and a date later than the virtual date as a timestamp.
[0043] Fig. 8 is a diagram showing an example of data received by the receiving unit 2. The example of Fig. 8 shows data received by the receiving unit 2 for one day before the current date and time (17:00, Dec. 21, 2022).
[0044] 9 is a diagram showing an example of data corrected by the data correction unit 4. The system time has been set to a virtual date and virtual time (7:00, November 1, 2022) by the virtual date and time setting unit 3. In the example of FIG. 9, the data correction unit 4 has corrected the date of the timestamp of the received data to the virtual date (November 1, 2022), and deleted data including a timestamp of the virtual time (7:00) and data including a timestamp later than the virtual time.
[0045] 10 is a diagram illustrating an example of the execution result data stored in the execution result data storage unit 6 after some execution results have been deleted by the execution result adjustment unit. In the example of Fig. 10, the execution result data that includes the virtual date (November 1, 2022) and dates later than the virtual date as timestamps has been deleted.
[0046] Fig. 11 is a flowchart showing the processing procedure of the software testing device 1A of embodiment 2. The flowchart of embodiment 2 of Fig. 11 differs from the flowchart of embodiment 1 of Fig. 6 in that the flowchart of embodiment 2 of Fig. 11 includes step S201 between step S105 and step S108.
[0047] In step S201, the execution result adjustment unit 8 deletes, from the execution result data stored in the execution result data storage unit 6, the execution result data that includes a virtual date or a date later than the virtual date as a timestamp.
[0048] According to this embodiment, the time and effort required for preparing for software testing can be reduced, allowing software developers to focus on testing and debugging the software.
[0049] Third Embodiment If there is software that runs once a day and you want to test that software, most of the time will be spent waiting for it to start up. This embodiment solves this problem.
[0050] 12 is a diagram showing the configuration of a software testing device 1B according to embodiment 3. The software testing device 1B according to embodiment 3 differs from the software testing device 1A according to embodiment 2 in that the software testing device 1B according to embodiment 3 includes a timekeeping control unit 9.
[0051] The timing control unit 9 causes the clock unit 7 to measure the date and time (system time) in real time during the period when the software execution unit 5 is executing the software to be tested, and causes the clock unit 7 to measure the date and time (system time) at a speed faster than real time during the period when the software execution unit 5 is not executing the software to be tested.
[0052] 13 is a diagram showing an example of execution of software under test when system time is measured in real time. The first software test is executed at system time t1. Next, software tests are executed at system times t2, t3, .... The execution time of the software test is T1 (e.g., 1 minute), and the execution interval of the software test is T2 (e.g., 1 day).
[0053] 14 is a diagram showing an example of execution of software to be tested when the system time is measured in this embodiment. The first software test is executed at system time t1. Next, software tests are executed at system times t2', t3', ...
[0054] The timing control unit 9 controls the clock unit 7 to measure the date and time (system time) in real time while the software execution unit 5 is executing the software to be tested, so the execution time of the software test is T1 (e.g., 1 minute).
[0055] During the period when the software execution unit 5 is not executing the software to be tested, the timing control unit 9 causes the clock unit 7 to measure the date and time (system time) at a speed faster than real time (for example, 24 times faster), so that the execution interval of the software test is T3 (for example, 1 hour), where T3<T2.
[0056] Fig. 15 is a flowchart showing the processing procedure of the software testing device 1C of embodiment 3. The flowchart of embodiment 3 in Fig. 15 differs from the flowchart of embodiment 2 in Fig. 11 in that the flowchart of embodiment 3 in Fig. 15 includes steps S301 to S304.
[0057] After step S201, when the software to be tested is started by the software execution unit 5 in step S301, the process proceeds to step S302.
[0058] In step S302, the timekeeping control unit 9 causes the clock unit 7 to measure the date and time (system time) in real time, after which steps S108 and S109 are executed.
[0059] In step S303, when the software to be tested is terminated by the software execution unit 5, the process proceeds to step S304.
[0060] In step S304, the timekeeping control unit 9 causes the clock unit 7 to measure the date and time (system time) at a rate faster than real time, after which the process returns to step S301.
[0061] 16 is a diagram showing a configuration in which part or all of the software testing devices 1, 1A, and 1B are realized using software. The software testing devices 1, 1A, and 1B include a processor 1001 and a memory 1002 connected to a bus 1003. The processor 1001 executes a program stored in the memory 1002.
[0062] According to this embodiment, by accelerating the startup waiting time period, it is possible to complete multiple software tests in a short period of time.
[0063] The embodiments disclosed herein should be considered to be illustrative in all respects and not restrictive. The scope of the present disclosure is defined by the claims, not by the above description, and is intended to include all modifications within the meaning and scope of the claims.
[0064] 1, 1A, 1B, 1C Software testing device, 2 Receiving unit, 3 Virtual date and time setting unit, 4 Data correction unit, 5 Software execution unit, 6 Execution result data storage unit, 7 Clock unit, 8 Execution result adjustment unit, 9 Timekeeping control unit, 1001 Processor, 1002 Memory, 1003 Bus.
Claims
1. A software testing device comprising: a clock unit that measures the date and time of the software testing device; a receiving unit that receives multiple data items from an external device, each including a timestamp consisting of a date and time; a virtual date and time setting unit that sets the date and time of the clock unit to a virtual date and virtual time; a data correction unit that corrects the data by correcting the date of the timestamp to the virtual date without correcting the time of the timestamp; and a software execution unit that executes the software to be tested using the data with the timestamp corrected in accordance with the date and time of the clock unit.
2. The software testing device of claim 1, wherein the data correction unit deletes data including a timestamp that is later than the virtual time if, at the time the date and time of the clock unit are set to a virtual date and virtual time, data including a timestamp that is later than the virtual time is received.
3. A software testing device as described in claim 2, wherein the data correction unit deletes data including a timestamp of the virtual time if data including a timestamp of the virtual time is received at the time the date and time of the clock unit are set to the virtual date and virtual time.
4. A software testing device as described in claim 3, wherein the data correction unit receives data including a timestamp of at least one time earlier than the virtual time at the time the date and time of the clock unit are set to the virtual date and virtual time, and if data including a timestamp of at least one time earlier than the virtual time has not been received, the data that has not been received is complemented.
5. The software testing device according to claim 4, wherein the data correction unit complements data including a timestamp of the virtual time if data including a timestamp of the virtual time has not been received at the time the date and time of the clock unit are set to the virtual date and virtual time.
6. A software testing device according to any one of claims 1 to 5, comprising: a memory unit that stores execution result data including a timestamp consisting of the date and time of the clock unit when the software to be tested is executed by the software execution unit, and the execution result of the software to be tested; and an execution result adjustment unit that deletes, from the execution result data stored in the memory unit, execution result data that includes the virtual date and a date that is later than the virtual date as a timestamp.
7. The software testing device according to any one of claims 1 to 6, further comprising a timekeeping control unit that causes the clock unit to keep track of the date and time in real time during a period when the software execution unit is executing the software to be tested, and that causes the clock unit to keep track of the date and time at a rate faster than real time during a period when the software execution unit is not executing the software to be tested.
8. A software testing method comprising the steps of: a processor counting the date and time of a software testing device; a processor receiving a plurality of data from an external device, the data including a timestamp consisting of a date and a time; a processor setting the date and time of the software testing device to a virtual date and a virtual time; a processor correcting the data by correcting the date of the timestamp to the virtual date without correcting the time of the timestamp; and a processor executing the software to be tested using the data with the timestamp corrected according to the date and time of the software testing device.
Citation Information
Patent Citations
Test method and device, electronic equipment, readable storage medium and program product
CN116974895A
Date setting method
JP1998240574A
Time data correcting device and computer system and computer readable recording medium recorded with program
JP2001092690A
Job operation management system and job schedule test method of the same system
JP2002041302A
Job management system and method
JP2010224812A