Input box function test method and device, equipment, storage medium and program product

Through the combination of dynamically generated test case templates and automated testing tools, the problem of insufficient comprehensive test cases in input box functional tests is solved, the test coverage and efficiency are improved, and detailed test reports and repair suggestions are provided.

CN119088680APending Publication Date: 2024-12-06STATE GRID INFORMATION & TELECOMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411085451.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The test cases in the input box functional test are not comprehensive enough, and it is difficult to meet the testing needs of complex input boxes. The test coverage is low, and automated testing tools are difficult to dynamically generate comprehensive test cases. Static code analysis cannot dynamically detect the potential caused by user input. question.

Method used

By obtaining a pre-built test data pool, dynamically generate unconditional, single-condition and combined condition test case templates, use automated testing tools to simulate user operations, analyze test results, provide repair and improvement suggestions, and generate detailed test reports.

Benefits of technology

It improves the coverage of tests, meets the testing needs of complex input boxes, reduces the workload of manually writing and maintaining test scripts, improves testing efficiency, and provides detailed problem location and repair suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088680A_ABST
    Figure CN119088680A_ABST
Patent Text Reader

Abstract

The invention provides an input box function test method and device, equipment, a storage medium and a program product, and the method comprises the steps: obtaining a test data pool which comprises an input specification; dynamically generating an unconditional test case template, a single-condition test case template and a combined-condition test case template based on the test data pool; filling the target data into the test case template to obtain a test case; simulating user operation through an automatic test tool to obtain a test result corresponding to the test case; analyzing the test result to obtain an input box problem and a test case problem; analyzing the input box problem to obtain a repair suggestion, and analyzing the test case problem to obtain a perfection suggestion; and generating a test report corresponding to the to-be-tested input box. According to the method and the device, the relatively comprehensive test case template is dynamically generated based on the relatively comprehensive test data pool, so that the relatively comprehensive test case is generated, the test coverage rate is increased, and the test requirement of a relatively complicated input box can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software testing technology, and in particular to an input box function testing method, device, equipment, storage medium and program product. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] As an important interface for human-computer interaction, input boxes are widely used in various systems and applications, from simple website searches to complex enterprise-level data queries, data entry, and modifications.

[0004] With the increase of user demands and the complexity of system functions, the functions related to input boxes are also constantly evolving, so the testing of input boxes is becoming more and more complex.

[0005] However, in the related art, when testing input boxes, the generated test cases are not comprehensive enough and it is difficult to meet the testing requirements of complex input boxes. Summary of the invention

[0006] In view of this, the purpose of the present disclosure is to propose an input box function testing method, device, equipment, storage medium and program product, which at least to a certain extent solve one of the technical problems in the related art.

[0007] Based on the above purpose, the first aspect of the exemplary embodiment of the present disclosure provides an input box function testing method, including:

[0008] Obtaining a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process;

[0009] Based on the test data pool, dynamically generate unconditional test case templates, single condition test case templates and combined condition test case templates;

[0010] Acquire target data from a target application scenario, and fill the target data into the unconditional test case template, the single condition test case template, and the combined condition test case template to obtain a test case;

[0011] Simulate user operations through an automated testing tool, input the test case into the input box to be tested, and submit it to obtain the test result corresponding to the test case;

[0012] Analyze the test results to obtain input box problems corresponding to the input boxes to be tested and test case problems corresponding to the test cases;

[0013] Analyze the input box problem to obtain repair suggestions corresponding to the input box problem, and analyze the test case problem to obtain improvement suggestions corresponding to the test case problem;

[0014] A test report corresponding to the input box to be tested is generated based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

[0015] Based on the same inventive concept, a second aspect of the exemplary embodiment of the present disclosure provides an input box function testing device, comprising:

[0016] A test data pool acquisition module is configured to acquire a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process;

[0017] A test case template generation module is configured to dynamically generate an unconditional test case template, a single condition test case template and a combined condition test case template based on the test data pool;

[0018] A test case generation module is configured to obtain target data from a target application scenario, fill the target data into the unconditional test case template, the single condition test case template and the combined condition test case template, and obtain a test case;

[0019] The test module is configured to simulate user operations through an automated testing tool, input the test case into an input box to be tested, and submit it to obtain a test result corresponding to the test case;

[0020] A test result analysis module is configured to analyze the test result to obtain the input box problem corresponding to the input box to be tested and the test case problem corresponding to the test case;

[0021] A problem analysis module is configured to analyze the input box problem to obtain a repair suggestion corresponding to the input box problem, and to analyze the test case problem to obtain a completion suggestion corresponding to the test case problem;

[0022] The test report generation module is configured to generate a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

[0023] Based on the same inventive concept, a third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.

[0024] Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.

[0025] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method described in the first aspect.

[0026] As can be seen from the above, the input box function testing method, device, equipment, storage medium and program product provided by the embodiments of the present disclosure include: obtaining a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include test type, specification description, input example and output processing; based on the test data pool, dynamically generating unconditional test case templates, single condition test case templates and combined condition test case templates; obtaining target data from a target application scenario, and filling the target data into the unconditional test case templates, the single condition test case templates and the combined condition test case templates to obtain test cases; and automatically generating a test case template by The test tool simulates user operations, inputs the test case into the input box to be tested, and submits it to obtain the test result corresponding to the test case; analyzes the test result to obtain the input box problem corresponding to the input box to be tested and the test case problem corresponding to the test case; analyzes the input box problem to obtain the repair suggestion corresponding to the input box problem, analyzes the test case problem to obtain the improvement suggestion corresponding to the test case problem; based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion, generates a test report corresponding to the input box to be tested. The present disclosure is based on a more comprehensive test data pool, dynamically generates more comprehensive unconditional test case templates, single condition test case templates and combined condition test case templates to generate more comprehensive test cases, improves the test coverage, and can meet the testing requirements of more complex input boxes. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 A schematic diagram of an application scenario of the input box function testing method provided by an exemplary embodiment of the present disclosure;

[0029] Figure 2 A schematic diagram of a flow chart of an input box function testing method provided by an exemplary embodiment of the present disclosure;

[0030] Figure 3 A schematic diagram of a structure of an input box function testing device provided by an exemplary embodiment of the present disclosure;

[0031] Figure 4 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, usage scenarios, etc. of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0033] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present application according to the prompt message.

[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of the present application. Other methods that meet the relevant laws and regulations may also be applied to the implementation method of the present application.

[0036] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0037] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, the principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0038] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0039] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "a" before an element does not exclude the existence of multiple such elements.

[0040] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0041] As described in the background technology, with the advent of the Internet and the era of big data, the generation and processing of data has become unprecedentedly large and fast. The search function has become a key tool for users to efficiently obtain the required information. As an important interface for human-computer interaction, the input box is widely used in various systems and applications, from simple website searches to complex enterprise-level data queries, data entry and modification.

[0042] In the early days, the functions involving input boxes were relatively simple, mainly single-condition query or data entry, that is, the user entered a keyword and the system returned results related to the keyword. However, with the increase in user needs and the complexity of system functions, the functions involving input boxes are also constantly evolving. Now the functions involving input boxes include multi-condition combination query, unconditional query, data entry, data modification, and intelligent search.

[0043] In addition, functions involving input boxes need to interact frequently with the database, especially in a big data environment. This interaction brings huge data processing and security challenges. For example, special characters and keywords entered by users may cause SQL injection and cross-site scripting (XSS), which are common security risks. Therefore, the testing and verification of functions involving input boxes has become increasingly important and complex.

[0044] In the related technologies, the functional testing technologies involving input boxes mainly include the following:

[0045] Manual testing: Testers manually input various conditions for testing based on experience and test cases. This method is time-consuming and labor-intensive, and it is easy to miss special cases.

[0046] Automated testing tools: Some tools such as Selenium and JMeter can be used to simulate user input and capture responses. However, these tools usually require writing a lot of scripts and it is difficult to dynamically generate all possible test cases.

[0047] Static code analysis: detects potential problems in advance by analyzing possible security vulnerabilities in the code, such as SQL injection, XSS, etc. This method cannot cover all possible user input situations.

[0048] However, the inventors of the present disclosure have found that the above functional testing technology involving the input box has the following disadvantages:

[0049] Disadvantages of manual testing: low test coverage, easy to miss special characters and boundary conditions, time-consuming and inefficient.

[0050] Disadvantages of automated testing tools: a large number of scripts need to be written, high maintenance costs, difficulty in dynamically generating comprehensive test cases, and inability to fully detect security vulnerabilities.

[0051] Disadvantages of static code analysis: It can only detect security vulnerabilities in static code and cannot dynamically detect potential problems caused by user input.

[0052] In order to solve the above problems, the present disclosure provides an input box function testing solution, which specifically includes: obtaining a pre-built test data pool, wherein the test data pool includes several input specifications, and the input specifications include test type, specification description, input example and output processing; based on the test data pool, dynamically generating an unconditional test case template, a single condition test case template and a combined condition test case template; obtaining target data from a target application scenario, and filling the target data into the unconditional test case template, the single condition test case template and the combined condition test case template to obtain a test case; simulating user operations through an automated testing tool, inputting the test case into an input box to be tested, and submitting it to obtain a test result corresponding to the test case; analyzing the test result to obtain an input box problem corresponding to the input box to be tested and a test case problem corresponding to the test case; analyzing the input box problem to obtain a repair suggestion corresponding to the input box problem, and analyzing the test case problem to obtain a perfection suggestion corresponding to the test case problem; generating a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the perfection suggestion.

[0053] The present invention is based on a more comprehensive test data pool, dynamically generates more comprehensive unconditional test case templates, single condition test case templates and combined condition test case templates to generate more comprehensive test cases, improve the test coverage, and meet the testing requirements of more complex input boxes.

[0054] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0055] refer to Figure 1 , which is a schematic diagram of an application scenario of the input box function testing method provided by an exemplary embodiment of the present disclosure.

[0056] This application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 may be connected via a wired or wireless communication network to achieve data interaction.

[0057] The terminal device 101 may be an electronic device with data transmission and multimedia input / output functions close to the user side, including but not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The electronic device may include a processor and a display screen with a touch input function, the display screen is used to present a graphical user interface, the graphical user interface can display an application interface, and the processor is used to process application data, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0058] Server 102 and data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0059] In specific implementation, server 102 is used to provide input box function testing service to users of terminal device 101. Terminal device 101 is installed with a client that communicates with server 102. The user can specify the input box to be tested through the client, and the client sends the information of the input box to be tested to server 102. The server 102 obtains a pre-built test data pool, which includes several input specifications, including test type, specification description, input example and output processing; based on the test data pool, dynamically generates an unconditional test case template, a single condition test case template and a combined condition test case template; obtains target data from a target application scenario, fills the target data into the unconditional test case template, the single condition test case template and the combined condition test case template to obtain a test case; simulates user operations through an automated testing tool, inputs the test case into the input box to be tested, and submits it to obtain a test result corresponding to the test case; analyzes the test results to obtain input box problems corresponding to the input box to be tested and test case problems corresponding to the test case; analyzes the input box problems to obtain repair suggestions corresponding to the input box problems, analyzes the test case problems to obtain improvement suggestions corresponding to the test case problems; generates a test report corresponding to the input box to be tested based on the test case, test results, input box problems, test case problems, repair suggestions and improvement suggestions. The server 102 sends the test report to the client, and the client displays the test report to the user to help the user repair the input box and improve the test case.

[0060] The data storage system 103 is used to store a pre-built test data pool, which includes a number of input specifications, including test type, specification description, input example and output processing. The server 102 is also used to improve the test data pool based on the test report.

[0061] Combine the following Figure 1 The input box function testing method according to the exemplary embodiment of the present disclosure is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0062] refer to Figure 2 , which is a flow chart of an input box function testing method provided by an exemplary embodiment of the present disclosure.

[0063] The input box function testing method includes the following steps:

[0064] Step S210: Acquire a pre-built test data pool, wherein the test data pool includes a number of input specifications, and the input specifications include a test type, a specification description, an input example, and an output process.

[0065] During the specific implementation, the test type, specification description, input example and output processing of each input specification are pre-defined.

[0066] In this exemplary embodiment, the test types include:

[0067] Boundary values, special characters, numbers, required fields, dates, times, file types, SQL injections, cross-site scripting attacks (XSS attacks), etc.

[0068] In specific implementation, the following are some exemplary test types, specification descriptions, input examples, and output processing examples of input specifications:

[0069] 1. Boundary value test:

[0070] Specification: Tests the minimum and maximum values ​​of the input and the values ​​in between.

[0071] Input example: If a field accepts integers from 1 to 100, the test data should include 0,1,100,101.

[0072] Output processing: Verify that the software can handle boundary values ​​correctly without crashing or generating errors.

[0073] 2. Special character test:

[0074] Specification Note: The test input contains special characters, such as spaces, quotation marks, escape characters, etc.

[0075] Input examples: "John Doe", "O'Reilly", "Mr. & Mrs. Smith".

[0076] Output processing: Ensure that the software can correctly parse and display special characters without generating errors or exceptions.

[0077] 3. Numerical test:

[0078] Specification: Test input is a numeric value, including positive, negative, zero, and decimals.

[0079] Input example: 123,-123,0,123.45.

[0080] Output processing: Verify that values ​​are processed correctly without overflow or loss of precision.

[0081] 4. Required test:

[0082] Specification: Test the behavior of the software when the user does not fill in a required field.

[0083] Input Example: Submitting a form with some required fields left blank.

[0084] Output processing: The software should prompt the user to fill in the required fields and should not allow submission.

[0085] 5. Date and time test:

[0086] Specification: Tests the format, validity, and logic of dates and times.

[0087] Input example: 2024-07-29,29 / 07 / 2024,12:00AM,23:59PM.

[0088] Output processing: Verify that the date and time format is correct and logically reasonable (such as the time should be between midnight and midnight).

[0089] 6. File type test:

[0090] Specification description: Test whether the type of uploaded file meets the expected requirements.

[0091] Input example: Upload a .jpg file and try to upload a .exe file.

[0092] Output handling: Ensure that only allowed file types can be uploaded and other types should be rejected.

[0093] 7.SQL injection test:

[0094] Specification Description: Test input of malicious SQL code to verify the system's defense capabilities.

[0095] Input example: Enter 'OR'1'='1' in the User Name field.

[0096] Output processing: The system should prevent SQL injection attacks and not execute malicious SQL code.

[0097] 8.XSS attack test:

[0098] Specification Description: Test input of malicious scripts to verify the system's XSS protection.

[0099] Input example: Enter in the comment field <script>alert('XSS');< / script> .

[0100] Output processing: The system should perform input sanitization to prevent XSS attacks and not execute malicious scripts.

[0101] 9. Null value test:

[0102] Specification: Tests for empty input.

[0103] Input example: Leave all input fields blank.

[0104] Output processing: Verify the software's handling of null values ​​to ensure that it does not cause errors or exceptions.

[0105] 10. Long text test:

[0106] Specification: Test for text that exceeds the expected length when inputted.

[0107] Input example: Enter text that exceeds the maximum length limit in the text box.

[0108] Output processing: Verify that the software can properly process or truncate long texts without causing performance issues.

[0109] The test data pool created by the above exemplary embodiments basically covers all possible input situations, including normal situations and abnormal situations, thereby improving the quality and safety of the test.

[0110] Step S220: Based on the test data pool, dynamically generate an unconditional test case template, a single condition test case template and a combined condition test case template.

[0111] In this exemplary embodiment, the method of dynamically generating an unconditional test case template, a single condition test case template, and a combined condition test case template based on the test data pool includes:

[0112] Based on the test data pool, determining the function to be tested corresponding to the input box to be tested;

[0113] Based on the function to be tested, determining a test condition that affects the function to be tested;

[0114] Based on each of the to-be-tested functions that do not have a corresponding test condition, generating the unconditional test case template;

[0115] Based on each of the test conditions, generate the single condition test case template;

[0116] A test condition combination is generated based on the test condition, and the combination condition test case template is generated based on each of the test condition combinations.

[0117] In specific implementation, the unconditional test case template does not depend on any specific conditions and is applicable to all test scenarios.

[0118] As a concrete example, the unconditional test case template:

[0119] Test case ID: UC_<test point>

[0120] Test point: <test point description>

[0121] Prerequisites: None

[0122] Test steps:

[0123] 1. Perform <operation> 2....

[0125] Expected result: <expected result description>

[0126] Actual result: [to be tested]

[0127] Passed: [To be tested]

[0128] Remarks: None

[0129] When implemented, the single condition test case template focuses on testing a specific condition.

[0130] As a concrete example, a single conditional test case template:

[0131] Test case ID: SC_<test point>_<condition>

[0132] Test point: <test point description>

[0133] Precondition: <condition>

[0134] Test steps:

[0135] 1. Set <condition variable> to <condition value>

[0136] 2. Perform <operation> 3....

[0138] Expected result: <expected result description>

[0139] Actual result: [to be tested]

[0140] Passed: [To be tested]

[0141] Remarks: <Remarks>

[0142] In specific implementation, the combined condition test case template is used to test the combined effect of multiple conditions.

[0143] As a specific example, the combined conditional test case template:

[0144] Test case ID: CC_<test point>_<condition 1>_<condition 2>_...

[0145] Test point: <test point description>

[0146] Preconditions: <Condition 1 Precondition>, <Condition 2 Precondition>,...

[0147] Test steps:

[0148] 1. Set <condition variable 1> to <condition value 1>

[0149] 2. Set <condition variable 2> to <condition value 2>

[0150] 3. Perform <operation> 4....

[0152] Expected result: <expected result description>

[0153] Actual result: [to be tested]

[0154] Passed: [To be tested]

[0155] Remarks: <Remarks>

[0156] In this exemplary embodiment, based on the test data pool, a combined condition test case template is dynamically generated, including:

[0157] All combination conditions in the test data pool are traversed through a combination generation algorithm to dynamically generate the combination condition test case template.

[0158] The specific implementation includes the following steps:

[0159] Determine test points: Determine the software functional points that need to be tested.

[0160] List all conditions: List all conditions that may affect the test point.

[0161] Generate Single Condition Test Cases: Generates a single condition test case for each condition.

[0162] Generate combination conditions: Use an algorithm (such as the power set generation algorithm) to generate all possible combinations of conditions.

[0163] Generate combined condition test cases: Generate combined condition test cases for each combination.

[0164] Execute tests: Execute all generated test cases and record the results.

[0165] Through the above exemplary embodiments, all possible condition combinations can be generated, and a test case can be created for each combination, thereby improving the comprehensiveness and systematicness of the test.

[0166] Step S230: Acquire target data from a target application scenario, and fill the target data into the unconditional test case template, the single condition test case template, and the combined condition test case template to obtain a test case.

[0167] During the specific implementation, the actual application scenario is combined to fill in specific input data, such as boundary values, field allowed input types, etc., to form specific test cases.

[0168] As a specific example, let's take the username test case as an example:

[0169] Unconditional test case:

[0170] Test case ID:UC_USERNAME

[0171] Test point: User name input

[0172] Prerequisites: None

[0173] Test steps:

[0174] 1. Enter "admin" in the Username field

[0175] 2. Submit the form

[0176] Expected result: The form passes validation

[0177] Actual result: [to be tested]

[0178] Passed: [To be tested]

[0179] Remarks: None

[0180] Single condition test case:

[0181] Test case ID: SC_USERNAME_EMPTY

[0182] Test point: Username is empty

[0183] Prerequisites: None

[0184] Test steps:

[0185] 1. Leave the Username field blank

[0186] 2. Submit the form

[0187] Expected result: Form validation fails, prompting "Username cannot be empty"

[0188] Actual result: [to be tested]

[0189] Passed: [To be tested]

[0190] Note: Check the required fields for verification

[0191] Single condition test case:

[0192] Test case ID: SC_USERNAME_INVALID

[0193] Test point: Username contains illegal characters

[0194] Prerequisites: None

[0195] Test steps:

[0196] 1. Enter "admin@" in the Username field

[0197] 2. Submit the form

[0198] Expected result: Form validation fails, prompting "Username can only contain letters and numbers"

[0199] Actual result: [to be tested]

[0200] Passed: [To be tested]

[0201] Note: Check character type validation

[0202] Combined condition test case:

[0203] Test case ID: CC_USERNAME_EMPTY_PASSWORD_SHORT

[0204] Test point: Username is empty and password is shorter than 8 characters

[0205] Prerequisites: None

[0206] Test steps:

[0207] 1. Leave the Username field blank

[0208] 2. Enter "1234" in the password field

[0209] 3. Submit the form

[0210] Expected result: Form validation fails, prompting "Username cannot be empty" and "Password must be at least 8 characters long"

[0211] Actual result: [to be tested]

[0212] Passed: [To be tested]

[0213] Note: Check required fields and password length verification

[0214] Step S240: Simulate user operations through an automated testing tool, input the test case into an input box to be tested, and submit it to obtain a test result corresponding to the test case.

[0215] In this exemplary embodiment, simulating user operations through an automated testing tool, inputting the test case into an input box to be tested, and submitting the test case includes:

[0216] Based on the application type corresponding to the input box to be tested, the automated testing tool is selected, user operations are simulated by the selected automated testing tool, the test case is input into the input box to be tested, and the test case is submitted;

[0217] The application types include web applications, desktop applications, and mobile applications.

[0218] In specific implementation, the automated testing tool is selected based on the application type corresponding to the input box to be tested, for example:

[0219] For web applications: Selenium, Playwright, Cypress;

[0220] For desktop applications: Ranorex, AutoIt;

[0221] For mobile apps: Appium, Espresso (Android), XCUITest (iOS).

[0222] When implementing:

[0223] Initialize and configure the test environment;

[0224] Navigate to the target page or function, for example: replace with the URL of the target website and replace with the actual name attribute of the search box;

[0225] Input test data;

[0226] Perform an action (such as clicking a button, submitting a form);

[0227] Verify system responses (check whether expected results match actual results);

[0228] Clean up the test environment (such as logging out of the user, closing the browser).

[0229] Step S250: Analyze the test results to obtain the input box problem corresponding to the input box to be tested and the test case problem corresponding to the test case.

[0230] During specific implementation, the test results are analyzed, including:

[0231] Verify the correctness and completeness of the test results.

[0232] During specific implementation, the input box problems corresponding to the input box to be tested include:

[0233] Functional defects and security vulnerabilities corresponding to the input box to be tested, specifically, including:

[0234] Input validation logic errors; interface responsiveness issues; compatibility issues; security vulnerabilities, such as SQL injection.

[0235] During the specific implementation, the test case issues corresponding to the test case include:

[0236] The pass status or fail status of the test case, and the failure reason corresponding to the failure status, specifically including:

[0237] Analyze whether the test cases adequately cover all necessary test scenarios.

[0238] Check that the expected results of the test cases are accurate.

[0239] Step S260: Analyze the input box problem to obtain repair suggestions corresponding to the input box problem, and analyze the test case problem to obtain improvement suggestions corresponding to the test case problem.

[0240] During the specific implementation, specific repair suggestions are put forward based on the analysis results:

[0241] As a specific example, if the input box fails to correctly validate the data format, it is recommended to enhance the validation logic on the front end or back end.

[0242] During the specific implementation, specific improvement suggestions are put forward based on the analysis results:

[0243] As a specific example, the test case design is inadequate, and suggestions are made to add new test cases or modify existing ones.

[0244] For example, if you find that some boundary conditions are not covered, it is recommended to add corresponding test cases.

[0245] Step S270: Generate a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

[0246] During specific implementation, the test report is sent to the client, and the client displays the test report to the user to help the user repair the input box and improve the test case.

[0247] In this exemplary embodiment, after generating a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion, the method further includes:

[0248] Based on the improvement suggestion, the input specification in the test data pool is improved to obtain an improved input specification;

[0249] The input box to be tested is tested based on the improved input specification.

[0250] In specific implementation, automated testing can be integrated into the continuous integration / continuous deployment (CI / CD) process to automatically improve the input specifications in the test data pool based on the improvement suggestions to obtain the improved input specifications; and automatically test the input boxes to be tested based on the improved input specifications.

[0251] In some exemplary embodiments, it is also possible to predict possible user inputs and system responses based on a machine learning algorithm and perform automated testing, specifically:

[0252] In this exemplary embodiment, the method further includes:

[0253] Obtaining user input and system response in a historical time period, and constructing a training data set based on the user input and the system response;

[0254] Constructing a test case generation model, and training the test case generation model based on the training data set to obtain a trained test case generation model;

[0255] A target test case is generated based on the trained test case generation model, and the input box to be tested is tested based on the target test case.

[0256] Through the above exemplary embodiments, it is possible to generate test cases that are more in line with actual user operations, and predict and discover possible functional defects and security vulnerabilities in the system in advance.

[0257] During the specific implementation, a test case generation model is constructed, including:

[0258] Based on the LSTM or Transformer model framework, the test case generation model is constructed.

[0259] In a specific implementation, the input box to be tested is tested based on the target test case, including:

[0260] By simulating user operations through an automated testing tool, the target test case is input into the input box to be tested, and submitted to obtain the test result corresponding to the target test case;

[0261] Analyze the test results to obtain the input box problem corresponding to the input box to be tested and the target test case problem corresponding to the target test case;

[0262] Analyze the input box problem to obtain a repair suggestion corresponding to the input box problem, and analyze the target test case problem to obtain a completion suggestion corresponding to the target test case problem;

[0263] A test report corresponding to the input box to be tested is generated based on the target test case, the test result, the input box problem, the target test case problem, the repair suggestion and the improvement suggestion.

[0264] From the above description, it can be seen that the input box function testing method provided by the embodiment of the present disclosure dynamically generates more comprehensive unconditional test case templates, single condition test case templates and combined condition test case templates based on a more comprehensive test data pool to generate more comprehensive test cases, thereby improving the test coverage and being able to meet the testing requirements of more complex input boxes.

[0265] Specific: Improve test coverage: By combining functional and security testing, various possible input combinations are covered, including common keywords, special characters, boundary values, XSS attacks, and SQL injections, to ensure test coverage.

[0266] Reduce the workload of manually writing and maintaining test scripts: Dynamically generate test case templates through automated means to reduce the workload of manually writing and maintaining test scripts.

[0267] Improve testing efficiency: Improve testing efficiency by automating the execution of test cases and simulating user operations.

[0268] Automatically analyze test results: Generate detailed test reports and provide problem location and repair suggestions.

[0269] Form a PDCA closed loop: Through defect analysis, supplement and improve test specifications to form a continuously improving test system.

[0270] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0271] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0272] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides an input box function testing device.

[0273] refer to Figure 3 , which is a structural diagram of an input box function testing device provided by an exemplary embodiment of the present disclosure.

[0274] Input box function test device, including the following modules:

[0275] The test data pool acquisition module 310 is configured to acquire a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process;

[0276] A test case template generating module 320 is configured to dynamically generate an unconditional test case template, a single condition test case template and a combined condition test case template based on the test data pool;

[0277] The test case generation module 330 is configured to obtain target data from a target application scenario, fill the target data into the unconditional test case template, the single condition test case template and the combined condition test case template, and obtain a test case;

[0278] The testing module 340 is configured to simulate user operations through an automated testing tool, input the test case into an input box to be tested, and submit it to obtain a test result corresponding to the test case;

[0279] A test result analysis module 350 is configured to analyze the test result to obtain the input box problem corresponding to the input box to be tested and the test case problem corresponding to the test case;

[0280] The problem analysis module 360 ​​is configured to analyze the input box problem to obtain a repair suggestion corresponding to the input box problem, and to analyze the test case problem to obtain a completion suggestion corresponding to the test case problem;

[0281] The test report generation module 370 is configured to generate a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

[0282] In some exemplary embodiments, the test case template generation module 320 is specifically configured to:

[0283] Based on the test data pool, determining the function to be tested corresponding to the input box to be tested;

[0284] Based on the function to be tested, determining a test condition that affects the function to be tested;

[0285] Based on each of the to-be-tested functions that do not have a corresponding test condition, generating the unconditional test case template;

[0286] Based on each of the test conditions, generate the single condition test case template;

[0287] A test condition combination is generated based on the test condition, and the combination condition test case template is generated based on each of the test condition combinations.

[0288] In some exemplary embodiments, the test types include:

[0289] Boundary values, special characters, numbers, required fields, dates, times, file types, SQL injections, and cross-site scripting attacks.

[0290] In some exemplary embodiments, the testing module 340 is specifically configured to:

[0291] Based on the application type corresponding to the input box to be tested, the automated testing tool is selected, user operations are simulated by the selected automated testing tool, the test case is input into the input box to be tested, and the test case is submitted;

[0292] The application types include web applications, desktop applications, and mobile applications.

[0293] In some exemplary embodiments, the input box function testing device is further configured to:

[0294] Based on the improvement suggestion, the input specification in the test data pool is improved to obtain an improved input specification;

[0295] The input box to be tested is tested based on the improved input specification.

[0296] In some exemplary embodiments, the input box function testing device is further configured to:

[0297] Obtaining user input and system response in a historical time period, and constructing a training data set based on the user input and the system response;

[0298] Constructing a test case generation model, and training the test case generation model based on the training data set to obtain a trained test case generation model;

[0299] A target test case is generated based on the trained test case generation model, and the input box to be tested is tested based on the target test case.

[0300] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0301] The device of the above embodiment is used to implement the corresponding input box function testing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0302] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the input box function testing method described in any of the above embodiments is implemented.

[0303] Figure 4A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0304] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0305] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0306] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0307] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0308] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0309] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0310] The electronic device of the above embodiment is used to implement the corresponding input box function testing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0311] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1030, so that the processor 1010 executes the following instructions when running:

[0312] Obtaining a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process;

[0313] Based on the test data pool, dynamically generate unconditional test case templates, single condition test case templates and combined condition test case templates;

[0314] Acquire target data from a target application scenario, and fill the target data into the unconditional test case template, the single condition test case template, and the combined condition test case template to obtain a test case;

[0315] Simulate user operations through an automated testing tool, input the test case into the input box to be tested, and submit it to obtain the test result corresponding to the test case;

[0316] Analyze the test results to obtain input box problems corresponding to the input boxes to be tested and test case problems corresponding to the test cases;

[0317] Analyze the input box problem to obtain repair suggestions corresponding to the input box problem, and analyze the test case problem to obtain improvement suggestions corresponding to the test case problem;

[0318] A test report corresponding to the input box to be tested is generated based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

[0319] In a possible implementation manner, in the instructions executed by the processor 1010, the dynamically generating an unconditional test case template, a single condition test case template, and a combined condition test case template based on the test data pool includes:

[0320] Based on the test data pool, determining the function to be tested corresponding to the input box to be tested;

[0321] Based on the function to be tested, determining a test condition that affects the function to be tested;

[0322] Based on each of the to-be-tested functions that do not have a corresponding test condition, generating the unconditional test case template;

[0323] Based on each of the test conditions, generate the single condition test case template;

[0324] A test condition combination is generated based on the test condition, and the combination condition test case template is generated based on each of the test condition combinations.

[0325] In a possible implementation manner, in the instruction executed by the processor 1010, the test type includes:

[0326] Boundary values, special characters, numbers, required fields, dates, times, file types, SQL injections, and cross-site scripting attacks.

[0327] In a possible implementation manner, in the instructions executed by the processor 1010, simulating user operations by using an automated testing tool, inputting the test case into an input box to be tested, and submitting the test case, includes:

[0328] Based on the application type corresponding to the input box to be tested, the automated testing tool is selected, user operations are simulated by the selected automated testing tool, the test case is input into the input box to be tested, and the test case is submitted;

[0329] The application types include web applications, desktop applications, and mobile applications.

[0330] In a possible implementation manner, in the instructions executed by the processor 1010, after generating a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion, and the improvement suggestion, the method further includes:

[0331] Based on the improvement suggestion, the input specification in the test data pool is improved to obtain an improved input specification;

[0332] The input box to be tested is tested based on the improved input specification.

[0333] In a possible implementation manner, in the instruction executed by the processor 1010, the method further includes:

[0334] Obtaining user input and system response in a historical time period, and constructing a training data set based on the user input and the system response;

[0335] Constructing a test case generation model, and training the test case generation model based on the training data set to obtain a trained test case generation model;

[0336] A target test case is generated based on the trained test case generation model, and the input box to be tested is tested based on the target test case.

[0337] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the input box function testing method described in any of the above embodiments.

[0338] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0339] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0340] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the input box function testing method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0341] Based on the same inventive concept, corresponding to the input box function testing method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor execute the input box function testing method. Corresponding to the execution subject corresponding to each step in each embodiment of the input box function testing method, the processor that executes the corresponding step can belong to the corresponding execution subject.

[0342] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the input box function testing method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0343] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.

[0344] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.

[0345] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0346] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0347] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0348] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.

[0349] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0350] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0351] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0352] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0353] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0354] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0355] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0356] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0357] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

[0358] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.

Claims

1. A method for testing input box function, characterized in that: include: Obtaining a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process; Based on the test data pool, dynamically generate unconditional test case templates, single condition test case templates and combined condition test case templates; Acquire target data from a target application scenario, and fill the target data into the unconditional test case template, the single condition test case template, and the combined condition test case template to obtain a test case; Simulate user operations through an automated testing tool, input the test case into the input box to be tested, and submit it to obtain the test result corresponding to the test case; Analyze the test results to obtain input box problems corresponding to the input boxes to be tested and test case problems corresponding to the test cases; Analyze the input box problem to obtain repair suggestions corresponding to the input box problem, and analyze the test case problem to obtain improvement suggestions corresponding to the test case problem; A test report corresponding to the input box to be tested is generated based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

2. The method according to claim 1, characterized in that The method of dynamically generating an unconditional test case template, a single condition test case template and a combined condition test case template based on the test data pool includes: Based on the test data pool, determining the function to be tested corresponding to the input box to be tested; Based on the function to be tested, determining a test condition that affects the function to be tested; Based on each of the to-be-tested functions that do not have a corresponding test condition, generating the unconditional test case template; Based on each of the test conditions, generate the single condition test case template; A test condition combination is generated based on the test condition, and the combination condition test case template is generated based on each of the test condition combinations.

3. The method according to claim 1, characterized in that The test types include: Boundary values, special characters, numbers, required fields, dates, times, file types, SQL injections, and cross-site scripting attacks.

4. The method according to claim 1, characterized in that: The method of simulating user operations by using an automated testing tool, inputting the test case into an input box to be tested, and submitting the test case includes: Based on the application type corresponding to the input box to be tested, the automated testing tool is selected, user operations are simulated by the selected automated testing tool, the test case is input into the input box to be tested, and the test case is submitted; The application types include web applications, desktop applications, and mobile applications.

5. The method according to claim 1, characterized in that After generating a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion, the method further includes: Based on the improvement suggestion, the input specification in the test data pool is improved to obtain an improved input specification; The input box to be tested is tested based on the improved input specification.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining user input and system response in a historical time period, and constructing a training data set based on the user input and the system response; Constructing a test case generation model, and training the test case generation model based on the training data set to obtain a trained test case generation model; A target test case is generated based on the trained test case generation model, and the input box to be tested is tested based on the target test case.

7. An input box function testing device, characterized in that: include: A test data pool acquisition module is configured to acquire a pre-built test data pool, wherein the test data pool includes a number of input specifications, wherein the input specifications include a test type, a specification description, an input example, and an output process; A test case template generation module is configured to dynamically generate an unconditional test case template, a single condition test case template and a combined condition test case template based on the test data pool; A test case generation module is configured to obtain target data from a target application scenario, fill the target data into the unconditional test case template, the single condition test case template and the combined condition test case template, and obtain a test case; The test module is configured to simulate user operations through an automated testing tool, input the test case into an input box to be tested, and submit it to obtain a test result corresponding to the test case; A test result analysis module is configured to analyze the test result to obtain the input box problem corresponding to the input box to be tested and the test case problem corresponding to the test case; A problem analysis module is configured to analyze the input box problem to obtain a repair suggestion corresponding to the input box problem, and to analyze the test case problem to obtain a completion suggestion corresponding to the test case problem; The test report generation module is configured to generate a test report corresponding to the input box to be tested based on the test case, the test result, the input box problem, the test case problem, the repair suggestion and the improvement suggestion.

8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 6.