CN116594915B - Automatic generation method, device, equipment and medium for integrated test cases - Google Patents

Automatic generation method, device, equipment and medium for integrated test cases Download PDF

Info

Publication number
CN116594915B
CN116594915B CN202310872720.6A CN202310872720A CN116594915B CN 116594915 B CN116594915 B CN 116594915B CN 202310872720 A CN202310872720 A CN 202310872720A CN 116594915 B CN116594915 B CN 116594915B
Authority
CN
China
Prior art keywords
file
test
function
test case
case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310872720.6A
Other languages
Chinese (zh)
Other versions
CN116594915A (en
Inventor
付立民
邱兆阳
李学良
秦畅
李坤
马征
刘恒
杨柳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest Jiaotong University
Original Assignee
Southwest Jiaotong University
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 Southwest Jiaotong University filed Critical Southwest Jiaotong University
Priority to CN202310872720.6A priority Critical patent/CN116594915B/en
Publication of CN116594915A publication Critical patent/CN116594915A/en
Application granted granted Critical
Publication of CN116594915B publication Critical patent/CN116594915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides an automatic generation method, device, equipment and medium of an integrated test case, relating to the technical field of software test, comprising the steps of obtaining an initial case file, obtaining function names and paths of test functions needing to be integrated from the initial case file, and establishing a key value pair dictionary according to the function names and paths; obtaining a corresponding stub function according to the function name of the test function, and extracting constraint conditions in the stub function; reversely aggregating the constraint conditions into a top test function based on a top constraint direction aggregation method to generate a new use case generation file; generating a second test case for the new case generation file, taking the initial test case file as a template, and writing the second test case into the new test case file to obtain a final test case file; the application is used for solving the technical problem that the existing automatic generation scheme of the integrated test case cannot meet the maximum coverage of the interface calling rate in the layer 3 in the integrated test of the track traffic signal system.

Description

Automatic generation method, device, equipment and medium for integrated test cases
Technical Field
The application relates to the technical field of software testing, in particular to an automatic generation method, device, equipment and medium of an integrated test case.
Background
The integrated test is a logic extension of the unit test, and on the basis of the unit test, all modules are assembled into a subsystem or a system according to design requirements and then related tests are carried out to verify whether interaction and integration between all components of the software system are normal or not, so that the whole system can work correctly. At present, in rail transit, the existing automatic generation scheme of integrated test cases has the technical problem that the maximum coverage of the interface calling rate in the 3 layers in the integrated test of the rail transit signal system cannot be met, and the existing generation scheme does not support the interactive interface with the Testbed software, so that a tester cannot directly use the integrated test cases after acquiring the test cases, the workload of automatically generating the test cases is transferred to the translation and storage of the test cases, and the personnel cost still cannot be reduced.
Disclosure of Invention
The application aims to provide an automatic generation method, device, equipment and medium for integrated test cases, so as to solve the problems. In order to achieve the above purpose, the technical scheme adopted by the application is as follows:
in a first aspect, the present application provides a method for automatically generating an integrated test case, including:
acquiring an initial use case file, acquiring function names and paths of test functions to be integrated from the initial use case file, and establishing a key value pair dictionary according to the function names and paths;
obtaining a corresponding stub function according to the function name of the test function, and extracting constraint conditions in the stub function;
reversely aggregating the constraint conditions into a top test function based on a top constraint direction aggregation method to generate a new use case generation file;
generating a second test case for the new case generation file, taking the initial test case file as a template, and writing the second test case into the new test case file to obtain a final test case file.
In a second aspect, the present application further provides an automatic generating device for an integrated test case, including:
the acquisition module is used for: the method comprises the steps of obtaining an initial use case file, obtaining function names and paths of test functions to be integrated from the initial use case file, and establishing a key value pair dictionary according to the function names and paths;
and an extraction module: the method comprises the steps of obtaining corresponding stub functions according to function names of test functions, and extracting constraint conditions in the stub functions;
reverse aggregation module: the constraint condition is reversely aggregated into a top-level test function based on a top-level constraint direction aggregation method, and a new use case generation file is generated;
and a writing module: and the method is used for generating a second test case for the new case generation file, writing the second test case into the new test case file by taking the initial test case file as a template to obtain a final test case file.
In a third aspect, the present application further provides an automatic generating device for an integrated test case, including:
a memory for storing a computer program;
and the processor is used for realizing the step of the automatic generation method of the integrated test case when executing the computer program.
In a fourth aspect, the present application further provides a readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the steps of the automatic generating method based on an integrated test case.
The beneficial effects of the application are as follows:
the application provides a top constraint reverse aggregation method, which integrates bottom constraint into top design, and then generates test cases for the top design, wherein the generated test cases can meet the coverage criterion of branches of the top design and simultaneously meet the maximization of interface calling rate in the bottom design, replace manual design test cases and reduce the cost of designing integrated test cases.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow diagram of a bottom-to-top integration strategy;
FIG. 2 is a schematic flow chart of an automatic generation method of an integrated test case according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an automatic generating device for an integrated test case according to an embodiment of the present application;
fig. 4 is a schematic diagram of an automatic generating device for an integrated test case according to an embodiment of the present application.
The marks in the figure:
800. automatic generation equipment of integrated test cases; 801. a processor; 802. a memory; 803. a multimedia component; 804. an I/O interface; 805. a communication component.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Example 1:
the integration test is used for verifying whether two or more units or other integrations work together correctly, and the embodiment provides an automatic generation method of an integration test case based on a bottom-to-top integration strategy, wherein the bottom-to-top integration strategy mainly comprises:
as shown in fig. 1, first the "atomic" modules are divided into three module groups, each of which incorporates a driver module for testing. Therefore, the modules in the module group 1 and the module group 2 are all subordinate to the module SL, so that after the driving modules Dr1 and Dr2 are removed, the module group 1 and the module group 2 are directly connected with the SL, at this time, the SL can be subjected to integrated test, after the Dr3 is removed, the SR is directly connected with the module group 3, the SR can be subjected to integrated test, and finally, the SL, the SR and the Top are all integrated together for test.
Referring to fig. 2, the method is shown to include:
s1, acquiring an initial use case file tcf file, acquiring a function name and a path of a test function to be integrated from the initial use case file, and establishing a key value pair dictionary map according to the function name and the path, wherein the key value pair dictionary map is used for storing the position of the test function so as to facilitate the subsequent searching of the corresponding file;
based on the above embodiment, the method further includes:
s2, acquiring a corresponding stub function according to the function name of the test function, and extracting constraint conditions in the stub function;
s21, obtaining a corresponding stub function according to the function name, and searching a stub function file corresponding to the stub function from the key value pair dictionary map;
s22, generating a first user generated file xoutput.c and a first user written file xnewWriter.cpp according to the stub function file;
s23, performing unit test for the pile function to generate a first test case meeting branch coverage;
s24, extracting constraint conditions from the first test case.
S25, creating an intermediate file according to the constraint condition;
s26, compiling a first instance write file xnewwriter.cpp to generate an instance write execution file xnewWriter;
s27, writing the first test case into the intermediate file by the execution case writing execution file xnewWriter.
Based on the above embodiment, the method further includes:
s3, reversely aggregating the constraint conditions into a top test function based on a top constraint direction aggregation method to generate a new use case generation file;
s31, generating a second use case generation file output.c and a second use case writing file newWriter.cpp for the dictionary map according to the function name and key value of the test function, wherein the output.c is used for generating the test case, and the newWriter.cpp is used for writing the use case;
s32, traversing a second use case to generate a stub function used in the file output.c, extracting a first test case in an intermediate file, sequentially establishing corresponding template character strings for the stub function according to the use condition of the first test case, marking the input parameter and the return value by using the same marking bit in each character string template until a template list is generated for each stub function;
the top-level constraint reverse aggregation method is to insert constraints collected by the stub functions of the bottom layer into different constraint conditions according to different modes of using the bottom-level functions by the top layer, so that the top-level test functions have paths containing the constraints of the bottom-level functions. For the use cases of the bottom layer functions, the specific use cases of the stub functions include the following three types:
1) The newly declared variable is assigned to the return value after the function return value is obtained. For this case, a variable declaration is inserted in advance before branch expansion, and in the branch statement, the variable is assigned according to the value of each test case.
2) No new variable is declared, and in contrast to the first case, the variable is not declared when the function returns, so the instrumentation of the first case can be replicated, but there is no need to insert a variable declaration before the branch is opened.
3) Instead of using a function return value, this case requires the arbitrary addition of a code that is irrelevant to the program execution in order to ensure that the branch's unwinding is not automatically optimized by the compiler.
In this embodiment, constraint pile-inserting strings of the top-level design are created for each use situation of the pile function, so that path expansion of the top-level design is achieved, and constraint conditions of the bottom-level design are carried while traversing paths for the top-level design.
S33, declaring a key value pair object of a plurality of template character strings, combining the plurality of template character strings into an array and adding the array into the key value pair object, wherein keys are function names, and the values are three character strings;
s34, traversing a second use case write-in file newWriter.cpp, judging whether a pile function call exists, and generating a new use case generation file newutput.c according to a call result;
specifically, the step S34 includes:
traversing each line of sentences of the second use case writing file, and judging whether the sentences of the current line have the calling of the stub function or not:
if so, acquiring the use condition of a second use case write file newWriter.cpp on the stub function, and selecting a matched template character string according to the use condition;
replacing the stub function with a flag bit in the matched template character string, and writing the flag bit into a new use case generation file;
if not, writing the statement of the current line into a new use case generation file new.
Based on the above embodiment, the method further includes:
s4, generating a second test case for the new case generation file, taking the initial test case file as a template, writing the second test case into the new test case file to obtain a final test case file, wherein the method comprises the following steps of:
s41, compiling the new use case generation file into a first executable file and a binary file;
s42, inputting the binary file into a Klee tool to generate a second test case meeting the coverage of the branch;
s43, compiling the second test case writing file into a second executable file, and executing the second executable file to write the second test case into a new test case file according to the first executable file by taking the initial test case file as a template to obtain a final test case file, wherein the final test case file is stored in a tcf format;
in the embodiment, the Testbed software and the test cases are combined, so that the generated test cases are output to the tcf file, the case checking interface of the Testbed software is supported, and the case management cost of the testers is reduced.
In the embodiment, the test case generated for the top layer design in the way of designing the extension path for the top layer not only meets the branch coverage of the bottom layer design, but also meets the requirement of maximizing the interface calling rate in 3 layers of calling in the integrated test of the rail transit signal control system.
Example 2:
as shown in fig. 3, the present embodiment provides an automatic generating device for an integrated test case, where the device includes:
the acquisition module is used for: the method comprises the steps of obtaining an initial use case file, obtaining function names and paths of test functions to be integrated from the initial use case file, and establishing a key value pair dictionary according to the function names and paths;
and an extraction module: the method comprises the steps of obtaining corresponding stub functions according to function names of test functions, and extracting constraint conditions in the stub functions;
reverse aggregation module: the constraint condition is reversely aggregated into a top-level test function based on a top-level constraint direction aggregation method, and a new use case generation file is generated;
and a writing module: and the method is used for generating a second test case for the new case generation file, writing the second test case into the new test case file by taking the initial test case file as a template to obtain a final test case file.
Based on the above embodiments, the extraction module includes:
and a searching unit: the method comprises the steps of obtaining corresponding stub functions according to function names, and searching stub function files corresponding to the stub functions from a key value pair dictionary;
a first generation unit: the method comprises the steps of generating a first user generation file and a first user writing file according to the stub function file;
a second generation unit: the test method comprises the steps of performing unit test for a stub function to generate a first test case meeting branch coverage;
extraction unit: and extracting constraint conditions from the first test case.
Based on the above embodiments, the reverse aggregation module includes:
a third generation unit: generating a second use case generation file and a second use case writing file for the dictionary according to the function name and the key value of the test function;
the establishing unit: the method comprises the steps of traversing a stub function used in a second case generation file, acquiring a first test case, and establishing various template character strings for the stub function according to the use condition of the first test case;
statement unit: the key value pair object is used for declaring the various template character strings, and the various template character strings are combined into an array and added into the key value pair object;
a first judgment unit: the method comprises the steps of traversing a second use case writing file, judging whether a stub function call exists or not, and generating a new use case generating file according to a call result;
specifically, the first judging unit includes:
traversing unit: and traversing each line of sentences of the second use case writing file, and judging whether the sentences of the current line have the calling of the stub function or not:
if so, acquiring the use condition of the second use case writing file on the stub function, and selecting a matched template character string according to the use condition;
replacement unit: the method comprises the steps of replacing a stub function with a flag bit in a matched template character string, and writing a new use case generation file;
if not, writing the statement of the current line into the new use case generation file.
Based on the above embodiments, the writing module includes:
a compiling unit: compiling the new use case generation file into a first executable file and a binary file;
fourth generation unit: the binary file is used as input into a Klee tool to generate a second test case meeting the coverage of the branch;
a writing unit: and compiling the second test case writing file into a second executable file, and executing the second executable file to write the second test case into a new test case file according to the first executable file by taking the initial test case file as a template to obtain a final test case file.
It should be noted that, regarding the apparatus in the above embodiments, the specific manner in which the respective modules perform the operations has been described in detail in the embodiments regarding the method, and will not be described in detail herein.
Example 3:
corresponding to the above method embodiment, an automatic generating device for an integrated test case is further provided in this embodiment, and an automatic generating device for an integrated test case described below and an automatic generating method for an integrated test case described above may be referred to correspondingly with each other.
FIG. 4 is a block diagram of an automatic generation device 800 for integrated test cases, shown in accordance with an exemplary embodiment. As shown in fig. 4, the automatic generation device 800 of the integrated test case may include: a processor 801, a memory 802. The automatic generation device 800 of integrated test cases may also include one or more of a multimedia component 803, an I/O interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the automatic generating device 800 for an integrated test case, so as to complete all or part of the steps in the above-mentioned automatic generating method for an integrated test case. The memory 802 is used to store various types of data to support the operation of the automatic generation device 800 at the integrated test case, which may include, for example, instructions for any application or method operating on the automatic generation device 800 at the integrated test case, as well as application-related data, such as contact data, messages sent and received, pictures, audio, video, and so forth. The Memory 802 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted through the communication component 805. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is configured to perform wired or wireless communication between the automatic generation device 800 of the integrated test case and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near FieldCommunication, NFC for short), 2G, 3G or 4G, or a combination of one or more thereof, the respective communication component 805 may thus comprise: wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the automatic generation device 800 of the integrated test case may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), digital signal processor (DigitalSignal Processor, abbreviated as DSP), digital signal processing device (Digital Signal Processing Device, abbreviated as DSPD), programmable logic device (Programmable Logic Device, abbreviated as PLD), field programmable gate array (Field Programmable Gate Array, abbreviated as FPGA), controller, microcontroller, microprocessor, or other electronic component for performing the above-described automatic generation method of the integrated test case.
In another exemplary embodiment, a computer readable storage medium is also provided that includes program instructions that, when executed by a processor, implement the steps of the method for automatically generating integrated test cases described above. For example, the computer readable storage medium may be the memory 802 described above including program instructions executable by the processor 801 of the integrated test case automatic generation device 800 to perform the integrated test case automatic generation method described above.
Example 4:
corresponding to the above method embodiment, a readable storage medium is further provided in this embodiment, and a readable storage medium described below and an automatic generation method of an integrated test case described above may be referred to correspondingly.
A readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for automatically generating an integrated test case of the method embodiment described above.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, and the like.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (8)

1. An automatic generation method of an integrated test case is characterized by comprising the following steps:
acquiring an initial use case file, acquiring function names and paths of test functions to be integrated from the initial use case file, and establishing a key value pair dictionary according to the function names and paths;
obtaining a corresponding stub function according to the function name of the test function, and extracting constraint conditions in the stub function;
reversely aggregating the constraint condition into a top test function based on a top constraint reverse aggregation method to generate a new use case generation file, wherein the method comprises the following steps:
generating a second use case generation file and a second use case writing file for the dictionary according to the function name and the key value of the test function;
traversing a stub function used in the second use case generation file, acquiring a first test use case generated by the stub function, and establishing various template character strings for the stub function according to the use condition of the first test use case;
declaring a key value pair object of a plurality of template character strings, combining the plurality of template character strings into an array and adding the array into the key value pair object;
traversing the second use case writing file, judging whether the calling of the stub function exists, and generating a new use case generating file according to the calling result;
the top-level constraint reverse aggregation method is to insert constraints collected by the stub functions of the bottom layer into different constraint conditions according to different modes of using the bottom-level functions by the top layer, so that the top-level test functions have paths containing the constraints of the bottom-level functions;
the use cases of the pile function include: assigning the newly declared variable to the return value after the function return value is obtained, not declaring the new variable, and not using the function return value;
generating a second test case for the new case generation file, taking the initial test case file as a template, and writing the second test case into the new test case file to obtain a final test case file.
2. The method for automatically generating an integrated test case according to claim 1, wherein obtaining the corresponding stub function according to the function name, extracting constraint conditions in the stub function, comprises:
obtaining a corresponding stub function according to the function name, and searching a stub function file corresponding to the stub function from the key value pair dictionary;
generating a first user generation file and a first user writing file according to the stub function file;
performing unit testing for the stub function to generate a first test case meeting the coverage of the branch;
and extracting constraint conditions from the first test case.
3. The method for automatically generating integrated test cases according to claim 1, wherein generating a second test case for the new test case generation file, writing the second test case into the new test case file with the initial test case file as a template, comprises:
compiling the new use case generation file into a first executable file and a binary file;
inputting the binary file into a Klee tool to generate a second test case meeting the coverage of the branch;
compiling the second test case writing file into a second executable file, and executing the second executable file to write the second test case into a new test case file according to the first executable file by taking the initial test case file as a template to obtain a final test case file.
4. An automatic generation device for an integrated test case, comprising:
the acquisition module is used for: the method comprises the steps of obtaining an initial use case file, obtaining function names and paths of test functions to be integrated from the initial use case file, and establishing a key value pair dictionary according to the function names and paths;
and an extraction module: the method comprises the steps of obtaining corresponding stub functions according to function names of test functions, and extracting constraint conditions in the stub functions;
reverse aggregation module: the method is used for reversely aggregating the constraint conditions into a top-level test function based on a top-level constraint reverse aggregation method to generate a new use case generation file, and comprises the following steps:
generating a second use case generation file and a second use case writing file for the dictionary according to the function name and the key value of the test function;
traversing a stub function used in the second use case generation file, acquiring a first test use case generated by the stub function, and establishing various template character strings for the stub function according to the use condition of the first test use case;
declaring a key value pair object of a plurality of template character strings, combining the plurality of template character strings into an array and adding the array into the key value pair object;
traversing the second use case writing file, judging whether the calling of the stub function exists, and generating a new use case generating file according to the calling result;
the top-level constraint reverse aggregation method is to insert constraints collected by the stub functions of the bottom layer into different constraint conditions according to different modes of using the bottom-level functions by the top layer, so that the top-level test functions have paths containing the constraints of the bottom-level functions;
the use cases of the pile function include: assigning the newly declared variable to the return value after the function return value is obtained, not declaring the new variable, and not using the function return value;
and a writing module: and the method is used for generating a second test case for the new case generation file, writing the second test case into the new test case file by taking the initial test case file as a template to obtain a final test case file.
5. The apparatus for automatically generating integrated test cases according to claim 4, wherein the extracting module comprises:
and a searching unit: the method comprises the steps of obtaining corresponding stub functions according to function names, and searching stub function files corresponding to the stub functions from a key value pair dictionary;
a first generation unit: the method comprises the steps of generating a first user generation file and a first user writing file according to the stub function file;
a second generation unit: the test method comprises the steps of performing unit test for a stub function to generate a first test case meeting branch coverage;
extraction unit: and extracting constraint conditions from the first test case.
6. The apparatus for automatically generating integrated test cases according to claim 4, wherein the writing module comprises:
a compiling unit: compiling the new use case generation file into a first executable file and a binary file;
fourth generation unit: the binary file is used as input into a Klee tool to generate a second test case meeting the coverage of the branch;
a writing unit: and compiling the second test case writing file into a second executable file, and executing the second executable file to write the second test case into a new test case file according to the first executable file by taking the initial test case file as a template to obtain a final test case file.
7. An automatic generation device for an integrated test case, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for automatically generating an integrated test case according to any one of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium, characterized by: the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method for automatically generating an integrated test case according to any one of claims 1 to 3.
CN202310872720.6A 2023-07-17 2023-07-17 Automatic generation method, device, equipment and medium for integrated test cases Active CN116594915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310872720.6A CN116594915B (en) 2023-07-17 2023-07-17 Automatic generation method, device, equipment and medium for integrated test cases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310872720.6A CN116594915B (en) 2023-07-17 2023-07-17 Automatic generation method, device, equipment and medium for integrated test cases

Publications (2)

Publication Number Publication Date
CN116594915A CN116594915A (en) 2023-08-15
CN116594915B true CN116594915B (en) 2023-09-29

Family

ID=87612058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310872720.6A Active CN116594915B (en) 2023-07-17 2023-07-17 Automatic generation method, device, equipment and medium for integrated test cases

Country Status (1)

Country Link
CN (1) CN116594915B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407973A (en) * 2014-11-25 2015-03-11 珠海格力电器股份有限公司 Automatic unit test realizing method and device
CN109086215A (en) * 2018-10-18 2018-12-25 北京轩宇信息技术有限公司 A kind of embedded software unit testing case generation method and system
EP3547144A1 (en) * 2018-03-26 2019-10-02 Mitsubishi Electric Corporation Structural tests generation
CN114048130A (en) * 2021-11-11 2022-02-15 上海复深蓝软件股份有限公司 Unit testing method, unit testing device, computer equipment and storage medium
CN115248780A (en) * 2022-08-23 2022-10-28 浙江网商银行股份有限公司 Interface test case generation method and device
CN115952561A (en) * 2023-03-14 2023-04-11 北京全路通信信号研究设计院集团有限公司 Data processing method, device, equipment and medium applied to rail transit system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407973A (en) * 2014-11-25 2015-03-11 珠海格力电器股份有限公司 Automatic unit test realizing method and device
EP3547144A1 (en) * 2018-03-26 2019-10-02 Mitsubishi Electric Corporation Structural tests generation
CN109086215A (en) * 2018-10-18 2018-12-25 北京轩宇信息技术有限公司 A kind of embedded software unit testing case generation method and system
CN114048130A (en) * 2021-11-11 2022-02-15 上海复深蓝软件股份有限公司 Unit testing method, unit testing device, computer equipment and storage medium
CN115248780A (en) * 2022-08-23 2022-10-28 浙江网商银行股份有限公司 Interface test case generation method and device
CN115952561A (en) * 2023-03-14 2023-04-11 北京全路通信信号研究设计院集团有限公司 Data processing method, device, equipment and medium applied to rail transit system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Nekara: Generalized Concurrency Testing;Udit Agarwal等;《2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)》;1-13 *
基于函数调用关系的集成测试方法研究;费克雄;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-420 *
基于符号化执行的测试用例自动生成方法研究;任瑞国;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-480 *
轨道交通信号测试技术发展研究;付立民;《铁路通信信号工程技术》;111-116 *

Also Published As

Publication number Publication date
CN116594915A (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN102831052B (en) Test exemple automation generating apparatus and method
CN108897724B (en) Function completion progress determining method and device
CN102760096B (en) The generation method of test data, unit test method and unit test system
CN104572043A (en) Method and device for embedding points for controls of client application in real time
CN105094783A (en) Method and device for testing Android application stability
CN110008744B (en) Data desensitization method and related apparatus
CN102567201A (en) Method for automatically recovering cross-model GUI (graphic user interface) test scripts
CN109740122A (en) The conversion method and device of mind map use-case file
CN111930617B (en) Automatic test method and device based on data objectification
US6763360B2 (en) Automated language and interface independent software testing tool
CN112035376A (en) Method, device, equipment and storage medium for generating coverage rate report
CN113094029A (en) Automatic CAPL code generation method and system and automobile
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
US11249880B1 (en) Debugging and simulating application runtime execution
CN116594915B (en) Automatic generation method, device, equipment and medium for integrated test cases
CN113746840A (en) JSON format message generation method and device
CN104699745A (en) Voice output device and voice output method
CN111736815A (en) Test file script modular development tool, system and method
CN108287788A (en) A kind of use-case step matching method based on test case, system
Li et al. Soncraft: A tool for construction, simulation, and analysis of structured occurrence nets
JP2013077124A (en) Software test case generation device
CN105279074A (en) Method and device for displaying log information on terminal through NSLog
JP2013029999A (en) Test code generation device, test code generation method, and test code generation program
CN113419959A (en) Method and equipment for generating coverage rate verification report
CN103164526A (en) Generation method and generation device of test report

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant