CN111813697A - Test coverage rate statistical method based on test object calling mark - Google Patents

Test coverage rate statistical method based on test object calling mark Download PDF

Info

Publication number
CN111813697A
CN111813697A CN202010867899.2A CN202010867899A CN111813697A CN 111813697 A CN111813697 A CN 111813697A CN 202010867899 A CN202010867899 A CN 202010867899A CN 111813697 A CN111813697 A CN 111813697A
Authority
CN
China
Prior art keywords
entity
program
entity element
calling
marking
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.)
Granted
Application number
CN202010867899.2A
Other languages
Chinese (zh)
Other versions
CN111813697B (en
Inventor
熊阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan XW Bank Co Ltd
Original Assignee
Sichuan XW Bank 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 Sichuan XW Bank Co Ltd filed Critical Sichuan XW Bank Co Ltd
Priority to CN202010867899.2A priority Critical patent/CN111813697B/en
Publication of CN111813697A publication Critical patent/CN111813697A/en
Application granted granted Critical
Publication of CN111813697B publication Critical patent/CN111813697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Abstract

The invention relates to a test coverage rate statistical method based on a test object calling mark, which comprises the following steps: A. extracting entity elements B of the software, establishing an entity element hierarchical tree C, establishing an entity element calling and marking data table D, collecting calling and marking data G of the entity elements, storing the calling and marking data of all the entity elements in the entity element calling and marking data table H, establishing a background management system and a test coverage statistical page, extracting the entity element calling and marking data for statistics, and outputting an analysis result. The invention completely counts the test coverage rate of all entity elements of the whole software including requirements, functions, programs and the like, and improves the accuracy of the result and the referential property of the conclusion.

Description

Test coverage rate statistical method based on test object calling mark
Technical Field
The invention relates to the field of computer software development and software testing, in particular to a test coverage rate statistical method based on a test object calling mark.
Background
In the field of software testing, it is very important to perform test coverage statistics on a tested object. Coverage is a measure of test integrity and is a measure of test effectiveness. Test coverage is a measure of test integrity. Through testing the coverage rate, the user can know whether the test is sufficient and which potential risks and weaknesses exist, and the tester is guided to purposefully supplement the test cases for increasing the coverage rate.
The current methods for counting and testing the coverage rate mainly comprise: code coverage statistics based on static code scanning, code coverage statistics based on program runtime monitoring, demand coverage statistics for software requirements, and the like. The above test coverage statistical method focuses on the test coverage statistics of local features of software such as codes and requirements, but does not focus on the test coverage statistics of the whole software, that is, the test coverage of dimensions such as software requirements, software function modules, software code modules and software code lines of the whole software is completely counted.
For the statistics of the coverage rate of the local features of the software, the testing effectiveness can be measured only from a certain specific dimension, which easily results in one-sided and inaccurate conclusion and even no referential property.
Disclosure of Invention
Aiming at the problem that the test coverage statistical method in the prior art only aims at a certain aspect, the invention provides a test coverage statistical method based on a test object calling mark, which aims to: the whole test coverage rate of the software is completely counted, and the accuracy and the reliability are improved.
The invention relates to a test coverage rate statistical method based on a test object calling mark, which comprises the following steps:
A. extracting entity elements of the software, storing the extracted entity elements in an entity element table of a database, establishing a new entity element hierarchical tree, or updating an existing entity element hierarchical tree, and storing data in the entity element hierarchical tree table of the database;
B. establishing an entity element calling and marking data table in a database;
C. adding an entity element calling marking program in a test case management system and a defect management system, and collecting calling marking data of the entity element;
D. adding an entity element calling and marking program on a graphical user interface of software, and collecting calling and marking data of the entity element;
E. installing a code coverage rate statistical tool and an entity element calling marking program on a test server, and collecting calling marking data of entity elements;
F. and establishing a background management system and a test coverage rate statistical page, calling the calling marking data of the entity elements, and outputting an analysis result on the page.
The software requirement, the software function module, the software code module and the software code line of the whole software are defined as 'entity elements' of the software, the test coverage of all the entity elements of the whole software including the requirement, the function, the program and the like is completely counted, and the accuracy of the result and the referency of the conclusion are better than those of a test coverage counting method based on local characteristics.
Further, step a comprises: extracting entity elements from software requirements, function modules, function components, program interfaces, program methods, program functions and program code lines, storing the extracted entity elements in an entity element table of a database, establishing a new entity element hierarchical tree according to the relationship of the entity elements, or updating the existing entity element hierarchical tree, and storing data in the entity element hierarchical tree table of the database.
And the step A extracts all entity elements of the software for the coverage rate statistics of the software. The function of constructing all entity elements into an entity element hierarchical tree is to query all entity elements belonging to a function module according to the function module, so as to directly calculate the coverage rate of a certain function module.
Further, step B includes: establishing an entity element calling and marking data table in a database, wherein the entity element calling and marking data table is used for storing calling and marking data of software entity elements by testers, and comprises the following fields: the primary key id, entity element id, overlay type, and operation date of the table.
The step B is used for recording the calling mark of the entity element, and all the called entity elements mark that the entity element is covered in the test work.
Further, step C includes:
c1, adding an entity element call marking program on the page of the test case management system, counting the call marks of the entity elements of the software requirements and the function modules including the operations of creating a case, editing the case and executing the case, transmitting the call marking data to a background program, and storing the call marking data in an entity element call marking data table of the database;
and C2, adding a solid element call marking program on the page of the defect management system, counting the call marks of the solid elements of the software requirements and the functional modules of the operation including the operation of creating the defect and the operation of updating the defect state, transmitting the call mark data to a background program, and saving the call mark data in a solid element call mark data table of the database.
And C, collecting the calling conditions of the entity elements in the test case compiling and updating process and the defect compiling and updating process for calculating the coverage rate of the demand.
Further, step D includes: adding an entity element calling and marking program in a graphical user interface of the software, counting calling and marking of a tester on the functional components of the software and the entity elements of the operation control, transmitting data to a background program, and storing the data in an entity element calling and marking data table of a database.
And D, collecting the calling condition of the entity elements in the function test process for calculating the function coverage rate.
Further, step E includes: installing code coverage statistics tool on test server, and entity element invocation
And the code coverage rate counting tool counts the program coverage conditions of the program interface, the program method, the program function and the program code line of the software, which comprise operations of calling the interface, the calling method and the calling function, drives the entity element calling marking program to generate calling marking data of the entity elements of the program interface, the program method, the program function and the program code line of the software according to the program coverage conditions counted by the code coverage rate counting tool, transmits the calling marking data to a background program, and stores the calling marking data in an entity element calling marking data table of the database.
And step E, collecting the calling condition of entity elements such as program interfaces, codes and the like caused by test activities during the running of the program, and using the calling condition to calculate the program coverage rate.
Further, step F includes: establishing a background management system and a test coverage rate statistical page; the page provides two query conditions of a software function module and a project period, and is used for querying the whole test coverage rate of a certain software function module including the requirement coverage rate, the function coverage rate and the program coverage rate in a certain project period;
F1. reading all root nodes in the entity element hierarchical tree by a test coverage statistical page, and displaying the names of all root node elements as the names of software function modules in a software function module drop-down box;
F2. when a software function module name is selected, and the query starting time and the query ending time are selected in the project period, the background program queries an entity element hierarchical tree which takes the software function module as a root node in the entity element hierarchical tree according to the software function module name and the id of the entity element of the software function module, and acquires all the entity elements in the entity element hierarchical tree;
F3. the background program screens all entity element call marking data with dates within the range of the query starting time and the query ending time from the entity element call marking data table according to the ids of all entity elements in the entity element hierarchical tree, the query starting time and the query ending time;
F4. calling the coverage type in the marked data table according to the entity element to obtain a demand coverage entity element, a function coverage entity element and a program coverage entity element;
F5. obtaining a demand coverage rate according to the ratio of the demand coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a functional coverage rate according to the ratio of the functional coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a program coverage rate according to the ratio of the program coverage entity element to all entity elements in the entity element hierarchical tree;
F6. the background program returns the three data of the requirement coverage rate, the function coverage rate and the program coverage rate to the test coverage rate statistical page, and the requirement coverage rate, the function coverage rate and the program coverage rate of the software function module are displayed by the test coverage rate statistical page.
And F, summarizing and counting the data, comprehensively calculating the demand coverage rate, the function coverage rate and the program coverage rate of the software module, and outputting the data to a page.
The invention discloses a test coverage rate statistical method based on a test object calling mark, which defines software requirements, software function modules, software code modules and software code lines of the whole software as 'entity elements' of the software, completely counts the test coverage rate of all entity elements of the whole software including requirements, functions, programs and the like, and improves the accuracy of results and the referenceability of conclusions.
Drawings
FIG. 1 is a flowchart of a test coverage statistical method based on test object invocation markers according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the following examples. This should not be understood as limiting the scope of the above-described subject matter of the present invention to the following examples. Various substitutions and alterations according to the general knowledge and conventional practice in the art are intended to be included within the scope of the present invention without departing from the technical spirit of the present invention as described above.
As shown in the flowchart of fig. 1, a test coverage statistical method based on a test object call flag of the present invention includes:
A. and extracting entity elements of the software.
A1. Extraction of entity elements is performed on requirements, functional modules, functional components, program interfaces, program methods, program functions, program code lines, and the like included in software. Assuming that the software includes a function module Y, which includes A, B, C, D, E, F six entity elements, the seven entity elements Y, A, B, C, D, E, F are extracted and stored in an entity element table of the database.
B. And establishing an entity element hierarchical tree.
B1. For Y, A, B, C, D, E, F seven entity elements, a hierarchy tree of entity elements is built according to actual semantic dependencies. For example Y, A, B, C, D, E, F have subordinates from left to right, i.e. F belongs to E, E belongs to D, D belongs to C, etc. Then a 7-level tree from Y, A to F is built with Y as the root node.
B2. If an entity element hierarchy tree with Y as a root node or a child node already exists in the database, and Y, A, B, C, D, E, F seven nodes exist in the tree and have node dependencies consistent with the tree in the step B1, the storage is abandoned and the process is skipped; if there is no entity element hierarchy tree with Y as the root node or a child node or there is no entity element hierarchy tree containing the complete Y, A, B, C, D, E, F seven nodes and consistent node dependencies in the database, the newly created tree in step B1 is saved in the table.
C. And establishing an entity element call marking data table.
And establishing an entity element calling and marking data table in the database, wherein the entity element calling and marking data table is used for storing calling and marking data of software entity elements by testers. The entity element call tag data table includes the following fields: primary key ID of table, entity element ID, call type, override type, operation date.
D. Adding an entity element calling marking program in a test case management system and a defect management system, and collecting calling marking data of the entity element.
D1. Adding an entity element call marking program on a page of the test case management system, counting call marks of entity elements such as requirements of operations on software, functional modules and the like aiming at operations such as case creation, case editing, case execution and the like, transmitting data to a background program, and storing the data in an entity element call marking data table of a database.
After a tester performs operations such as creating a use case, editing a use case, executing a use case and the like on a test case containing Y, A, B, C, D, E, F seven entity elements, the entity element call marking program generates entity element call marking data according to the requirements of software contained in the test case, IDs of the entity elements such as functional modules and the like, the entity element call marking data are transmitted to a background program, and the background program stores the data in an entity element call marking data table of a database. For example, a tester performs an execution case operation on a test case containing an entity element a. After the operation is completed, the entity element calling marking program generates an entity element calling marking data which comprises data such as entity element ID, calling type, covering type, operation date and the like, and the entity element calling marking data is transmitted to the background program. And after receiving the data, the background program stores the data into an entity element call marking data table of the database.
D2. Adding an entity element call marking program on a page of a defect management system, counting call marks of entity elements such as software requirements and function modules of operations aiming at operations of creating defects, updating defect states and the like, transmitting data to a background program, and storing the data in an entity element call marking data table of a database.
After the tester performs operations such as creating a defect and updating a defect state on a defect containing Y, A, B, C, D, E, F seven entity elements, the entity element call marking program generates entity element call marking data according to software requirements and function module and other entity element IDs contained in the defect, the entity element call marking data are transmitted to the background program, and the background program stores the data in an entity element call marking data table of the database. For example, the tester performs an update defect status operation on a defect containing the entity element B. After the operation is completed, the entity element calling marking program generates an entity element calling marking data which comprises data such as entity element ID, calling type, covering type, operation date and the like, and the entity element calling marking data is transmitted to the background program. And after receiving the data, the background program stores the data into an entity element call marking data table of the database.
E. Adding an entity element call marking program on a graphical user interface of the software, and collecting call marking data of the entity element.
E1. Adding an entity element calling marking program on a graphical user interface of the software, and counting calling marks of a tester on entity elements such as functional components, operation controls and the like of the software.
When a tester clicks a button on a functional component or an operation control of a software graphical user interface including Y, A, B, C, D, E, F seven entity elements, such as a button and an input box, inputs data in the input box, and the like, the entity element call marking program generates entity element call marking data according to the ID of the entity element, such as the functional component or the operation control, and the like, and transmits the entity element call marking data to a background program, and the background program stores the data in an entity element call marking data table of a database. For example, the tester performs data input operation on the entity element C in the input box, and after the operation is completed, the entity element calls the marking program to generate a piece of entity element call marking data, which includes data such as the entity element ID, the call type, the overlay type, the operation date, and the like, and transmits the data to the background program. And after receiving the data, the background program stores the data into an entity element call marking data table of the database.
F. Adding Jacoco and an entity element call marker program in a deployment server of the software, and collecting call marker data of the entity element.
F1. The method comprises the steps that a code coverage rate statistical tool and an entity element calling marking program of an open source such as Jacoco are installed on a test server, the code coverage rate statistical tool of the open source such as the Jacoco is used for counting program coverage conditions of a program interface, a program method, a program function and a program code line of software of the test work, and meanwhile, the entity element calling marking program is driven to generate calling marking data of the entity elements such as the program interface, the program method, the program function and the program code line of the software according to the program coverage conditions counted by the Jacoco.
When a tester performs a function test on a software function module containing Y, A, B, C, D, E, F seven entity elements, and code modules such as a program interface, a program method, a program function and the like perform operations such as an interface call, a method call, a function call and the like in the function test process, after the function test is completed, a Jacoco code coverage rate statistical tool counts the program coverage conditions of the program interface, the program method, the program function, the program code line of the software by the operations, a driving entity element call marking program generates call marking data of the entity elements such as the program interface, the program method, the program function, the program code line and the like of the software according to the program coverage conditions counted by Jacoco, the call marking data are transmitted to a background program, and the background program receives the data and stores the data in an entity element call marking data table of a database. For example, after the tester performs a functional test on the functional module Y, the Jacoco code coverage rate statistical tool counts the program coverage conditions of the program interface D and the program method E under the functional module Y after the test is completed, and the entity element call marker program generates two pieces of entity element call marker data including data such as an entity element ID, a call type, a coverage type, an operation date and the like according to the program coverage conditions counted by Jacoco, and transmits the data to the background program. And after receiving the data, the background program stores the data into an entity element call marking data table of the database.
G. And saving the call marking data of all entity elements in the call marking data table of the entity elements.
And D, all the entity element calling marking data obtained in the step D, the step E and the step F are stored in an entity element calling marking data table.
H. Establishing a background management system and a test coverage rate statistical page, extracting entity elements, calling the marking data for statistics, and outputting an analysis result.
H1. Establishing a background management system and a test coverage rate statistical page; the page provides two query conditions of a software function module and a project period, and is used for querying the whole test coverage rate of a certain software function module including the requirement coverage rate, the function coverage rate and the program coverage rate in a certain project period;
H2. reading all root nodes in the entity element hierarchical tree by a test coverage statistical page, and displaying the names of all root node elements as the names of software function modules in a software function module drop-down box;
H3. when a software function module name is selected, and the query starting time and the query ending time are selected in the project period, the background program queries an entity element hierarchical tree which takes the software function module as a root node in the entity element hierarchical tree according to the software function module name and the id of the entity element of the software function module, and acquires all the entity elements in the entity element hierarchical tree;
H4. the background program screens all entity element call marking data with dates within the range of the query starting time and the query ending time from the entity element call marking data table according to the ids of all entity elements in the entity element hierarchical tree, the query starting time and the query ending time;
H5. calling the coverage type in the marked data table according to the entity element to obtain a demand coverage entity element, a function coverage entity element and a program coverage entity element;
H6. obtaining a demand coverage rate according to the ratio of the demand coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a functional coverage rate according to the ratio of the functional coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a program coverage rate according to the ratio of the program coverage entity element to all entity elements in the entity element hierarchical tree;
H7. the background program returns the three data of the requirement coverage rate, the function coverage rate and the program coverage rate to the test coverage rate statistical page, and the requirement coverage rate, the function coverage rate and the program coverage rate of the software function module are displayed by the test coverage rate statistical page.
The software requirement, the software function module, the software code module and the software code line of the whole software are defined as 'entity elements' of the software, the test coverage rate of all the entity elements of the whole software including the requirement, the function, the program and the like is completely counted, the counting result is more complete, and the accuracy of the result and the referenceability of the conclusion are improved.
The scheme of the invention is integrally completed based on the scheme, and any step of the scheme can not be separated.
Examples
Assume that there is now a website that includes functional modules such as "X: home page", "Y: registration page", "Z: shopping cart page", etc. The function module of 'Y: registration page' needs to be developed with new functions, and the module comprises six entity elements of 'A: user name', 'B: setting password', 'C: confirmation password', 'D: registration button', 'E: UserRegisterService', 'F: dorRegister ()'.
Firstly, extracting entity elements of software, and generating entity element data and entity element hierarchical tree data.
The software functional module of 'Y: registration page' comprises four functional components of 'A: user name', 'B: setting password', 'C: confirmation password', 'D: registration button' and 'E: UserRegisterService', 'F: dorRegister ()', two program interfaces and program methods.
b. According to the names of the six functional components, the program interfaces and the program methods, inquiring whether the same entity elements exist in an entity element table of the database, if not, creating new entity elements, storing data in the entity element table, and acquiring the ID of the entity elements; if so, directly acquiring the ID of the entity element. In this example, Y, A, B, C, D, E, F are IDs of seven entity elements such as "Y: registration page", "A: user name", "B: set password", "C: confirmation password", "D: registration button", "E: UserRegisterService", "F: doRegister ()", respectively.
c. And establishing an entity element hierarchical tree for all entity elements according to the actual semantic dependency relationship. In this example, a hierarchy tree of entity elements is established with six entity elements of "Y: registration page" as root node, "A: user name", "B: setting password", "C: confirmation password", "D: registration button", "E: UserRegisterService", "F: dorRegister ()" as child nodes.
d. And c, storing the entity element hierarchical tree established in the step c in an entity element hierarchical tree table of the database. If an entity element hierarchy tree with Y as a root node or a child node already exists in the database, and Y, A, B, C, D, E, F seven nodes exist in the tree and have node dependencies consistent with the tree in the step c, abandoning the storage and skipping; and c, if the entity element hierarchy tree taking Y as a root node or a child node does not exist in the database, or the entity element hierarchy tree containing the complete Y, A, B, C, D, E, F seven nodes and consistent node dependencies does not exist, storing the newly-built tree in the step c in a table.
And secondly, newly building a test man-hour data table in the database, wherein the test man-hour data table is used for storing the operation man-hour data of each entity element by the tester.
a. And establishing an entity element calling and marking data table in the database, wherein the entity element calling and marking data table is used for storing calling and marking data of software entity elements by testers.
b. The entity element call tag data table includes the following fields: ID. Entity element ID, call type, override type, date of operation.
Adding an entity element call marking program on pages of the test case management system and the defect management system, counting call marks of the operation on entity elements such as software requirements and function modules for operations such as case creation, case editing, case execution, defect creation, defect state updating and the like, transmitting data to a background program, and storing the data in an entity element call marking data table of the database.
a. Adding an entity element calling and marking program on a page of the test case management system, wherein the entity element calling and marking program is a self-developed program. Aiming at operations such as creating use cases, editing use cases, executing use cases and the like, when the operations occur, calls of entity elements such as software requirements, functional modules and the like are marked, entity element call marking data are generated, and the entity element call marking data are transmitted to a background program.
b. After a tester performs operations such as creating a use case, editing a use case, executing a use case and the like on a test case containing seven entity elements such as Y, A, B, C, D, E, F and the like, the entity element call marking program generates call marking data of the entity elements according to the IDs of the entity elements such as Y, A, B, C, D, E, F and the like operated by the tester, the call marking data are transmitted to a background program, and the background program stores the data into an entity element call marking data table of a database. For example, a tester executes a "create case" operation for a test case containing "a: user name", and after the operation is completed, the entity element call marking program generates a piece of entity element call marking program according to the operation of the tester, which contains data that the entity element ID is a, the call type is "create case", the override type is "requirement override", and the operation date is the current date. After receiving the data, the background program stores the data into an entity element call marking data table of the database, and the data of the entity element call marking data table is shown in table 1:
table 1:
ID entity element ID Call type Type of overlay Date of operation
1 A Creating use cases Demand coverage 2020-7-4
c. Similarly, adding an entity element call marking program on a page of the defect management system, counting the call marks of the operation on entity elements such as software requirements and function modules for the operation on creating defects, updating defect states and the like, transmitting data to a background program, and storing the data in an entity element call marking data table of a database.
d. After the tester performs operations such as creating defects and updating defect states on defects containing seven entity elements such as Y, A, B, C, D, E, F, the entity element call marking program generates call marking data of the entity elements according to the IDs of the entity elements such as Y, A, B, C, D, E, F operated by the tester, and transmits the call marking data to the background program, and the background program stores the data in an entity element call marking data table of the database. For example, a tester performs a defect operation of updating a defect state, wherein the defect operation comprises a 'B' password setting operation, and after the operation is completed, the entity element calling marking program generates an entity element calling marking program according to the operation of the tester, wherein the entity element calling marking program comprises data, such as an entity element ID of B, a calling type of 'updating the defect state', an overlay type of 'requirement overlay', an operation date of the current date and the like. After receiving the data, the background program stores the data into an entity element call marking data table of the database, and the data of the entity element call marking data table is table 2:
TABLE 2
ID Entity element ID Call type Type of overlay Date of operation
1 A Creating use cases Demand coverage 2020-7-4
2 B Updating a defect state Demand coverage 2020-7-4
And fourthly, adding an entity element calling and marking program on a graphical user interface of the software, counting calling and marking of the functional components, the operation controls and other entity elements of the software by testers, transmitting data to a background program, and storing the data in an entity element calling and marking data table of the database.
a. Adding an entity element calling and marking program on a registration page of a website, counting calling and marking of entity elements such as functional components, operation controls and the like of the operation software for operations such as a user name input box, a password setting input box, a password confirmation input box, a registration button and the like, transmitting data to a background program, and storing the data in an entity element calling and marking data table of a database.
b. When a tester performs function test on a user name input box, a password setting input box, a password confirmation input box and a registration button on a registration page, an entity element calling and marking program generates calling and marking data of the entity elements according to IDs (identity) of the entity elements such as A, B, C, D and the like operated by the tester, the calling and marking data are transmitted to a background program, and the background program stores the data into an entity element calling and marking data table of a database. For example, a tester executes a function test operation such as text input on a "user name" input box, and after the operation is completed, the entity element call marking program generates a piece of entity element call marking program according to the operation of the tester, which includes data such as an entity element ID of a, a call type of "function test", a coverage type of "function coverage", and an operation date of current date. After receiving the data, the background program stores the data into an entity element call marking data table of the database, and the data of the entity element call marking data table is table 3:
table 3:
ID entity element ID Call type Type of overlay Date of operation
1 A Creating use cases Demand coverage 2020-7-4
2 B Updating a defect state Demand coverage 2020-7-4
3 A Functional testing Function overlay 2020-7-4
And fifthly, installing a code coverage rate statistical tool of an open source such as Jacoco and the like on the test server, and calling a marking program by the entity element. After the tester finishes testing, a code coverage rate statistical tool such as Jacoco collects the coverage conditions of the test work on the program interface, the program method, the program function and the program code line of the software, simultaneously drives an entity element call marking program system to measure the call marks of the test work on the entity elements such as the program interface, the program method, the program function and the program code line of the software, transmits data to a background program, and stores the data in an entity element call marking data table of a database.
a. The method comprises the steps that a code coverage rate statistical tool and an entity element calling marking program of an open source such as Jacoco are installed on a test server, the code coverage rate statistical tool of the open source such as the Jacoco is used for counting program coverage conditions of a program interface, a program method, a program function and a program code line of software of the test work, and meanwhile, the entity element calling marking program is driven to generate calling marking data of the entity elements such as the program interface, the program method, the program function and the program code line of the software according to the program coverage conditions counted by the Jacoco.
b. When a tester performs a function test on a software function module containing Y, A, B, C, D, E, F seven entity elements, and code modules such as a program interface, a program method, a program function and the like perform operations such as an interface call, a method call, a function call and the like in the function test process, after the function test is completed, a Jacoco code coverage rate statistical tool counts the program coverage conditions of the program interface, the program method, the program function, the program code line of the software by the operations, a driving entity element call marking program generates call marking data of the entity elements such as the program interface, the program method, the program function, the program code line and the like of the software according to the program coverage conditions counted by Jacoco, the call marking data are transmitted to a background program, and the background program receives the data and stores the data in an entity element call marking data table of a database. For example, a tester performs a functional test on a 'registration page', after the test is completed, a Jacoco code coverage rate statistical tool counts the program coverage conditions of a program interface 'E: UserRegisterService' and a program method 'F: doRegister ()' below the 'registration page', a driving entity element calling marking program generates two pieces of entity element calling marking data according to the program coverage conditions counted by the Jacoco, and the two pieces of entity element calling marking data comprise data of entity element IDs of E and F respectively, calling types of 'functional test', covering types of 'program covering', operation dates of current dates and the like, and the data are transmitted to a background program. And after receiving the data, the background program stores the data into an entity element call marking data table of the database. The data of the test man-hour data table at this time is table 4:
table 4:
ID entity element ID Call type Type of overlay Date of operation
1 A Creating use cases Demand coverage 2020-7-4
2 B Updating a defect state Demand coverage 2020-7-4
3 A Functional testing Function overlay 2020-7-4
4 E Functional testing Program overlay 2020-7-4
5 F Functional testing Program overlay 2020-7-4
And sixthly, establishing a background management system and establishing a test coverage rate statistical page. The page can show the overall test coverage rate of a certain software function module in a certain project period according to the query condition, wherein the overall test coverage rate comprises the requirement coverage rate, the function coverage rate and the program coverage rate.
a. And establishing a background management system and establishing a test coverage rate statistical page. The page provides two query conditions of the software function module and the project period, and can query the overall test coverage rate of a certain software function module in a certain project period, including the requirement coverage rate, the function coverage rate and the program coverage rate.
b. And reading all root nodes in the entity element hierarchical tree by the page, and displaying the names of all root node elements in a software function module drop-down box as software function module names. When the tester selects the "registration page" in the drop-down box and sets the project period to "2020-07-01" to "2020-07-10", the statistics are submitted. At this time, the background program queries an entity element hierarchical tree which takes Y as a root node in the entity element hierarchical tree according to the fact that the entity element ID of the 'registration page' is Y, and acquires all entity elements in the tree: A. b, C, D, E, F are provided. The daemon selects all entity elements with operation dates ranging between '2020-07-01' and '2020-07-10' in the entity element call tag data table according to the entity meta-ID of A, B, C, D, E, F and the like and the query start time '2020-07-10' and the query end time '2020-07-10'. Additionally, in conjunction with all entity element data A, B, C, D, E, F in the entity element hierarchy tree that has been previously acquired, it is computed which entity elements in the entity element hierarchy tree have been call marked. And respectively counting the demand marking rate (2/7 = 28.6% in the case), the function marking rate (1/7 =14.2% in the case) and the program marking rate (2/7 = 28.6% in the case) of all the entity elements according to the marking types in the entity element call marking data. And finally, the background program returns the three data of the demand marking rate, the function marking rate and the program marking rate to the page, and the page shows the demand coverage rate (28.6%), the function coverage rate (14.2%) and the program coverage rate (28.6%) of the software function module. The page display results at this point are in table 5:
table 5:
functional module Querying a time Range Required coverage rate Functional coverage rate Program coverage rate
Registration page 2020-07-01—2020-07-10 28.6% 14.2% 28.6%

Claims (7)

1. A test coverage statistical method based on a test object calling mark is characterized by comprising the following steps:
A. extracting entity elements of the software, storing the extracted entity elements in an entity element table of a database, establishing an entity element hierarchical tree, and storing data in the entity element hierarchical tree table of the database;
B. establishing an entity element calling and marking data table in a database;
C. adding an entity element calling marking program in a test case management system and a defect management system, and collecting calling marking data of the entity element;
D. adding an entity element calling and marking program on a graphical user interface of software, and collecting calling and marking data of the entity element;
E. installing a code coverage rate statistical tool and an entity element calling marking program on a test server, and collecting calling marking data of entity elements;
F. and establishing a background management system and a test coverage rate statistical page, calling the calling marking data of the entity elements, and outputting an analysis result on the page.
2. The test coverage statistical method based on test object invocation marker as claimed in claim 1, wherein: the step A comprises the following steps: extracting entity elements from software requirements, function modules, function components, program interfaces, program methods, program functions and program code lines, storing the extracted entity elements in an entity element table of a database, establishing a new entity element hierarchical tree according to the relationship of the entity elements, or updating the existing entity element hierarchical tree, and storing data in the entity element hierarchical tree table of the database.
3. The test coverage statistical method based on test object invocation marker as claimed in claim 1, wherein: the step B comprises the following steps: establishing an entity element calling and marking data table in a database, wherein the entity element calling and marking data table is used for storing calling and marking data of software entity elements by testers, and comprises the following fields: the primary key id, entity element id, overlay type, and operation date of the table.
4. The test coverage statistical method based on test object invocation marker as claimed in claim 1, wherein: the step C comprises the following steps:
c1, adding an entity element call marking program on the page of the test case management system, counting the call marks of the entity elements of the software requirements and the function modules including the operations of creating a case, editing the case and executing the case, transmitting the call marking data to a background program, and storing the call marking data in an entity element call marking data table of the database;
and C2, adding a solid element call marking program on the page of the defect management system, counting the call marks of the solid elements of the software requirements and the functional modules of the operation including the operation of creating the defect and the operation of updating the defect state, transmitting the call mark data to a background program, and saving the call mark data in a solid element call mark data table of the database.
5. The test coverage statistical method based on the test object call flags as claimed in claim 1, wherein: the step D comprises the following steps: adding an entity element calling and marking program in a graphical user interface of the software, counting calling and marking of a tester on the functional components of the software and the entity elements of the operation control, transmitting data to a background program, and storing the data in an entity element calling and marking data table of a database.
6. The test coverage statistical method based on test object invocation marker as claimed in claim 1, wherein: the step E comprises the following steps: the method comprises the steps that a code coverage rate counting tool and an entity element calling marking program are installed on a test server, the code coverage rate counting tool counts program coverage conditions of operation including a calling interface, a calling method and a calling function on a program interface, a program method, a program function and a program code row of software, the entity element calling marking program is driven to generate calling marking data of the entity elements of the program interface, the program method, the program function and the program code row of the software according to the program coverage conditions counted by the code coverage rate counting tool, the calling marking data are transmitted to a background program, and the calling marking data are stored in an entity element calling marking data table of a database.
7. The test coverage statistical method based on test object invocation marker as claimed in claim 1, wherein: the step F comprises the following steps: establishing a background management system and a test coverage rate statistical page; the page provides two query conditions of a software function module and a project period, and is used for querying the whole test coverage rate of a certain software function module including the requirement coverage rate, the function coverage rate and the program coverage rate in a certain project period;
F1. reading all root nodes in the entity element hierarchical tree by a test coverage statistical page, and displaying the names of all root node elements as the names of software function modules in a software function module drop-down box;
F2. when a software function module name is selected, and the query starting time and the query ending time are selected in the project period, the background program queries an entity element hierarchical tree which takes the software function module as a root node in the entity element hierarchical tree according to the software function module name and the id of the entity element of the software function module, and acquires all the entity elements in the entity element hierarchical tree;
F3. the background program screens all entity element call marking data with dates within the range of the query starting time and the query ending time from the entity element call marking data table according to the ids of all entity elements in the entity element hierarchical tree, the query starting time and the query ending time;
F4. calling the coverage type in the marked data table according to the entity element to obtain a demand coverage entity element, a function coverage entity element and a program coverage entity element;
F5. obtaining a demand coverage rate according to the ratio of the demand coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a functional coverage rate according to the ratio of the functional coverage entity element to all entity elements in the entity element hierarchical tree; obtaining a program coverage rate according to the ratio of the program coverage entity element to all entity elements in the entity element hierarchical tree;
F6. the background program returns the three data of the requirement coverage rate, the function coverage rate and the program coverage rate to the test coverage rate statistical page, and the requirement coverage rate, the function coverage rate and the program coverage rate of the software function module are displayed by the test coverage rate statistical page.
CN202010867899.2A 2020-08-26 2020-08-26 Test coverage rate statistical method based on test object calling mark Active CN111813697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010867899.2A CN111813697B (en) 2020-08-26 2020-08-26 Test coverage rate statistical method based on test object calling mark

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010867899.2A CN111813697B (en) 2020-08-26 2020-08-26 Test coverage rate statistical method based on test object calling mark

Publications (2)

Publication Number Publication Date
CN111813697A true CN111813697A (en) 2020-10-23
CN111813697B CN111813697B (en) 2021-07-16

Family

ID=72859108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010867899.2A Active CN111813697B (en) 2020-08-26 2020-08-26 Test coverage rate statistical method based on test object calling mark

Country Status (1)

Country Link
CN (1) CN111813697B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000587A (en) * 2020-10-29 2020-11-27 四川新网银行股份有限公司 Test man-hour automatic statistical method based on associated object operation statistics

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101689111A (en) * 2007-04-03 2010-03-31 Ldra技术公司 The automatic management of software requirements verification
CN101706751A (en) * 2009-11-23 2010-05-12 中兴通讯股份有限公司 Method and system for calculating coverage rate of service functions of software
US20140201703A1 (en) * 2013-01-15 2014-07-17 International Business Machines Corporation Automated code coverage measurement and tracking per user story and requirement
CN104050077A (en) * 2013-03-15 2014-09-17 英特尔公司 Fusible instructions and logic to provide or-test and and-test functionality using multiple test sources
US20150234734A1 (en) * 2014-02-18 2015-08-20 Hariprakash Agrawal System and method to implement an electronic document based automated testing of a software application
US20150301926A1 (en) * 2014-04-17 2015-10-22 Devfactory Fz-Llc User Interface Test Coverage
CN106407126A (en) * 2016-11-30 2017-02-15 网易(杭州)网络有限公司 Coverage rate data processing method, coverage rate data detection device and server
CN110471853A (en) * 2019-08-15 2019-11-19 平安普惠企业管理有限公司 APP test method, device, computer equipment and storage medium
CN111026647A (en) * 2019-11-21 2020-04-17 广州品唯软件有限公司 Code coverage rate obtaining method and device, computer equipment and storage medium
CN111124938A (en) * 2020-03-31 2020-05-08 四川新网银行股份有限公司 Method for generating componentized test case
CN111177016A (en) * 2020-04-14 2020-05-19 四川新网银行股份有限公司 Software test defect management method
CN111309637A (en) * 2020-05-14 2020-06-19 四川新网银行股份有限公司 Software testing and analyzing method based on bank micro-service

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101689111A (en) * 2007-04-03 2010-03-31 Ldra技术公司 The automatic management of software requirements verification
CN101706751A (en) * 2009-11-23 2010-05-12 中兴通讯股份有限公司 Method and system for calculating coverage rate of service functions of software
US20140201703A1 (en) * 2013-01-15 2014-07-17 International Business Machines Corporation Automated code coverage measurement and tracking per user story and requirement
CN104050077A (en) * 2013-03-15 2014-09-17 英特尔公司 Fusible instructions and logic to provide or-test and and-test functionality using multiple test sources
US20150234734A1 (en) * 2014-02-18 2015-08-20 Hariprakash Agrawal System and method to implement an electronic document based automated testing of a software application
US20150301926A1 (en) * 2014-04-17 2015-10-22 Devfactory Fz-Llc User Interface Test Coverage
CN106407126A (en) * 2016-11-30 2017-02-15 网易(杭州)网络有限公司 Coverage rate data processing method, coverage rate data detection device and server
CN110471853A (en) * 2019-08-15 2019-11-19 平安普惠企业管理有限公司 APP test method, device, computer equipment and storage medium
CN111026647A (en) * 2019-11-21 2020-04-17 广州品唯软件有限公司 Code coverage rate obtaining method and device, computer equipment and storage medium
CN111124938A (en) * 2020-03-31 2020-05-08 四川新网银行股份有限公司 Method for generating componentized test case
CN111177016A (en) * 2020-04-14 2020-05-19 四川新网银行股份有限公司 Software test defect management method
CN111309637A (en) * 2020-05-14 2020-06-19 四川新网银行股份有限公司 Software testing and analyzing method based on bank micro-service

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DIANXIANG XU等: ""An Automated Test Generation Technique for Software Quality Assurance"", 《IEEE TRANSACTIONS ON RELIABILITY》 *
安金霞 等: ""基于多维度覆盖率的软件测试动态评价方法"", 《软件学报》 *
机灵小不懂: ""[转]测试管理平台大比拼"", 《HTTPS://WWW.CNBLOGS.COM/KEEPSMILE/P/9055875.HTML》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000587A (en) * 2020-10-29 2020-11-27 四川新网银行股份有限公司 Test man-hour automatic statistical method based on associated object operation statistics
CN112000587B (en) * 2020-10-29 2021-11-23 四川新网银行股份有限公司 Test man-hour automatic statistical method based on associated object operation statistics

Also Published As

Publication number Publication date
CN111813697B (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN107622014B (en) Test report generation method and device, readable storage medium and computer equipment
Rafique et al. The effects of test-driven development on external quality and productivity: A meta-analysis
CN112000587B (en) Test man-hour automatic statistical method based on associated object operation statistics
Kamimura et al. Extracting candidates of microservices from monolithic application code
US20110161132A1 (en) Method and system for extracting process sequences
US7908583B2 (en) Evidentiary enrichment of traceability links between software specification requirements
CN102567201B (en) Method for automatically recovering cross-model GUI (graphic user interface) test scripts
CN105260300B (en) Service test method based on accounting standard universal classification standard application platform
CN113590102B (en) Zero-code rapid software development method, system, medium and equipment
CN104615544A (en) Problem-oriented GUI software correlation function analysis method and device
CN111813697B (en) Test coverage rate statistical method based on test object calling mark
CN111143370B (en) Method, apparatus and computer-readable storage medium for analyzing relationships between a plurality of data tables
CN109408385A (en) A kind of disfigurement discovery method based on mischief rule and classifying feedback
EP3113016A1 (en) Tracing dependencies between development artifacts in a development project
CN110806977A (en) Test case set generation method and device based on product requirements and electronic equipment
CN111177016B (en) Software test defect management method
US20070136333A1 (en) Method of inspection and a user interface for a business measure modeling tool
US20040255266A1 (en) Creating daily specific as-built reports for monitoring project events
Staron et al. Using models to develop measurement systems: a method and its industrial use
CN115859935A (en) Data analysis report template generation system and method based on index library
Wang et al. Quantitative analysis of requirements evolution across multiple versions of an industrial software product
CN114968348A (en) Data analysis method and device, electronic equipment and storage medium
CN111352824B (en) Test method and device and computer equipment
Eichelberger et al. A comprehensive survey of UML compliance in current modelling tools
CN114331165A (en) Automatic generation and analysis method and system for urban safety performance evaluation report

Legal Events

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