Abstract:
A software testing device and method is provided. The software testing device includes: a test script unit for outputting its holding test script when a test execution signal is inputted; a test data creating unit for selecting at least one test data from at least one predetermined test data set and creating test data, and combining the created test data to the test script; and a test execution unit for receiving the test data from the test data creating unit, and executing test by the test script combined with the received test data.

Description:
BACKGROUND OF THE INVENTION  
       [0001]     1. Field of the Invention  
         [0002]     The present invention relates to a software testing device and method, and more particularly, to a device and method for testing software integrity using a test script and test data.  
         [0003]     2. Description of the Background Art  
         [0004]      FIG. 1  illustrates the construction of a conventional software testing device that does not have the function of dynamically creating test data.  
         [0005]     The conventional software testing device only performs a test that uses a previously prepared test case. The previously prepared test case includes a test script and the test data that are all ditermined before the software test is executed and, therefore are fixed.  
         [0006]     In such a conventional software testing method, because the test data is fixed prior to testing, the software performed test will be insufficient or incomplete. Once the conventional software test has been performed to compensate for any insufficiense in previous tests, new test data would have to be created and used and therefore, such add final test data creation and testing increase the time and costs associated with the testing of software.  
       SUMMARY OF THE INVENTION  
       [0007]     Accordingly, an object of the present invention is to solve at least the problems and disadvantages of the background art.  
         [0008]     An object of the present invention is to provide a software testing device and method in which test data is dynamically created during the execution of the software test according to need and in which the need to prepared test data before test execution is elimnated.  
         [0009]     To achieve these and other advantages and in accordance with the purpose of the present invention, as embodied and broadly described, there is provided a software testing device including: a test script unit for outputting its holding test script when a test execution signal is inputted; a test data creating unit for selecting at least one test data from at least one predetermined test data set and creating test data, and combining the created test data to the test script; and a test execution unit for receiving the test data from the test data creating unit, and executing test by the test script combined with the received test data.  
         [0010]     In another aspect of the present invention, there is provided a software testing device including: a test script unit for outputting its holding test script when a test execution signal is inputted; a test data creating unit for selecting at least one test data from a predetermined test data set and creating test data, and combining the created test data to the test script; a test execution unit for receiving the test script from the test script unit and providing the received test script to the test data creating unit, and receiving the test data from the test data creating unit and executing test by the test script combined with the received test data; and a monitoring unit for monitoring a result of the test executed in the test execution unit, and outputting a control signal for creating additional test data, to the test data creating unit depending on the monitored result.  
         [0011]     The test data creating unit includes: a divider for dividing the data set by a predetermined reference; and a data creator for selecting at least two test data from each divided section, and creating the test data, wherein the monitoring unit outputs the control signal for creating the additional test data, to the test data creating unit for one of the divided sections where a result of test execution using the test data is different.  
         [0012]     The divider may divide the data set according to a center value of the data set or a randomly created value, for the section where the result of test execution using the test data is different.  
         [0013]     The data creating unit may select at least two test data from a center value, a minimal value, a maximal value, and a mean value of the data belonging to each divided section. The data creating unit may also randomly select at least two test data from the data belonging to each divided section.  
         [0014]     The test data creating unit may decide a specific variable value among the data in the data set, and decide variable values having a dependence relationship with the specific variable value among the data belonging to the data set on the basis of the decided specific variable value.  
         [0015]     The software testing device may further include a storage unit for storing a check table for indicating execution or non-execution of test for a path of a test targeted software, wherein the monitoring unit monitors the result of test execution using the test data, and when there exists a non-tested path, outputs the control signal for creating the additional test data to the test data creating unit, and indicates the execution of the test for a tested path at a corresponding path of the check table.  
         [0016]     In a further another aspect of the present invention, there is provided a software testing device receiving a test execution signal, selecting at least one test data from at least one predetermined test data set, and creating test data; combining the created test data to its holding test script; executing a test by the test script combined with the test data; monitoring a result of the test; and feeding back and selecting at least one test data from at least one predetermined test data set by a control signal for creating additional test data depending on the monitored result.  
         [0017]     In a further another aspect of the present invention, there is provided a software testing method including the steps of: (a) selecting at least one test data from at least one predetermined test data set, and creating test data; (b) combining the created test data to its holding test script; and (c) executing a test by the test script combined with the test data.  
         [0018]     After the step (a), the method may further include the step of: (d) monitoring a result of the test execution, and deciding whether or not the test is ended and whether or not additional test data is created.  
         [0019]     The steps (a) to (d) may be repeated until the test is ended.  
         [0020]     The step (a) includes the steps of: (a1) dividing the data set according to a predetermined reference; and (a2) selecting at least two test data from each divided data section, and creating the test data, wherein in the step (d), creation of the additional test data is decided for a data section where a result of the test execution using the test data is different, among the divided sections.  
         [0021]     In the step (a1), the data set may be divided with reference to a center value of the data set or a randomly created value, for the data section where the result of test execution using the test data is different.  
         [0022]     In the step (a2), at least two test data may be selected from a center value, a minimal value, a maximal value, and a mean value of the data belonging to each divided section.  
         [0023]     In the step (a2), at least two test data may be randomly selected from the data belonging to each divided section.  
         [0024]     In the step (a2), a specific variable value may be decided among the data belonging to the data set, and variable values having a dependence relationship with the specific variable value may be decided on the basis of the decided specific variable value among the data belonging to the data set.  
         [0025]     In the step (d), the result of test execution using the test data may be monitored, and when there exists a non-tested path, additional test data may be created in the test data creating unit, and it may be indicated on a tested path that the test is executed for the corresponding path of a check table for indicating execution or non-execution of the test for the path of a test targeted software.  
         [0026]     According to the present invention, a test coverage can be improved, and various test data can be created, thereby improving a function of error detection in the testing device.  
         [0027]     Further, the test script and the test data are separated and provided, thereby making it possible to reuse the test script. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0028]     The invention will be described in detail with reference to the following drawings in which like numerals refer to like elements.  
         [0029]      FIG. 1  illustrates a construction of a conventional software testing device not having a function of dynamically creating test data;  
         [0030]      FIG. 2  illustrates a construction of a software testing device according to an embodiment of the present invention;  
         [0031]      FIG. 3  is a block diagram illustrating a construction of a test data creating unit of a software testing device according to an embodiment of the present invention;  
         [0032]      FIG. 4  is a flowchart illustrating a software testing method according to the present invention;  
         [0033]      FIG. 5  is a flowchart illustrating a process of creating test data in a software testing method according to an embodiment of the present invention; and  
         [0034]      FIG. 6  is a flowchart illustrating a process of creating test data in a software testing method according to another embodiment of the present invention. 
     
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS  
       [0035]     Preferred embodiments of the present invention will be described in a more detailed manner with reference to the drawings.  
         [0036]      FIG. 2  illustrates a construction of a software testing device according to an embodiment of the present invention.  
         [0037]     Referring to  FIG. 2 , the inventive software testing device  200  includes a test script unit  210 , a test data creating unit  220 , a test execution unit  230 , and a monitoring unit  240 .  
         [0038]     The test script unit  210  holds a test script made before the test execution of test. The test script is comprised of calls/inputs for a test target, and a data requiring portion of the test script is comprised of a symbolic name (for example, arg).  
         [0039]     The test data creating unit  220  dynamically creates test data. Here, the dynamic creation of the test data means creation of a suitable test data depending on a progress state of test.  
         [0040]     The monitoring unit  240  can be included, as an additional means, in the software testing device  200 . The monitoring unit  240  transmits a control signal through its monitoring and the dynamical creation of the test data depending on the monitoring, to the test data creating unit  220 .  
         [0041]     Here, only transmission of the control signal from the monitoring unit  240  is described in a preferred embodiment of the present invention, but transmission of control signal based on manual manipulation can be also be accomplished.  
         [0042]      FIG. 3  is a block diagram illustrating a construction of the test data creating unit of the software testing device according to an embodiment of the present invention.  
         [0043]     Referring to  FIG. 3 , the test data creating unit  220  includes a divider  222  and a data creator  224 .  
         [0044]     The divider  222  divides a data set suitable for the test. For example, if the data set suitable for the test is a natural number of 1 to 100, the divider  222  zero-divides the data set in an initial test (that is, the data set is divided at a zero time).  
         [0045]     When the divider  222  receives an unsatisfactory monitoring result from the monitoring unit  240  after the execution of the test, it divides the data set into two sets having ranges of 1 to 50 and 51 to 100. The divider  222  continuously performs a division process until a monitoring result is satisfactory. A division reference of the divider  222  can be a center value of the data set having the unsatisfactory monitoring result. The divider  222  can randomly divide the data set having the unsatisfactory monitoring result.  
         [0046]     The data creator  224  selects at least two data from the data section divided in the divider  222 , and creates the test data. With reference to the above example, at the initial test, the data creator  224  selects numerals of 1 and 100 from the natural number of 1 to 100, and creates a first test data comprised of the selected numerals of 1 and 100. The test execution unit  230  performs the test using the first test data, and when the monitoring result is unsatisfactory, the divider  222  divides the data set into two sections of 1 to 50 and 51 to 100 as aforementioned.  
         [0047]     The data creator  224  selects at least two test data from each divided section, and creates the test data. For example, the data creator  224  selects numerals of 2 and 45 and numerals of 52 and 95 from the data sections of 1 to 50 and 51 to 100, respectively, and creates a 2-1 test data and a 2-2 test data comprised of the selected numerals of 2 and 45 and the selected numerals of 52 and 95, respectively.  
         [0048]     If the test result based on the 2-2 test data is unsatisfactory, the divider  222  divides the data section of 51 to 100 from which the 2-2 test data is selected, into two sections of 51 to 75 and 76 to 100. The data creator  224  selects at least two test data from the divided sections, respectively, and creates a 3-1 test data and a 3-2 test data comprised of the selected test data. The above process is repeated until the test result is satisfactory.  
         [0049]     The data creator  220  can select the test data from a middle value, a mean value, a minimal value, and a maximal value of the data set. The data creator  220  can also randomly select the test data from the data set.  
         [0050]     The test data creating unit  220  can create the test data on the basis of a path. In this case, the test data creating unit  220  selects at least one suitable data from the data, and creates the test data. If there exists a non-tested path as a result of monitoring, the test data is created from data not previously selected from the data set. For example, if the data set is a natural number of 1 to 100, initial test data can be the numeral of 50. If the test result using the numeral of 50 is unsatisfactory, the numeral of 79 can be the next created test data. This process is repeated until the test result is satisfactory.  
         [0051]     In a case where the test data is created on the basis of the path, the test data creating unit  220  creates the test data based on a dependence relationship between variables. Variables in program have a mutual dependence relationship. For example, a sentence of x=y+1 exists in program, variables of “x” and “y” have a mutual dependence relationship. In other words, if either one of the variables of “x” and “y” is determined, the other one is also determined.  
         [0052]     Accordingly, if one of the variables having the dependence relationship is determined, others are also determined. Therefore, the test data creating unit  220  can obtain the test data even without obtaining a solution of equality/inequality required in a conventional symbolic execution method.  
         [0053]     The test execution unit  230  reads the test script stored in the test script unit  210 , and provides the read test script to the test data creating unit  220 . The test data creating unit  220  creates the test data necessary for testing the test script, and then outputs the test script filled with the test data, to the test execution unit  230 .  
         [0054]     The test execution unit  230  executes the test for the test script provided from the test data creating unit  220 . The test execution of the test execution unit  230  is controlled by the monitoring result of the monitoring unit  240 .  
         [0055]     A controller (not shown) can also control operations of the test script unit  210 , the test data creating unit  220 , and the test execution unit  230 , on the basis of the monitoring result received from the monitoring unit  240 .  
         [0056]     The monitoring unit  240  monitors the test result executed in the test execution unit  230 . In case where the test data is dynamically created on the basis of a partition, the monitoring unit  240  determines adequacy or non-adequacy of the test, depending on identity or non-identity of the test result that is executed using at least two test data.  
         [0057]     In a case where the test data is dynamically created on the basis of the path, the monitoring unit  240  determines the adequacy or non-adequacy of the test depending on existence or absence of a non-tested path. To determine the execution or non-execution of the test, it is required to indicate that the test is not executed for all paths before initiation of the test.  
         [0058]     To determine execution or non-execution of a test for a path in the test-targeted software, a check table can be stored in the monitoring unit  240  or a separate storage unit (not shown). The monitoring unit  240  indicates the execution of the test for the tested path at a corresponding path of the check table.  
         [0059]     If it is determined that the test results executed using two or more test data are different or there exists a non-tested path, the monitoring unit  240  instructs the test data creating unit  220  to create new test data.  
         [0060]      FIG. 4  is a flowchart illustrating a software testing method according to the present invention.  
         [0061]     The test execution unit  230  outputs the test script provided by the test script unit  210 , to the test data creating unit  220  (Step  400 ).  
         [0062]     The test data creating unit  220  receives the test script, creates the test data necessary for the received test script, insorts the created test data in the test script, and outputs the test script to the test execution unit  230  (Step  410 ).  
         [0063]     The test execution unit  230  receives the test script from the test data creating unit  220 , and executes the test using the received test script (Step  420 ).  
         [0064]     The monitoring unit  240  monitors the test result executed in the test execution unit  230 , and determines the adequacy or non-adequacy of the test (for example, whether or not the test results executed using the different test data are identified, or whether or not all paths are tested) (Step  430 ).  
         [0065]     If it is determined that the test is incomplete, the monitoring unit  240  instructs the test data creating unit  220  to create and provide new test data to the test execution unit  230  (Step  440 ).  
         [0066]     Preferably, The above Steps  410  to  440  are repeated until the test is determined adequate.  
         [0067]      FIG. 5  is a flowchart illustrating a process of creating the test data in a software testing method according to an embodiment of the present invention.  
         [0068]     Referring to  FIG. 5 , the divider  222  divides the data set suitable for the test (Step  500 ). The data creator  224  selects at least two test data from each divided section, and creates the test data (Step  510 ).  
         [0069]     The test data creating unit  220  inserts the created test data in the test script, and then outputs the test script to the test execution unit  230  (Step  520 ).  
         [0070]     The monitoring unit  240  determines that the test is incomplete (Step  530 ), the divider  222  divides the data set of the section determined that the test is incomplete (Step  540 ). The data creating unit  224  selects at least two test data from each divided section, inserts the test data in the test script, and outputs the test script to the test execution unit  230 .  
         [0071]     The section division, the data creation, the test execution, and the monitoring are repeated until the test result is satisfactory.  
         [0072]      FIG. 6  is a flowchart illustrating a process of creating the test data in a software testing method according to another embodiment of the present invention.  
         [0073]     Referring to  FIG. 6 , the test data creating unit  220  selects the suitable data from the data set suitable for the test, and creates the test data (Step  600 ). The test data creating unit  220  inserts the created test data in the test script, and then outputs the test script to the test execution unit  230  (Step  610 ).  
         [0074]     The monitoring unit  240  determines that there exists a non-tested path (Step  620 ), the test data creating unit  220  creates the additional suitable test data from data not previously selected from the data section.  
         [0075]     The data creation, the test execution, and the monitoring are repeated until the tests are executed for all paths.  
         [0076]     In the above description, the method and device for dynamically creating the test data is described as a specific embodiment, but this method device can also be used in combination with a method for creating the test data based on the partition and a method for creating the test data based on the path.  
         [0077]     Further, in the method for creating the test data based on the path, it is theoretically very difficult (NP-complete) to create the test data for testing all paths and therefore, modified examples of various algorithms, such as testing for all sentences, testing for all branches, and testing for some paths, can be made.  
         [0078]     The present invention can be embodied using a computer readable code in a computer readable recording medium.  
         [0079]     The computer readable recording medium includes all kinds of recording devices for storing data readable by a computer device.  
         [0080]     The computer readable recording medium is exemplified as a Read Only Memory (ROM), a Random Access Memory (RAM), a Compact Disk-Read Only Memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, and also includes a device embodied in a format of a carrier wave (for example, transmission through Internet).  
         [0081]     The computer readable recording medium is distributed in the computer device connected through a network, and stores and executes the computer readable code in a distribution way.  
         [0082]     According to the present invention, the test data can be dynamically created, thereby improving a test coverage, and various test data can be created, thereby improving a error detection in function the testing device.  
         [0083]     Further, the test script and the test data are separated and provided, thereby making it possible to reuse the test script.  
         [0084]     The invention as thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.