CN117331849A - Testing method and system based on accurate analysis of codes - Google Patents

Testing method and system based on accurate analysis of codes Download PDF

Info

Publication number
CN117331849A
CN117331849A CN202311633029.9A CN202311633029A CN117331849A CN 117331849 A CN117331849 A CN 117331849A CN 202311633029 A CN202311633029 A CN 202311633029A CN 117331849 A CN117331849 A CN 117331849A
Authority
CN
China
Prior art keywords
modification
code
determining
interface
flow
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
CN202311633029.9A
Other languages
Chinese (zh)
Other versions
CN117331849B (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.)
Hangyin Consumer Finance Co ltd
Original Assignee
Hangyin Consumer Finance 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 Hangyin Consumer Finance Co ltd filed Critical Hangyin Consumer Finance Co ltd
Priority to CN202311633029.9A priority Critical patent/CN117331849B/en
Publication of CN117331849A publication Critical patent/CN117331849A/en
Application granted granted Critical
Publication of CN117331849B publication Critical patent/CN117331849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis

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 testing method and a testing system based on accurate analysis of codes, which belong to the technical field of software testing and specifically comprise the following steps: the method comprises the steps of determining the modification positions of codes through analysis results of the codes before and after modification, determining code modification influence values of different modification positions based on code modification conditions and associated flow interfaces, determining associated codes of the flow interfaces and associated flow interfaces based on mapping relations between the flow interfaces and the codes, determining interface modification evaluation amounts of the flow interfaces by combining the associated flow interfaces corresponding to the different modification positions of the associated codes of the flow interfaces and the code modification influence values of the different modification positions, and screening test depths and test cases of the flow interfaces based on the interface modification evaluation amounts, so that differential tests of different flow interfaces are realized.

Description

Testing method and system based on accurate analysis of codes
Technical Field
The invention belongs to the technical field of software testing, and particularly relates to a testing method and system based on accurate analysis of codes.
Background
Along with the gradual transfer of the trust application from offline to online, the scale of the software system to be maintained is gradually increased, and meanwhile, the software system is often required to be tested by a certain number of test cases before being updated online, so how to realize test management on the software system, and the improvement of the test efficiency become the technical problem to be solved urgently.
In order to solve the technical problems, in the invention patent cn202310203517.X "test case auxiliary positioning method and device based on code analysis", the following technical problems exist, however, by obtaining the modification position of the submitted modification code, determining the target interface corresponding to the modification position based on the index information of the target file, and finally determining the target case corresponding to the target interface based on the association relationship between the pre-established interface and the case:
in the prior art, when updating or modifying a software system, code modification positions corresponding to different target interfaces are often more than one, and meanwhile, code modification conditions corresponding to different target interfaces are also different to a certain extent, so that if differential tests cannot be carried out according to the code modification conditions corresponding to different target structures, the requirements on test efficiency on the basis that the test depth meets the requirements cannot be ensured.
Aiming at the technical problems, the invention provides a testing method and a testing system based on accurate analysis of codes.
Disclosure of Invention
In order to achieve the purpose of the invention, the invention adopts the following technical scheme:
according to one aspect of the invention, a test method based on accurate analysis of codes is provided.
The testing method based on the accurate analysis of the codes is characterized by comprising the following steps of:
s1, determining a modification position of a code according to analysis results of the code before and after modification, determining a code modification condition of the modification position and an associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
s2, acquiring the number of the modified positions of the codes and code modification influence values of different modified positions, determining the comprehensive modified values of the codes by combining the modification conditions of the flow interfaces of the codes, judging whether the comprehensive modified values of the codes meet the requirements, if so, entering the next step, and if not, carrying out test processing on the codes through a complete test case;
s3, determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, and screening the test depth and test cases of the flow interface based on the interface modification evaluation quantity.
The invention has the beneficial effects that:
1. by determining the code modification influence values of different modification positions based on the code modification conditions and the associated flow interfaces, not only the modification conditions of the codes of the different modification positions are considered, but also the differences of the influence of the code modification of the different modification positions due to the differences of the number of the associated flow interfaces are considered, so that the accurate evaluation of the modification influence conditions of the different modification positions of the codes is realized.
2. The method has the advantages that the comprehensive modification value of the code is determined by combining the modification conditions of the flow interface of the code, the difference of the modification amplitude of the code caused by the number of modification positions and the difference of modification influence conditions is considered, and meanwhile, the modification conditions of the flow interface are also considered, so that the accurate evaluation of the modification degree of the code is realized, and a foundation is laid for realizing the screening of the code with larger modification amplitude.
3. The testing depth and the testing case of the flow interface are screened based on the interface modification evaluation, so that the accurate evaluation of the testing depth of different flow interfaces is realized from two angles of the modification condition of the corresponding codes of different flow interfaces and the modification condition of the associated flow interfaces, the testing reliability of the flow interfaces with larger modification amplitude is ensured, and the testing efficiency is improved.
The further technical scheme is that the determination of the modification position of the code is carried out according to the analysis results of the code before and after modification, and specifically comprises the following steps:
and acquiring the change information of the code through the message of the universal code management platform, and determining the modification position of the code based on the change information.
The further technical scheme is that the code modification condition of the modification position comprises the number of code modification lines of the modification position, the number of code modification functions and the number of code modification lines of different functions.
The further technical scheme is that judging whether the number of the associated flow interfaces meets the requirement or not specifically comprises:
and when the number of the associated flow interfaces is not in the range of the preset flow interfaces, determining that the number of the associated flow interfaces does not meet the requirement.
The further technical scheme is that judging whether the comprehensive modification value of the code meets the requirement or not specifically comprises:
and when the comprehensive modification value of the code is larger than a preset value, determining that the comprehensive modification of the code cannot meet the requirement.
The further technical scheme is that the screening of the test depth and the test case of the flow interface is performed based on the interface modification evaluation, and specifically comprises the following steps:
when the interface modification evaluation of the flow interface does not meet the requirement, determining that the test depth of the flow interface is 1, and performing test processing on the flow interface through a complete test case of the flow interface;
when the interface modification evaluation value of the flow interface meets the requirement, determining a test depth interval of the flow interface according to the interface modification evaluation value of the flow interface, and screening the test cases of the flow interface based on the number of the test cases corresponding to the test depth interval and the modification position corresponding to the flow interface.
On the other hand, the invention provides a testing system based on accurate code analysis, which adopts the testing method based on accurate code analysis and is characterized by comprising the following steps:
the system comprises a modification position evaluation module, a code modification evaluation module and an interface test module;
the modification position evaluation module is responsible for determining the modification position of the code according to analysis results of the code before and after modification, determining the code modification condition of the modification position and the associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
the code modification evaluation module is responsible for acquiring the number of modification positions of the code and code modification influence values of different modification positions;
the interface test module is responsible for determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, and screening the test depth and test cases of the flow interface based on the interface modification evaluation quantity.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention as set forth hereinafter.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings;
FIG. 1 is a flow chart of a test method based on code accurate analysis;
FIG. 2 is a flow chart of a method of modifying the determination of code modification effect values for locations;
FIG. 3 is a flow chart of a method of determination of a comprehensive modification value of a code;
FIG. 4 is a block diagram of a test system based on code accurate analysis;
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present disclosure.
The flow interface referred to in this application is an interface where software codes interact with a user and acquire user data.
When software testing is performed, the prior art scheme often determines the matched flow interfaces according to the modification condition of the code, and performs the test of the flow interfaces according to the modification condition, but ignores that once the number of the flow interfaces modified by the code is large, if the complete test cannot be performed at this time, the running reliability of the code cannot be ensured, meanwhile, generally, different flow interfaces often correspond to more than one modification position, and simultaneously, the modification position at the same position often corresponds to a plurality of flow interfaces, so that if the test depth and the screening of test cases cannot be comprehensively considered, the test reliability of different flow interfaces cannot be ensured to meet the requirements.
In order to solve the technical scheme, the following technical scheme is mainly adopted:
firstly, determining the modification positions of codes through analysis results of the codes before and after modification, and determining code modification influence values of different modification positions based on the code modification conditions of different modification positions and associated flow interfaces, wherein the code modification influence values can be determined specifically according to the ratio of code modification amounts to code amounts of different modification positions, the number of the associated flow interfaces to the number of the code flow interfaces and the number of the code flow interfaces;
then according to the number of the code modification positions and the code modification influence values of different modification positions and the modification condition of the flow interface of the code, determining the comprehensive modification value of the code, specifically, determining the modification influence values of different modification positions by the product of the ratio of the code modification quantity of the code modification positions to the code quantity of the code and the code modification influence value, and determining the comprehensive modification value of the code according to the number of the modification influence values of the code, when the comprehensive modification value of the code is larger, indicating that the modification amplitude of the code is too large, testing the code through a complete test case, and when the comprehensive modification value of the code is not large, entering the next step;
finally, determining an associated code of the flow interface and an associated flow interface based on a mapping relation between the flow interface and the code, determining an interface modification evaluation amount of the flow interface according to the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, specifically determining the interface modification evaluation amount of the flow interface according to the number of the code modification influence values of the flow interface and the number ratio of the number of the associated flow interface to the number of the flow interface of the code, and determining that the test depth of the flow interface is 1 when the interface modification evaluation amount of the flow interface does not meet the requirement, and performing test processing on the flow interface through a complete test example of the flow interface; when the interface modification evaluation value of the flow interface meets the requirement, determining a test depth interval of the flow interface according to the interface modification evaluation value of the flow interface, and screening the test cases of the flow interface based on the number of the test cases corresponding to the test depth interval and the modification position corresponding to the flow interface.
The following will describe in detail both from the point of view of the system class embodiment and the method class embodiment.
In order to solve the above-mentioned problems, according to one aspect of the present invention, as shown in fig. 1, there is provided a testing method based on accurate analysis of codes, which is characterized by comprising:
s1, determining a modification position of a code according to analysis results of the code before and after modification, determining a code modification condition of the modification position and an associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
it should be noted that, the determination of the modification position of the code is performed according to the analysis results of the code before and after modification, specifically includes:
and acquiring the change information of the code through the message of the universal code management platform, and determining the modification position of the code based on the change information.
Specifically, the code modification condition of the modification position includes the number of code modification lines of the modification position, the number of code modification functions and the number of code modification lines of different functions.
It should be noted that the number of code modification functions and the number of code modification lines of different functions are determined according to the push message of the general code management platform, and may also be determined by the recognition result of the keywords.
In one possible embodiment, as shown in fig. 2, the method for determining the code modification influence value of the modification position in the step S1 is as follows:
s11, determining the number of code modification lines and the number of code modification functions of the modification position based on the code modification condition of the modification position, and determining the basic influence quantity of the modification position based on the number of code modification lines and the number of code modification functions of the modification position;
s12, determining the number of the associated flow interfaces of the modification position through the code modification function, judging whether the number of the associated flow interfaces meets the requirement, if so, entering the next step, and if not, entering the step S14;
s13, determining the number of code modification lines of different code modification functions through the code modification functions, determining function modification influence values of the different code modification functions according to the number of associated flow interfaces of the different code modification functions, judging whether the code modification functions with the function modification influence values not meeting the requirements exist or not, if yes, entering the next step, and if not, taking the basic influence value of the modification position as the code modification influence value of the modification position;
in a possible embodiment, the determination of the function modification impact value of the code modification function is performed on the basis of the product of the ratio of the number of code modification lines of the code modification function to the number of original code lines, the number of associated traffic interfaces of the code modification function and the number of traffic interfaces of the code.
S14, taking the code modification function of which the function modification influence value of the modification position does not meet the requirement as an important modification function, and determining the comprehensive function modification influence value of the modification position based on the number of the important modification functions of the modification position and the number of the function modification influence values of the important modification functions, the number of the code modification functions of the modification position and the number of the function modification influence values of the code modification functions;
specifically, in one possible embodiment, the determination of the weight value of the important modification function is performed according to the ratio of the number of important modification functions of the modification location to the number of code modification functions of the modification location, the number of function modification influence values of the important modification function, and the ratio of the sum of the number of function modification influence values of the code modification function, so that the determination of the integrated function modification influence value of the modification location is performed according to the product of the weight value of the important modification function and the average value of the function modification influence values.
S15, acquiring the number of the associated flow interfaces of the modification position and the number of the associated code modification functions of different associated flow interfaces, and determining the code modification influence value of the modification position by combining the comprehensive function modification influence value of the modification position and the basic influence quantity of the modification position.
It should be further noted that, in one possible embodiment, the determination of the modification weights of the different associated flow interfaces is performed according to the number of associated code modification functions of the different associated flow interfaces of the modification location, and the determination of the normalized weight sum is obtained according to the modification weights of the different associated flow interfaces and the number of associated flow interfaces, and the determination of the code modification influence value of the modification location is performed by the integrated function modification influence value of the modification location, the basic influence amount of the modification location and the number of normalized weight sums.
Specifically, determining whether the number of associated traffic interfaces meets a requirement specifically includes:
and when the number of the associated flow interfaces is not in the range of the preset flow interfaces, determining that the number of the associated flow interfaces does not meet the requirement.
In another possible embodiment, the method for determining the code modification influence value of the modification position in the step S1 is as follows:
determining the number of code modification lines and the number of code modification functions of the modification position based on the code modification condition of the modification position, and determining the basic influence quantity of the modification position based on the number of code modification lines and the number of code modification functions of the modification position;
determining the code modification line numbers of different code modification functions through the code modification functions, and determining the function modification influence values of the different code modification functions by combining the number of associated flow interfaces of the different code modification functions;
when the number of function modification influence values of the code modification function of the modification position and the requirement are satisfied:
taking the basic influence quantity of the modification position as a code modification influence value of the modification position;
when the sum of the function modification influence values of the code modification function of the modification position does not meet the requirement:
taking the code modification function of which the function modification influence value of the modification position does not meet the requirement as an important modification function, and determining the comprehensive function modification influence value of the modification position based on the number of the important modification functions of the modification position and the number sum of the function modification influence values of the important modification functions, the number of the code modification functions of the modification position and the number of the function modification influence values of the code modification functions;
and acquiring the number of the associated flow interfaces of the modification position and the number of the associated code modification functions of different associated flow interfaces, and determining the code modification influence value of the modification position by combining the comprehensive function modification influence value of the modification position and the basic influence quantity of the modification position.
S2, acquiring the number of the modified positions of the codes and code modification influence values of different modified positions, determining the comprehensive modified values of the codes by combining the modification conditions of the flow interfaces of the codes, judging whether the comprehensive modified values of the codes meet the requirements, if so, entering the next step, and if not, carrying out test processing on the codes through a complete test case;
in one possible embodiment, as shown in fig. 3, the method for determining the comprehensive modification value of the code in the step S2 is as follows:
s21, acquiring the number of the modified positions of the codes, judging whether the number of the modified positions of the codes meets the requirement or not based on the code quantity of the codes, if so, entering the next step, if not, determining that the comprehensive modified value of the codes does not meet the requirement, and determining the comprehensive modified value of the codes through the code quantity and the number of the modified positions of the codes;
s22, determining the modification quantity of the flow interfaces of the codes according to the modification condition of the flow interfaces of the codes, determining whether the modification quantity of the flow interfaces meets the requirement or not based on the quantity of the flow interfaces of the codes, if so, entering the next step, if not, determining that the comprehensive modification value of the codes does not meet the requirement, and determining the comprehensive modification value of the codes according to the modification quantity of the flow interfaces of the codes and the quantity of the flow interfaces of the codes;
s23, determining the number of screening modification positions in the modification positions of the code based on code modification influence values of different modification positions, determining whether the comprehensive modification value of the code meets the requirement or not based on the number of screening modification positions, the number of code modification influence values, the number of modification positions, the number of code modification influence values of different modification positions and the determination of basic modification influence values of the code, if yes, entering the next step, if no, determining that the comprehensive modification value of the code does not meet the requirement, and taking the basic modification influence value of the code as the comprehensive modification value of the code;
s24, acquiring the number of the modification of the flow interfaces of the codes and the number of the flow interfaces of the codes, and determining the comprehensive modification value of the codes by combining the basic modification influence value of the codes.
It should be noted that, judging whether the comprehensive modification value of the code meets the requirement specifically includes:
and when the comprehensive modification value of the code is larger than a preset value, determining that the comprehensive modification of the code cannot meet the requirement.
In one possible embodiment, the method for determining the comprehensive modification value of the code in the step S2 is as follows:
acquiring the number of modification positions of the code, determining the number of screening modification positions in the modification positions of the code based on code modification influence values of different modification positions, and determining the code modification evaluation quantity of the code through the number of screening modification positions, the code total quantity, the number of modification positions and the code total quantity;
determining that the code modification evaluation amount of the code cannot meet the requirement based on the code amount of the code; determining that the comprehensive modification value of the code does not meet the requirement, and determining the comprehensive modification value of the code according to the code quantity and the number of modification positions of the code;
determining that the code modification evaluation value of the code satisfies the requirement based on the code amount of the code:
determining the modification quantity of the flow interfaces of the codes according to the modification condition of the flow interfaces of the codes, determining whether the modification quantity of the flow interfaces meets the requirement or not based on the quantity of the flow interfaces of the codes, if yes, entering the next step, if not, determining that the comprehensive modification value of the codes does not meet the requirement, and determining the comprehensive modification value of the codes according to the modification quantity of the flow interfaces of the codes and the quantity of the flow interfaces of the codes;
determining whether the comprehensive modification value of the code meets the requirement or not based on the number of the screening modification positions, the number of the code modification influence values, the number of the modification positions and the number of the code modification influence values of different modification positions and the basic modification influence values of the code, if yes, entering the next step, if not, determining that the comprehensive modification value of the code does not meet the requirement, and taking the basic modification influence value of the code as the comprehensive modification value of the code;
and acquiring the number of the modification of the flow interfaces of the codes and the number of the flow interfaces of the codes, and determining the comprehensive modification value of the codes by combining the basic modification influence value of the codes and the code modification evaluation value of the codes.
S3, determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, and screening the test depth and test cases of the flow interface based on the interface modification evaluation quantity.
In one possible embodiment, the method for determining the interface modification estimate of the flow interface in the step S3 is as follows:
determining the code quantity of the associated code of the flow interface and the number of the associated flow interfaces through the associated code of the flow interface and the associated flow interfaces, and determining the comprehensive modification proportion value of the flow interface by combining the code modification quantity of different modification positions of the associated code of the flow interface and the number of the associated flow interfaces of different modification positions, wherein when the comprehensive modification proportion value of the flow interface is larger than a preset proportion limiting quantity:
determining an interface modification evaluation amount of the flow interface through the comprehensive modification proportion value of the flow interface;
when the comprehensive modification proportion value of the flow interface is not more than a preset proportion limiting amount:
determining the number of the corresponding modification positions of the different associated flow interfaces of the flow interface and the code modification influence values of the different modification positions according to the corresponding associated flow interfaces of the different modification positions and the code modification influence values of the different modification positions, and determining the interface modification influence values of the different associated flow interfaces based on the number of the corresponding modification positions of the different associated flow interfaces of the flow interface and the code modification influence values of the different modification positions;
and determining an interface association modification quantity of the flow interface according to the interface modification influence values of different associated flow interfaces and the number of the associated flow interfaces, determining the comprehensive modification influence values of the flow interface according to the number of the associated code modification positions of the flow interface and the code modification influence values of different modification positions, and determining the interface modification evaluation quantity of the flow interface according to the comprehensive modification influence values of the flow interface and the comprehensive modification proportion values of the flow interface.
In one possible embodiment, the filtering of the test depth and the test case of the flow interface in the step S3 based on the interface modification estimate specifically includes:
when the interface modification evaluation of the flow interface does not meet the requirement, determining that the test depth of the flow interface is 1, and performing test processing on the flow interface through a complete test case of the flow interface;
when the interface modification evaluation value of the flow interface meets the requirement, determining a test depth interval of the flow interface according to the interface modification evaluation value of the flow interface, and screening the test cases of the flow interface based on the number of the test cases corresponding to the test depth interval and the modification position corresponding to the flow interface.
On the other hand, as shown in fig. 4, the present invention provides a testing system based on accurate code analysis, and the testing method based on accurate code analysis is characterized in that the testing system specifically includes:
the system comprises a modification position evaluation module, a code modification evaluation module and an interface test module;
the modification position evaluation module is responsible for determining the modification position of the code according to analysis results of the code before and after modification, determining the code modification condition of the modification position and the associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
the code modification evaluation module is responsible for acquiring the number of modification positions of the code and code modification influence values of different modification positions;
the interface test module is responsible for determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, and screening the test depth and test cases of the flow interface based on the interface modification evaluation quantity.
Through the above embodiments, the present invention has the following beneficial effects:
1. by determining the code modification influence values of different modification positions based on the code modification conditions and the associated flow interfaces, not only the modification conditions of the codes of the different modification positions are considered, but also the differences of the influence of the code modification of the different modification positions due to the differences of the number of the associated flow interfaces are considered, so that the accurate evaluation of the modification influence conditions of the different modification positions of the codes is realized.
2. The method has the advantages that the comprehensive modification value of the code is determined by combining the modification conditions of the flow interface of the code, the difference of the modification amplitude of the code caused by the number of modification positions and the difference of modification influence conditions is considered, and meanwhile, the modification conditions of the flow interface are also considered, so that the accurate evaluation of the modification degree of the code is realized, and a foundation is laid for realizing the screening of the code with larger modification amplitude.
3. The testing depth and the testing case of the flow interface are screened based on the interface modification evaluation, so that the accurate evaluation of the testing depth of different flow interfaces is realized from two angles of the modification condition of the corresponding codes of different flow interfaces and the modification condition of the associated flow interfaces, the testing reliability of the flow interfaces with larger modification amplitude is ensured, and the testing efficiency is improved.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, devices, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing is merely one or more embodiments of the present description and is not intended to limit the present description. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present description, is intended to be included within the scope of the claims of the present description.

Claims (10)

1. The testing method based on the accurate analysis of the codes is characterized by comprising the following steps of:
determining a modification position of the code according to analysis results of the code before and after modification, determining a code modification condition of the modification position and an associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
acquiring the number of the modified positions of the code and code modification influence values of different modified positions, determining the comprehensive modification value of the code by combining the modification condition of the flow interface of the code, judging whether the comprehensive modification value of the code meets the requirement, if so, entering the next step, and if not, carrying out test processing on the code through a complete test case;
and determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and the code modification influence values of different modification positions, and screening the test depth and the test cases of the flow interface based on the interface modification evaluation quantity.
2. The testing method based on accurate analysis of codes according to claim 1, wherein the determining of the modification position of the codes is performed according to analysis results of the codes before and after modification, specifically comprising:
and acquiring the change information of the code through the message of the universal code management platform, and determining the modification position of the code based on the change information.
3. The method of claim 1, wherein the code modification conditions of the modification locations include a number of code modification lines of the modification locations, a number of code modification functions, and a number of code modification lines of different functions.
4. The method for testing based on accurate analysis of codes according to claim 1, wherein the method for determining the code modification influence value of the modification position is as follows:
s11, determining the number of code modification lines and the number of code modification functions of the modification position based on the code modification condition of the modification position, and determining the basic influence quantity of the modification position based on the number of code modification lines and the number of code modification functions of the modification position;
s12, determining the number of the associated flow interfaces of the modification position through the code modification function, judging whether the number of the associated flow interfaces meets the requirement, if so, entering the next step, and if not, entering the step S14;
s13, determining the number of code modification lines of different code modification functions through the code modification functions, determining function modification influence values of the different code modification functions according to the number of associated flow interfaces of the different code modification functions, judging whether the code modification functions with the function modification influence values not meeting the requirements exist or not, if yes, entering the next step, and if not, taking the basic influence value of the modification position as the code modification influence value of the modification position;
s14, taking the code modification function of which the function modification influence value of the modification position does not meet the requirement as an important modification function, and determining the comprehensive function modification influence value of the modification position based on the number of the important modification functions of the modification position and the number of the function modification influence values of the important modification functions, the number of the code modification functions of the modification position and the number of the function modification influence values of the code modification functions;
s15, acquiring the number of the associated flow interfaces of the modification position and the number of the associated code modification functions of different associated flow interfaces, and determining the code modification influence value of the modification position by combining the comprehensive function modification influence value of the modification position and the basic influence quantity of the modification position.
5. The method for testing based on accurate analysis of codes according to claim 4, wherein determining whether the number of associated traffic interfaces meets the requirement comprises:
and when the number of the associated flow interfaces is not in the range of the preset flow interfaces, determining that the number of the associated flow interfaces does not meet the requirement.
6. The method for testing based on accurate analysis of codes according to claim 1, wherein determining whether the integrated modification value of the codes meets the requirement comprises:
and when the comprehensive modification value of the code is larger than a preset value, determining that the comprehensive modification of the code cannot meet the requirement.
7. The method for testing based on accurate analysis of codes according to claim 1, wherein the method for determining the comprehensive modification value of the codes is as follows:
acquiring the number of modification positions of the code, determining the number of screening modification positions in the modification positions of the code based on code modification influence values of different modification positions, and determining the code modification evaluation quantity of the code through the number of screening modification positions, the code total quantity, the number of modification positions and the code total quantity;
determining that the code modification evaluation amount of the code cannot meet the requirement based on the code amount of the code; determining that the comprehensive modification value of the code does not meet the requirement, and determining the comprehensive modification value of the code according to the code quantity and the number of modification positions of the code;
determining that the code modification evaluation value of the code satisfies the requirement based on the code amount of the code:
determining the modification quantity of the flow interfaces of the codes according to the modification condition of the flow interfaces of the codes, determining whether the modification quantity of the flow interfaces meets the requirement or not based on the quantity of the flow interfaces of the codes, if yes, entering the next step, if not, determining that the comprehensive modification value of the codes does not meet the requirement, and determining the comprehensive modification value of the codes according to the modification quantity of the flow interfaces of the codes and the quantity of the flow interfaces of the codes;
determining whether the comprehensive modification value of the code meets the requirement or not based on the number of the screening modification positions, the number of the code modification influence values, the number of the modification positions and the number of the code modification influence values of different modification positions and the basic modification influence values of the code, if yes, entering the next step, if not, determining that the comprehensive modification value of the code does not meet the requirement, and taking the basic modification influence value of the code as the comprehensive modification value of the code;
and acquiring the number of the modification of the flow interfaces of the codes and the number of the flow interfaces of the codes, and determining the comprehensive modification value of the codes by combining the basic modification influence value of the codes and the code modification evaluation value of the codes.
8. The testing method based on code precision analysis according to claim 1, wherein the method for determining the interface modification evaluation amount of the flow interface is as follows:
determining the code quantity of the associated code of the flow interface and the number of the associated flow interfaces through the associated code of the flow interface and the associated flow interfaces, and determining the comprehensive modification proportion value of the flow interface by combining the code modification quantity of different modification positions of the associated code of the flow interface and the number of the associated flow interfaces of different modification positions, wherein when the comprehensive modification proportion value of the flow interface is larger than a preset proportion limiting quantity:
determining an interface modification evaluation amount of the flow interface through the comprehensive modification proportion value of the flow interface;
when the comprehensive modification proportion value of the flow interface is not more than a preset proportion limiting amount:
determining the number of the corresponding modification positions of the different associated flow interfaces of the flow interface and the code modification influence values of the different modification positions according to the corresponding associated flow interfaces of the different modification positions and the code modification influence values of the different modification positions, and determining the interface modification influence values of the different associated flow interfaces based on the number of the corresponding modification positions of the different associated flow interfaces of the flow interface and the code modification influence values of the different modification positions;
and determining an interface association modification quantity of the flow interface according to the interface modification influence values of different associated flow interfaces and the number of the associated flow interfaces, determining the comprehensive modification influence values of the flow interface according to the number of the associated code modification positions of the flow interface and the code modification influence values of different modification positions, and determining the interface modification evaluation quantity of the flow interface according to the comprehensive modification influence values of the flow interface and the comprehensive modification proportion values of the flow interface.
9. The testing method based on code precision analysis according to claim 1, wherein the screening of the testing depth and the testing case of the flow interface is performed based on the interface modification evaluation, specifically comprising:
when the interface modification evaluation of the flow interface does not meet the requirement, determining that the test depth of the flow interface is 1, and performing test processing on the flow interface through a complete test case of the flow interface;
when the interface modification evaluation value of the flow interface meets the requirement, determining a test depth interval of the flow interface according to the interface modification evaluation value of the flow interface, and screening the test cases of the flow interface based on the number of the test cases corresponding to the test depth interval and the modification position corresponding to the flow interface.
10. A testing system based on accurate code analysis, which adopts the testing method based on accurate code analysis according to any one of claims 1 to 9, and is characterized by comprising the following steps:
the system comprises a modification position evaluation module, a code modification evaluation module and an interface test module;
the modification position evaluation module is responsible for determining the modification position of the code according to analysis results of the code before and after modification, determining the code modification condition of the modification position and the associated flow interface according to the code analysis results of the modification position, and determining code modification influence values of different modification positions based on the code modification condition and the associated flow interface;
the code modification evaluation module is responsible for acquiring the number of modification positions of the code and code modification influence values of different modification positions;
the interface test module is responsible for determining the associated code of the flow interface and the associated flow interface based on the mapping relation between the flow interface and the code, determining the interface modification evaluation quantity of the flow interface by combining the associated flow interface corresponding to different modification positions of the associated code of the flow interface and code modification influence values of different modification positions, and screening the test depth and test cases of the flow interface based on the interface modification evaluation quantity.
CN202311633029.9A 2023-12-01 2023-12-01 Testing method and system based on accurate analysis of codes Active CN117331849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311633029.9A CN117331849B (en) 2023-12-01 2023-12-01 Testing method and system based on accurate analysis of codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311633029.9A CN117331849B (en) 2023-12-01 2023-12-01 Testing method and system based on accurate analysis of codes

Publications (2)

Publication Number Publication Date
CN117331849A true CN117331849A (en) 2024-01-02
CN117331849B CN117331849B (en) 2024-02-27

Family

ID=89279807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311633029.9A Active CN117331849B (en) 2023-12-01 2023-12-01 Testing method and system based on accurate analysis of codes

Country Status (1)

Country Link
CN (1) CN117331849B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030212924A1 (en) * 2002-05-08 2003-11-13 Sun Microsystems, Inc. Software development test case analyzer and optimizer
US20040181763A1 (en) * 2003-03-14 2004-09-16 Soltis Donald C. Automatic manufacturing test case generation method and system
CN105320525A (en) * 2015-12-09 2016-02-10 扬州大学 Mobile-application-software-oriented change impact analysis method
CN109783382A (en) * 2019-01-07 2019-05-21 郑州云海信息技术有限公司 A kind of test method and system based on accurate test platform
CN109918127A (en) * 2019-03-07 2019-06-21 扬州大学 A kind of defect error correction method based on code revision pattern differentials
CN110489321A (en) * 2019-07-08 2019-11-22 平安科技(深圳)有限公司 Test case screening technique, device, computer equipment and storage medium
CN112817865A (en) * 2021-02-24 2021-05-18 福建天泉教育科技有限公司 Coverage precision test method and system based on componentized distributed system
CN114564388A (en) * 2022-02-23 2022-05-31 中国农业银行股份有限公司 Program testing method and device, electronic equipment and storage medium
CN115391228A (en) * 2022-09-20 2022-11-25 浙江极氪智能科技有限公司 Precise test method, device, equipment and medium
CN115658478A (en) * 2022-09-30 2023-01-31 北京百度网讯科技有限公司 Test case screening method and device, electronic equipment and storage medium
CN115794638A (en) * 2022-12-02 2023-03-14 平安银行股份有限公司 Test method, system and computer equipment based on code change analysis engine
CN116069667A (en) * 2023-03-06 2023-05-05 天津卓朗昆仑云软件技术有限公司 Test case auxiliary positioning method and device based on code analysis
CN116541278A (en) * 2023-05-05 2023-08-04 上海微盟企业发展有限公司 Unit test case generation method, device, equipment and storage medium
CN117009230A (en) * 2023-07-25 2023-11-07 北京泰策科技有限公司 Accurate test method and system based on code coverage rate evaluation

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030212924A1 (en) * 2002-05-08 2003-11-13 Sun Microsystems, Inc. Software development test case analyzer and optimizer
US20040181763A1 (en) * 2003-03-14 2004-09-16 Soltis Donald C. Automatic manufacturing test case generation method and system
CN105320525A (en) * 2015-12-09 2016-02-10 扬州大学 Mobile-application-software-oriented change impact analysis method
CN109783382A (en) * 2019-01-07 2019-05-21 郑州云海信息技术有限公司 A kind of test method and system based on accurate test platform
CN109918127A (en) * 2019-03-07 2019-06-21 扬州大学 A kind of defect error correction method based on code revision pattern differentials
CN110489321A (en) * 2019-07-08 2019-11-22 平安科技(深圳)有限公司 Test case screening technique, device, computer equipment and storage medium
CN112817865A (en) * 2021-02-24 2021-05-18 福建天泉教育科技有限公司 Coverage precision test method and system based on componentized distributed system
CN114564388A (en) * 2022-02-23 2022-05-31 中国农业银行股份有限公司 Program testing method and device, electronic equipment and storage medium
CN115391228A (en) * 2022-09-20 2022-11-25 浙江极氪智能科技有限公司 Precise test method, device, equipment and medium
CN115658478A (en) * 2022-09-30 2023-01-31 北京百度网讯科技有限公司 Test case screening method and device, electronic equipment and storage medium
CN115794638A (en) * 2022-12-02 2023-03-14 平安银行股份有限公司 Test method, system and computer equipment based on code change analysis engine
CN116069667A (en) * 2023-03-06 2023-05-05 天津卓朗昆仑云软件技术有限公司 Test case auxiliary positioning method and device based on code analysis
CN116541278A (en) * 2023-05-05 2023-08-04 上海微盟企业发展有限公司 Unit test case generation method, device, equipment and storage medium
CN117009230A (en) * 2023-07-25 2023-11-07 北京泰策科技有限公司 Accurate test method and system based on code coverage rate evaluation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LI, Z 等: "Research on Screening Methods of Autonomous Driving Dangerous Test Cases Based on Carmaker", INTERNATIONAL CONFERENCE ON SMART TRANSPORTATION AND CITY ENGINEERING 2021 *
周海旭;: "面向回归测试的代码变更影响度量模型", 计算机系统应用, no. 05 *

Also Published As

Publication number Publication date
CN117331849B (en) 2024-02-27

Similar Documents

Publication Publication Date Title
Ibbs et al. Quantified impacts of project change
Duchêne et al. New statistical criteria detect phylogenetic bias caused by compositional heterogeneity
CN117132001B (en) Multi-target wind control strategy optimization method and system
CN113535546B (en) Open source component evaluation method and device and computer readable storage medium
CN116611797B (en) Service tracking and monitoring method, system and storage medium
CN108921430A (en) Method and system for acquiring project workload
CN110764999A (en) Automatic testing method and device, computer device and storage medium
CN115879748A (en) Enterprise informatization management integration platform based on big data
CN117333290B (en) Integrated multi-scale wind control model construction method
CN117331849B (en) Testing method and system based on accurate analysis of codes
CN117435630B (en) Rule preposition-based data verification method and system
CN117349185A (en) System testing method based on interface strength dependence grading
CN117216454B (en) Reliability assessment method and device based on fuzzy non-probability, terminal and storage medium
CN117391436A (en) Enterprise risk monitoring method and device
CN106250993A (en) A kind of measurement equipment metering cycle method of adjustment based on warship maintenance section
CN102831320A (en) System of watershed water environment organic pollutant overall monitoring process quality control index evaluation method
CN113914850B (en) Model-based fault diagnosis method and system for oil pumping well comprehensive tester
CN105989095A (en) Association rule significance test method and device capable of considering data uncertainty
CN109214447A (en) Model training method and device, disk life-span prediction method and device
CN114912372A (en) High-precision filling pipeline fault early warning method based on artificial intelligence algorithm
CN114757166A (en) Evaluation method and device of natural language understanding system and network equipment
US20190205802A1 (en) Information processing device, information processing method and computer readable medium
CN112346995A (en) Construction method and device of test risk estimation model based on banking industry
CN113379311A (en) Method, device, equipment and storage medium for judging shale gas resource evaluation reliability
CN112988567A (en) Crowdsourcing test automated evaluation method and device

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