CN115422059A - Automatic test case generation system, method, equipment and storage medium - Google Patents

Automatic test case generation system, method, equipment and storage medium Download PDF

Info

Publication number
CN115422059A
CN115422059A CN202211069235.7A CN202211069235A CN115422059A CN 115422059 A CN115422059 A CN 115422059A CN 202211069235 A CN202211069235 A CN 202211069235A CN 115422059 A CN115422059 A CN 115422059A
Authority
CN
China
Prior art keywords
test
model
module
requirements
range
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.)
Pending
Application number
CN202211069235.7A
Other languages
Chinese (zh)
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.)
Sany Group Co Ltd
Original Assignee
Sany Group Co Ltd
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 Sany Group Co Ltd filed Critical Sany Group Co Ltd
Priority to CN202211069235.7A priority Critical patent/CN115422059A/en
Publication of CN115422059A publication Critical patent/CN115422059A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

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

Abstract

The invention provides a system, a method, equipment and a storage medium for automatically generating a test case, and relates to the technical field of software testing. The automatic test case generation system comprises a test task acquisition module, a test case generation module and a test case generation module, wherein the test task acquisition module is used for acquiring a test task; the test range planning module is used for determining a test range according to the test task; a single functional unit in the test dimension analysis module adopts a PRDS model and combines a test range to construct a test model; the functional interaction unit is used for analyzing two or more than two test points with part interaction; the quality attribute unit is used for analyzing performance, safety and compatibility test points; the test dimension analysis module is used for constructing a test model according to the test range and the test points; the test case generation module is used for automatically generating test cases according to the test model. The technical scheme of the invention simplifies the complicated test analysis and test case compiling process, thereby automatically generating the standardized test case based on the unified design model.

Description

Automatic test case generation system, method, equipment and storage medium
Technical Field
The invention relates to the technical field of software testing, in particular to a system, a method, equipment and a storage medium for automatically generating a test case.
Background
Within the testing industry, there has been emphasis on automation technology, devOps (which are the collective terms of process, method and system), etc., which are good tools for improving efficiency and quality, but all effective testing activities are based on proper understanding and analysis of business needs. The software system takes the service requirement of a user as a target, and software test analysis and design are well made, which are necessary conditions for developing subsequent test behaviors.
In the prior art, the test analysis only provides a fragmentary test theory method, and the practical operability is lacked; the test analysis design only depends on the working experience of testers, the test analysis results are messy, classification summary is not provided, the test evaluation efficiency is low, and test scenes are often omitted; the test analysis design and the test case generation are in a fracture state, and the test case template specification is lacked; the test cases are generated manually, the maintainability is poor, the knowledge inheritance is lacked, the test case compiling cost is high, and the test analysis and test case compiling processes are complex.
Disclosure of Invention
The invention aims to solve the technical problem of how to simplify the current complicated test analysis and test case writing process.
In order to solve the above problems, the present invention provides an automatic test case generation system, which includes a test task acquisition module, a test range planning module, a test dimension analysis module, and a test case generation module; the test task acquisition module is used for acquiring a test task; the test range planning module is used for determining a test range according to the test task; the test dimension analysis module comprises a single function unit, a function interaction unit and a quality attribute unit; the single-function unit adopts a PRDS model to combine with the test range to construct a test model; the functional interaction unit is used for analyzing two or more partially interacted test points; the quality attribute unit is used for analyzing performance, safety and compatibility test points; the test dimension analysis module is used for constructing a test model according to the test range and the test points; the test case generation module is used for automatically generating test cases according to the test model.
Preferably, the test task obtaining module is further configured to obtain a test object according to the test task, and obtain test information, test requirements, and test technologies according to the test object.
Preferably, the test range planning module is specifically configured to determine a test coverage outline according to the test range; the test coverage outline is used for defining test requirements, and determining requirement coverage characteristics according to the test requirements, wherein the requirement coverage characteristics comprise: flow class requirements, rule class requirements, data class requirements, and state transition class requirements.
Preferably, the test range planning module is further configured to determine a modeling manner according to the requirement coverage characteristic.
Preferably, when the requirement coverage feature includes the process class requirement, the test dimension analysis module is configured to build a model according to a flow chart, where the flow chart includes a main process and an abnormal branch process;
when the requirement coverage characteristics comprise the rule class requirements, the test dimension analysis module is used for establishing a model according to a judgment table, a judgment tree or a causal graph, the parameters input and output by the rule class requirements have specific rules, and the parameters have logical relations;
when the requirement coverage characteristics comprise the data class requirements, the test dimension analysis module is used for establishing a model according to the equivalence class and the boundary value, specific constraint conditions exist in the data input and output by the data class requirements, and the range of the data is subjected to quantifiable processing;
when the requirement coverage characteristics comprise the state transition type requirements, the test dimension analysis module is used for establishing a model according to a state diagram, different states exist in the same test object of the state transition type requirements, and the different states can be mutually converted according to events.
Preferably, the single function unit is used for single function test analysis; the function interaction unit is used for function interaction test analysis design; the quality attribute unit is used for quality attribute test analysis design.
Preferably, the test dimension analysis module is further configured to import a test analysis design model file into an automatic test case generation tool according to the test model, so that the test case is automatically generated by the test case generation module.
The automatic test case generation system comprises four modules, wherein a test task acquisition module is used for acquiring a test task; the test range planning module is used for determining a test range according to the test task; the test dimension analysis module is used for constructing a test model according to the test range and the test points; the test dimension analysis module also comprises a single-function unit, and the single-function unit adopts a PRDS model and combines a test range to construct a test model; the test case generation module is used for automatically generating a test case according to the test model; the invention simplifies the complicated test analysis and test case compiling process and provides a complete test analysis design working method, thereby automatically generating the standardized test case according to the unified test analysis design model.
The invention also provides a method for automatically generating the test case, which comprises the following steps: acquiring a test task; determining a test range according to the test task; constructing a test model according to the test range; and automatically generating a test case according to the test model.
Compared with the prior art, the automatic test case generation method and the automatic test case generation system have the same advantages, and are not described again.
The invention also provides a computer apparatus comprising a memory for storing a computer program and a processor; the processor is configured to implement the automatic test case generation method according to any one of the above items when the computer program is executed.
Compared with the prior art, the computer equipment and the automatic test case generation method have the same advantages, and are not described again here.
The invention also provides a computer readable storage medium, which stores a computer program, and when the computer program is read and run by a processor, the computer program realizes the automatic test case generation method.
The advantages of the computer-readable storage medium and the automatic test case generation method are the same as those of the prior art, and are not described herein again.
Drawings
FIG. 1 is a block diagram of a test case automatic generation system according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for automatically generating test cases according to an embodiment of the present invention;
FIG. 3 is a diagram of one of the test analysis design models of the automatic test case generation system according to the embodiment of the present invention;
FIG. 4 is a second design model of test analysis of the automatic test case generation system according to the embodiment of the present invention;
FIG. 5 is a third design model of test analysis of the automatic test case generation system according to the embodiment of the present invention;
FIG. 6 is a fourth test analysis design model of the automatic test case generation system according to the embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
With reference to fig. 1, an embodiment of the present invention provides an automatic test case generation system, which is characterized by including a test task obtaining module, a test range planning module, a test dimension analysis module, and a test case generation module; the test task acquisition module is used for acquiring a test task; the test range planning module is used for determining a test range according to the test task; the test dimension analysis module comprises a single function unit, a function interaction unit and a quality attribute unit; the single-function unit adopts a PRDS model to combine with the test range to construct a test model; the functional interaction unit is used for analyzing two or more partially interacted test points; the quality attribute unit is used for analyzing performance, safety and compatibility test points; the test dimension analysis module is used for constructing a test model according to the test range and the test points; the test case generation module is used for automatically generating test cases according to the test model.
Specifically, the test task acquisition module is used for acquiring a test task, knowing the test task, combing test requirements from the aspects of users, information and development, and knowing a tested user and user requirements; the test range planning module is used for determining a test range according to the test task, the test dimension analysis module is used for constructing a test model according to the test range and the test points, analyzing the test points according to each test content, defining the test requirements from the test angle and determining the test thought of a single-function, function interaction and quality attribute three-dimensional visual angle; trying to cover a basic case by using a PRDS model through key trigger words and grasping core functions; identifying test data, supplementing test steps and expected results, and developing overall consideration from a user use scene to realize the test requirements; the test case generation module is used for automatically generating test cases according to the test models, importing the test analysis design model files into an automatic test case generation tool and automatically generating the test cases.
The single-function unit is constructed by combining a PRDS model and a test range, and is modeled by using test analysis methods such as equivalence class, a decision table, a boundary value and the like in the single-function test analysis process, and the test model is constructed by adopting the PRDS method in the embodiment. When a single-function test is analyzed, determining which feature of the PRDS is selected for modeling by the following method, 1, paying attention to a trigger word, grasping keywords of feature description from a requirement document, comparing the keywords with the features of the requirement description corresponding to the PRDS respectively, and selecting the matched features from the keywords; 2. the core function is grasped, important information extracted from clarification requirements, required document reading and communication with people is ignored, and interference information and information which does not need to be concerned at the present stage are ignored; 3. trying different characteristics, trying to respectively model and compare differences according to different characteristics of multiple characteristics identified by the requirement document; 4. and determining an analysis main line around a set target to ensure that all divergences and explorations are spread around the single function to be detected.
The test requirement analysis of the single-function unit comprises normal functions, abnormal functions and Interface display (User Interface (UI); normal function: normal operation of page addition, deletion, modification and check, data correctness verification and normal function guarantee; abnormal function: whether abnormal operation and some error operations are prompted or not is prompted to indicate whether the operation is correct or not (the reasonability and the correctness of the prompt are indicated); environmental anomalies, such as: network disconnection, power outage, network restart, service restart and weak network; interface presentation (UI): whether the layout is reasonable, the control display attractiveness, the button display rationality, the attractiveness and the resolution are achieved.
The function interaction unit is used for analyzing two or more test points with part of interaction, for example, after the configuration A is modified, whether the function B has influence or not is judged; the prerequisite for testing the B function is to perform the test under the condition of the A function.
The quality attribute unit is used for analyzing performance, safety and compatibility test points, for example, usability: general function convenience, smooth installation and upgrade, friendly interface interaction and page layout rationality; compatibility: browser compatibility (different music browsers such as google, IE, and firefox, and different versions of each type of browser), resolution compatibility (resolution of display), system compatibility (windows, linux), different mobile phone versions and types; the system performance is as follows: the performance of the system is carried out while the query is time-consuming and the write-in and read-out are carried out; stability: and 7, testing whether the operation of the system is stable and data are lost.
In this embodiment, the test task obtaining module is configured to obtain a test task; the test range planning module is used for determining a test range according to the test task; the test dimension analysis module is used for constructing a test model according to the test range and the test points; the test dimension analysis module also comprises a single-function unit, and the single-function unit adopts a PRDS model and combines a test range to construct a test model; the test case generation module is used for automatically generating a test case according to the test model; according to the method, a test analysis design is divided into different stages by a theory combination method, various requirement coverage characteristics are summarized, and a standard model is finally output; the complicated test analysis and test case compiling process is simplified, a complete test analysis design working method is provided, and the standardized test cases are automatically generated based on the unified test analysis design model.
Preferably, the test task obtaining module is further configured to obtain a test object according to the test task, and obtain test information, test requirements, and test technologies according to the test object.
Specifically, learning about the test task KYM (KnowYourMission, which helps the case designer to comb the test task) includes: knowing test objects, knowing test tasks and knowing test strategies;
the knowledge target, i.e., the knowledge user (Customer), acquires information from the following 4 points: 1. determining the requirement proposed by the user, 2, the reason for the requirement proposed by the user and the problem to be solved, 3, the key point concerned by the user, 4 and the actual application environment of the user.
Understanding the test task, namely understanding the test task itself (Information), and acquiring Information from the following 5 aspects: 1. determining whether documents are available for reference, including requirement design documents and original design documents, 2, determining whether other requirements are depended on and are realized, 3, determining whether related functions and requirements have historical defects left, 4, determining whether other products or projects realize similar requirements, 5, determining whether other manufacturers realize the requirements and how the requirements are realized;
knowing the test strategy, i.e. knowing the Developer relationship (Developer), information is obtained from the following 3 aspects: 1. determining a developer who develops the need; 2. determining a technique used by the developer; 3. it is determined whether a developer has a recommendation for a test strategy.
In the embodiment, a KYM method is adopted to know the user and the test requirement of the test, so that the user use scene and the real requirement can be known more comprehensively, the phenomenon that the realized function is inconsistent with the user requirement is avoided, communication between testers and peripheral personnel is promoted, valuable information is obtained in time, and risks are found in advance.
Preferably, the test range planning module is specifically configured to determine a test coverage outline according to the test range; the test coverage outline is used for defining test requirements, and determining requirement coverage characteristics according to the test requirements, wherein the requirement coverage characteristics comprise: flow class requirements, rule class requirements, data class requirements, and state transition class requirements.
Specifically, the process requirement corresponds to a process, the rule requirement corresponds to a rule, the data requirement corresponds to a date, and the state conversion requirement corresponds to a state; the TCO (Testing Coverage Outline) is the requirement defined from the Testing perspective, and integrates the test information acquired from KYM, hierarchically refines the tested object, finds out the single function M, the function interaction F and the quality attribute Q, and identifies the RISK RISK.
The three-dimensional view of MFQ (Module single Function, function interaction, quality attribute) is a general idea, and is suitable for various business fields. Because any system is structured, each 'integral' tested object can be divided into a plurality of 'parts', each 'part' bears certain functions, and the 'part' which can be tested independently is called 'single function', and is denoted by M; in addition, there is a point of interaction that needs to be tested between single functions and single functions, and between the whole feature/system and other features/systems, which is called "function interaction" and denoted by F; some non-functional "quality attributes" need to be tested for a single function or for an entire feature/system, which is denoted by Q.
In the embodiment, the TCO method is adopted to integrate the test information acquired from KYM, and the tested object is hierarchically refined, so that all users can know the test requirements of the current tested system.
Preferably, the test range planning module is further configured to determine a modeling mode according to the requirement coverage characteristic.
Specifically, constructing the test model includes determining a test object, determining a single function boundary/range, splitting a complex single function, synthesizing a single function feature selection model, and modeling.
The M, F, Q mentioned above is to analyze and test a measured object from 3 different dimensions, where the F function interaction part represents a scene test that is more complex than a single function, and there are infinite interactive scenes, so that generally the test of traversing F is not considered, but a scene with higher priority is selected for verification, and the verification mode is more exploratory test. For the quality attribute test of Q, firstly, which quality attributes need to be paid attention to is considered, and non-functional quality attributes belong to the field of special tests and generally need special test skills.
F and Q are relatively simple test design models that the tester is sufficiently familiar with the system to be adequate, but the dimension M is relatively difficult, and in this embodiment, focus is placed on test analysis and test design of M single functions. In the process of testing and analyzing the M single function, a model is established by using test and analysis methods such as equivalence class, decision table, boundary value, and the like, and in this embodiment, a PRDS method is used to construct a test model.
In the embodiment, the PRDS model is combined with the actual case to guide the test analysis process, so that the test analysis efficiency is improved, and the omission of test scenes is reduced.
Preferably, when the requirement coverage feature includes the P-process type requirement, the test dimension analysis module is configured to build a model according to a flow chart, where the flow chart includes a main flow and an abnormal branch flow;
when the requirement coverage characteristics comprise the R rule class requirements, the test dimension analysis module is used for establishing a model according to a judgment table, a judgment tree or a causal graph, specific rules exist in input and output parameters of the R rule class requirements, and logical relations exist among the parameters;
when the requirement coverage characteristics comprise the D data class requirements, the test dimension analysis module is used for establishing a model according to the equivalence class and the boundary value, specific constraint conditions exist in the data input and output by the D data class requirements, and the range of the data is subjected to quantifiable processing;
when the requirement coverage characteristics comprise the S-state transition class requirements, the test dimension analysis module is used for establishing a model according to a state diagram, different states exist in the same test object of the S-state transition class requirements, and the different states can be mutually converted according to events.
Specifically, each letter in the PRDS model represents an english letter abbreviation of each requirement characteristic;
wherein, the P-Process flow comprises the following steps: when the requirement has obvious meaning of 'business Process', a 'P-Process' mode is adopted for modeling;
the requirements are characterized in that: 1. the method comprises a plurality of steps, wherein each step has a certain front-back constraint relation, and all steps complete one thing together; 2. the entire process may involve multiple roles or trigger conditions;
the specific application steps are as follows: 1. modeling uses a flow chart expression model to comb key points in the flow; 2. designing 1 main flow and a plurality of abnormal branch flows in the complex flow of the test condition, selecting 1 common path as a main flow, starting from the main flow, encountering an important branch, and listing an optional supplementary flow; the flow chart only presents the core main flow and the important branch flow, and the non-important abnormal branch can be filled in by the supplementary flow; all abnormal scenes are prevented from being listed in the flow chart.
For example: in the process of creating the mobile application, firstly, requirement description is carried out, 1, the mobile application is created, the type selects 'mobile application', and only a project owner and a technical architect have the permission to create the mobile application; 2. the mobile application name is less than 50 characters, special characters can be used, and the mobile application name needs to be kept unique; 3. executing and creating an application flow, and calling an interface mapprecenter/createApp; 4. after the service application is established, recording application information (appid and appName) for subsequent processes; 5. if any link fails in the non-production or production environment, returning to the step 1; 6. and after the creation is successful, authorizing the user and creating the push public key. If there is a special case, such as a user creating an application on the mPaaS platform, the above process is not applicable.
Then finding a trigger word, the creation Process describes the creation flow (Process) of the mobile application, and the 2 nd point of the creation Process describes some data (data). The above required processing procedure has multiple steps, involves multiple roles (user, revops system, mPaas system), and completes mobile application creation together, and conforms to the "P-Process" feature.
Taking the mobile application created by the user as a main flow, carrying out test analysis by a flow chart test design method, and outputting the test analysis as follows:
creating a mobile application; inputting mobile application related information by a user; judging whether the input information is legal or not, if not, re-inputting the relevant information of the mobile application, and if so, calling the mPaas interface to create the mobile application; and judging whether the creation is successful or not, if not, recalling the mPaas interface to create the mobile application, and if so, authorizing the mPaas mobile application administrator role for the user.
The design model was analyzed by a finishing test, as shown in connection with fig. 3.
R-Rules rule: when a plurality of parameters or variables can be obviously distinguished from the demands, modeling is carried out in an R-Rules mode;
the requirements are characterized in that: 1. a plurality of parameters are provided, and excessive flow processing is avoided; 2. there are several rules, and each rule is formed by combining different values of several parameters, and the results are different in different combinations.
The specific application steps are as follows: 1. modeling, using a decision table, decision tree or causal graph expression model; 2. designing a test condition identification parameter, listing possible values of each parameter, identifying all rules, combining different parameter values, and corresponding to the rules; only the core parameters influencing the rule result are combined, and the different value results of the non-core parameters are subjected to supplementary explanation; it is avoided to combine all identified parameters.
For example: when the face recognition-free login is carried out, firstly, the requirement description is carried out, and the field design of the face recognition-free login table is as follows: 1. the work number, 2, the domain account number, 3, the mobile phone deviceID, 4, the desktop cloud Mac address, 5, the last face comparison success time, and 6, the face authentication success state;
judging face-free login, and meeting the following conditions: 1. after the user scans and logs in, a piece of data, a domain account number, a job number, scanning and logging time, an equipment number, a mac address and whether the scanning and logging are successful or not are recorded; 2. the face authentication valid duration (configurable) is the current time-the last face comparison success time; 3. the current login mobile phone equipment of the user is equal to the devicedID of the last login mobile phone, and the current login equipment mac of the user is equal to the last scanning login mac; 4. other cases are that the last face-scanning login is successful and living body identification is required, which needs to be specifically explained as follows: when the registered mac address is empty, the mac address is not compared, and other processing logics are unchanged; scanning and a scanning processing flow: after the user password is successfully verified, whether the user logs in is judged, if the user logs in is avoided, a special code is returned to the APP, information such as a domain account number and a password of the user is pushed to the WI, if the user does not log in, the information is returned as before, and the APP needs to pop up a face recognition interface.
Then searching for a trigger word, wherein the table field design describes 6 parameters or variables; judging live-free login describes 5 Rules (Rules); a sweep describes a functional Process flow (Process).
The above requirements include multiple parameters such as mobile phone deviceID, desktop cloud mac address, last face comparison success time, face authentication success status, etc., the parameters have multiple combination modes, different combination modes represent different scanning processing flows, whether the scanning authentication processing flow is correct or not is noticed in the test process, then the characteristic of R-Rules is selected for modeling, and a BA (business requirement analyst) confirms that the core parameter in the requirement is the mac address, and the condition that the mac address cannot be obtained by login due to technical reasons occurs.
And taking the login mac address as a core parameter, and performing test analysis by using a decision tree test design method, wherein the output test analysis is as follows: the desktop cloud is free of face authentication; judging whether a face authentication account exists according to the job number or the domain account; if no face authentication account exists, whether the login has an MAC address is judged; if the face authentication account exists, judging the effective time length of login; if the login time is within the effective time of the face authentication, judging whether the login has an MAC address or not; if no MAC address is registered, judging the face authentication record state comprises the following steps: the face authentication state is successful, the mobile phone deciVIID comparison is successful, the face authentication state is failed or the mobile phone deciVIID comparison is failed; if the MAC address is logged in at this time, the MAC address is logged in the face authentication record and the MAC address in the face authentication record is 0.0.0.0; if the face authentication record contains the MAC address, judging the login state and the mobile phone deciviID, wherein the login state and the mobile phone deciviID are successful, and the mobile phone deciviID comparison is successful, the login state is failed or the mobile phone deciviID comparison is failed;
if the MAC address in the face authentication record is 0.0.0.0, judging the login state and the mobile phone deciviID, wherein the login state and the mobile phone deciviID are successfully compared, and the face authentication state or the mobile phone deciviID is unsuccessfully compared; if no MAC address exists in the login, the conditions that the face authentication state is successful, the mobile phone deciviID comparison is successful, the face authentication state is failed or the mobile phone deciviID comparison is failed are included.
If the login is not within the effective time of the face authentication, judging whether the login has an MAC address or not; if the MAC address is logged in at this time, face recognition is started, and the MAC address, the mobile phone ID, the state and the like are updated; if no MAC address exists in the login, the face authentication record has the MAC address and the face authentication record has the MAC address of 0.0.0.0.
The design model was analyzed by collation testing as shown in connection with fig. 4.
D-Data: when the demand surrounds some Data, each Data has a definite value range, the D-Data is used for modeling.
The requirements are characterized in that: 1. the data relation and the combination of the logically independent and non-obvious data form a certain rule, and 2, the value of each data has a constraint relation;
the specific application steps are as follows: 1. modeling, namely expressing a model by using an equivalence class and a boundary value; 2. designing test conditions, combining the context list 'data', dividing effective and ineffective equivalence classes, and using the equivalence classes together with boundary values; the data and the parameters in the rule model are mixed, and the data refers to some simple nouns with certain values; the value of the parameter can influence the service rule, and the accuracy of rule processing is ensured.
For example: when inviting members, firstly performing requirement description; 1. filling a mailbox address, requiring the mailbox address, filling a field, starting with letters and including an @ symbol in the middle, wherein 6-18 characters are required to be filled; 2. selecting roles, wherein the roles are selected from a drop-down list, and the role list comprises a project owner, project members, development & test and a product manager; 3. support to invite multiple members simultaneously and then look for trigger words, some data (data), mailbox addresses and roles are described in the requirements.
The above requirements relate to two data of the mailbox and the role; the mailbox Data and the role Data are relatively independent and do not influence each other, the role Data is selected to be pulled down, the test scene of the mailbox field is mainly analyzed, and then the D-Data characteristic is selected for modeling.
The design model was analyzed by collation testing as shown in connection with fig. 5.
S-State: when multiple "states" are involved in a demand, the "S-State" feature model is employed.
The requirements are characterized in that: 1. aiming at the same object, multiple states exist, 2, the states can be mutually converted due to certain events; the specific application steps are as follows: 1. modeling, namely expressing a model by using a state diagram; 2. designing test conditions, combing each state of a test object, drawing a state transition diagram, and marking a trigger event.
For example: when the environment is applied, firstly, carrying out requirement description, 1, inputting an environment code and an environment name, selecting the environment name, an environment category, a mouth returning department and an application responsible person, and setting a resource quota and a container quota; 2. after an environment application request is submitted, an application flow is completed through BPM; 3. after the application process passes approval, calling a TKE (Tencent Kubernets Engine, namely Tencent cloud container Service) interface to create namespace, and synchronizing project information to a TSF (Tencent Service Framework, namely a micro Service platform) platform; 4. creating a business rule for each field of the application page (environment code: comprising alphanumeric, and ' - ' and ', beginning with alphanumeric, ending with alphanumeric, limited to 32 characters, letters only lowercase, environment name: …); 5. the approval process needs to pass through 3 nodes, and approval is carried out through/refusal operation; 6. the environment application records six states of non-submission, audit, rejection, retry, abandonment and completion.
Then, a trigger word is searched, some data (data) are described in the requirement, the processing procedure of the application record is described in the requirement, and the state (state) conversion of the application record is described in the requirement.
The above requirements relate to some data, and the key point is that a plurality of states recorded by the application can be split into two single functions for test analysis (M1: environmental application M2: application page data), and the M1 single function conforms to the S-State feature model.
Using a state diagram test analysis method to comb the conversion relation among uncommitted states, audited states, rejected states, retried states, abandoned states and completed states; the analytical results were as follows: submitting a temporary stored application record; performing auditing; if the TKE environment is failed to be established, re-filling the cluster ID for retry, and completing the environment establishment; if the request for refusal in OA is applied, whether to abandon the application actively or not according to the intention of the applicant; if not, the application information is modified and then submitted again, and then the examination and approval are carried out, and the environment is successfully established.
The design model was analyzed by collation testing as shown in connection with fig. 6.
In the embodiment, the universal scene test points are abstracted, so that the knowledge transfer and accumulation are facilitated; the information and the recording format which need to be recorded are designed through model definition test analysis, so that the subsequent test case with standard specification can be automatically generated through a tool.
Preferably, the single function unit is used for single function test analysis; the function interaction unit is used for function interaction test analysis design; the quality attribute unit is used for quality attribute test analysis design.
Specifically, the test object boundary of the M single-function test analysis design is clear, and when the M single-function test analysis design is carried out, a user story division principle INVEST can be referred to, wherein the INVEST comprises independence (independence), convenient communication (Negotable), valuables (Valuable), estivable (Estimable), short (Small) and Testable (Testable); when F function interaction test analysis design is carried out, if the number of function interaction scenes is large, a scene with high priority is selected for exploration test; the Q quality attribute test analysis design comprises a test analysis design in the aspect of performance, and specifically comprises safety, compatibility, reliability and maintainability.
In the embodiment, MFQ three-dimensional test visual angle analysis is adopted, and test points are displayed in a classified mode, so that the test coverage rate and the efficiency are improved, and the test scheme is convenient to evaluate.
Preferably, the test dimension analysis module is further configured to import a test analysis design model file into an automatic test case generation tool according to the test model, so that the test case is automatically generated by the test case generation module.
Specifically, the test analysis design model is automatically converted into the test case based on Python, and the test case elements in the model are automatically generated into Excel text cases, wherein the test case elements comprise modules, case names, case steps, expected results and the like.
The specific implementation method comprises the following steps: installing a python environment; copying the plug-in to a python installation catalog Lib/site-packages; and (4) operating model ToExcel py + test analysis to design the file name of the model, so as to generate an Excel file use case (the model file and the model ToExcel py file are placed in the same directory).
In the embodiment, the test analysis design model is automatically converted into the test case, the programming language does not need to be learned, the model is automatically combined with a tool to generate the test case with standard specification, the test cost is reduced, and the test efficiency is improved.
With reference to fig. 2, an embodiment of the present invention further provides a method for automatically generating a test case, where the method includes: acquiring a test task; determining a test range according to the test task; constructing a test model according to the test range; and automatically generating a test case according to the test model.
As shown in fig. 7, an embodiment of the present invention further provides a computer device, including a memory and a processor: the memory for storing a computer program; the processor is used for realizing the automatic test case generation method when the computer program is executed.
Another embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is read and executed by a processor, the method for automatically generating the test case is implemented.
Although the present disclosure has been described above, the scope of the present disclosure is not limited thereto. Various changes and modifications may be effected therein by one of ordinary skill in the pertinent art without departing from the spirit and scope of the present disclosure, and these changes and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A test case automatic generation system is characterized by comprising a test task acquisition module, a test range planning module, a test dimension analysis module and a test case generation module;
the test task acquisition module is used for acquiring a test task;
the test range planning module is used for determining a test range according to the test task;
the test dimension analysis module comprises a single function unit, a function interaction unit and a quality attribute unit; the single functional unit constructs a test model by combining a PRDS model with the test range; the functional interaction unit is used for analyzing two or more than two test points with part of interaction; the quality attribute unit is used for analyzing performance, safety and compatibility test points; the test dimension analysis module is used for constructing a test model according to the test range and the test points;
the test case generation module is used for automatically generating test cases according to the test model.
2. The system for automatically generating test cases according to claim 1, wherein the test task obtaining module is further configured to obtain a test object according to the test task, and obtain test information, test requirements, and test technologies according to the test object.
3. The system for automatically generating test cases according to claim 1, wherein the test range planning module is specifically configured to determine a test coverage outline according to the test range; the test coverage outline is used for defining test requirements, and determining requirement coverage characteristics according to the test requirements, wherein the requirement coverage characteristics comprise: flow class requirements, rule class requirements, data class requirements, and state transition class requirements.
4. The system according to claim 3, wherein the test case planning module is further configured to determine a modeling manner according to the requirement coverage characteristic.
5. The system according to claim 4, wherein when the requirement coverage feature includes the flow class requirement, the test dimension analysis module is configured to build a model according to a flow diagram, wherein the flow diagram includes a main flow and an abnormal branch flow;
when the requirement coverage characteristics comprise the rule class requirements, the test dimension analysis module is used for establishing a model according to a judgment table, a judgment tree or a causal graph, the parameters input and output by the rule class requirements have specific rules, and the parameters have logical relations;
when the requirement coverage characteristics comprise the data class requirements, the test dimension analysis module is used for establishing a model according to the equivalence class and the boundary value, specific constraint conditions exist in the data input and output by the data class requirements, and the range of the data is subjected to quantifiable processing;
when the requirement coverage characteristics comprise the state transition type requirements, the test dimension analysis module is used for establishing a model according to a state diagram, different states exist in the same test object of the state transition type requirements, and the different states can be mutually converted according to events.
6. The automatic test case generation system of claim 1, wherein the single function unit is configured for single function test analysis; the function interaction unit is used for function interaction test analysis design; the quality attribute unit is used for quality attribute test analysis design.
7. The system according to claim 1, wherein the test dimension analysis module is further configured to import a test analysis design model file into an automatic test case generation tool according to the test model, so as to automatically generate the test case through the test case generation module.
8. An automatic test case generation method based on the automatic test case generation system of any one of claims 1 to 7, comprising:
acquiring a test task;
determining a test range according to the test task;
constructing a test model according to the test range;
and automatically generating a test case according to the test model.
9. A computer device, comprising a memory and a processor:
the memory for storing a computer program;
the processor, when executing the computer program, is configured to implement the method for automatically generating test cases according to claim 8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which when read and executed by a processor, implements the method for automatic test case generation according to claim 8.
CN202211069235.7A 2022-09-02 2022-09-02 Automatic test case generation system, method, equipment and storage medium Pending CN115422059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211069235.7A CN115422059A (en) 2022-09-02 2022-09-02 Automatic test case generation system, method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211069235.7A CN115422059A (en) 2022-09-02 2022-09-02 Automatic test case generation system, method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115422059A true CN115422059A (en) 2022-12-02

Family

ID=84201957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211069235.7A Pending CN115422059A (en) 2022-09-02 2022-09-02 Automatic test case generation system, method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115422059A (en)

Similar Documents

Publication Publication Date Title
US8150674B2 (en) Automated testing platform for event driven systems
Ghose et al. Process discovery from model and text artefacts
US11074162B2 (en) System and a method for automated script generation for application testing
US11681685B1 (en) System for uploading information into a metadata repository
Soliman et al. Enriching architecture knowledge with technology design decisions
CN111722839A (en) Code generation method and device, electronic equipment and storage medium
CN108763091A (en) Method, apparatus and system for regression test
CN113987541A (en) Data access control method and device and electronic equipment
KR100877156B1 (en) System and method of access path analysis for dynamic sql before executed
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
JP2003114813A (en) Analysis server, program analysis network system and program analysis method
CN114116801A (en) Data list checking method and device
EP3851955A1 (en) Systems and methods for software documentation and code generation management
CN113434395A (en) Automatic generation method, device, equipment and medium of test case
Bass et al. A comparison of requirements specification methods from a software architecture perspective
CN112015715A (en) Industrial Internet data management service testing method and system
KR20210004505A (en) Automatic mapping system for management standard specification
CN115422059A (en) Automatic test case generation system, method, equipment and storage medium
Weber et al. Detecting inconsistencies in multi-view uml models
CN113051262A (en) Data quality inspection method, device, equipment and storage medium
Foganholi et al. Supporting technical debt cataloging with TD-Tracker tool
KR101865103B1 (en) System and method for verifying consistency of software
Gupta et al. Non Performance Testing in Software Development Life Cycle
Honig Establishing Metrics to Encourage Broader Use of Atomic Requirements–A Call for Exchange and Experimentation
CN114860589A (en) Unit testing method and device, storage medium and electronic equipment

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