CN115904965A - Software test exception processing method and device, storage medium and computer equipment - Google Patents

Software test exception processing method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN115904965A
CN115904965A CN202211425994.2A CN202211425994A CN115904965A CN 115904965 A CN115904965 A CN 115904965A CN 202211425994 A CN202211425994 A CN 202211425994A CN 115904965 A CN115904965 A CN 115904965A
Authority
CN
China
Prior art keywords
target
test
processed
exception
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211425994.2A
Other languages
Chinese (zh)
Inventor
秦雯玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service 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 Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202211425994.2A priority Critical patent/CN115904965A/en
Publication of CN115904965A publication Critical patent/CN115904965A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a processing method and device for software test exception, a storage medium and computer equipment, relates to the technical field of software development and test, and mainly aims to solve the problem that code deletion is easily caused by deleting existing service codes in a software test process. The method mainly comprises the steps of obtaining file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed; loading target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader; and processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process. The method is mainly used for processing the exception in the software test.

Description

Software test exception processing method and device, storage medium and computer equipment
Technical Field
The invention relates to the technical field of software development and testing, in particular to a method and a device for processing software test exception, a storage medium and computer equipment.
Background
In the test process of software, error reporting conditions such as abnormal starting or abnormal running of test codes are inevitable. Some of the exceptions are generated by main flow codes needing to be tested, and some are generated by codes other than the main flow codes, that is, some exceptions are not the flow codes needing to be tested currently, and in general, when the occurring exceptions are caused by the non-main flow codes, the part of the codes are deleted, so that the influence of the non-main flow codes on the test is eliminated, and the effect of verifying the main flow codes is ensured.
When the running environment of the test code does not only include the test environment of the current test function, but includes the actual application environment of the whole business system, such as the local label machine environment, the deleted code is the existing business code corresponding to other functional modules in the business system, and the code is content which does not need to be concerned for the current test, but is very necessary for the business logic of the whole business system, so that the deleted code needs to be recovered after the test is completed, and if the code is not recovered and submitted, accidents such as system running abnormity, function loss and the like can be caused.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for processing software test exception, a storage medium, and a computer device, and mainly aims to solve the problem that deleting an existing service code in the existing software test process easily causes code loss.
According to one aspect of the present invention, a method for processing a software test exception is provided, which includes:
acquiring file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed;
loading target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader;
and processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content.
Further, before obtaining the information of the file to be processed and the abnormal information to be processed corresponding to the non-test target, the method further comprises the following steps:
acquiring a target test file and test exception information, wherein the test exception information comprises a test exception field and/or a test exception method and a test exception file where the test exception field and/or the test exception method are/is located;
matching the test abnormal file information with the target test file information, and if the test abnormal file is a non-target test file, determining the test abnormal file as a file to be processed;
and determining the test exception information in the file to be processed as exception information to be processed.
Further, the loading, based on the preconfigured loader, the target processing content matched with the to-be-processed exception information in the global file to the memory space includes:
reading a target file matched with the information of the file to be processed in the abnormal information to be processed from a global file based on a pre-configured loader;
determining target processing content from the target file based on the abnormal information to be processed;
and storing the target processing content to a memory space.
Further, before the target processing content matched with the to-be-processed exception information in the global file is loaded to the memory space based on the preconfigured loader, the method further includes:
and creating a listener for the target test system, wherein the listener is used for reading and loading the global file in the target test system.
Further, the target processing content includes target method content, and the processing the target processing content based on the non-test target processing policy includes:
analyzing the target method content to obtain a target method type corresponding to the target method content, and analyzing to obtain a first method declaration attribute value corresponding to the target method type;
analyzing according to the target method type to obtain a target method root attribute type, and analyzing to obtain a second method declaration attribute value corresponding to the target method root attribute type;
and respectively replacing the first method declaration attribute value and the second method declaration attribute value with an empty set.
Further, the target processing content includes target field content, and the processing the target processing content based on the non-test target processing policy includes:
analyzing the target field content to obtain a target field type corresponding to the target field content, and analyzing to obtain a first field declaration attribute value corresponding to the target field type;
analyzing according to the target field type to obtain a target field root attribute type, and analyzing to obtain a second field declaration attribute value corresponding to the target field root attribute type;
and respectively replacing the first field declaration attribute value and the second field declaration attribute value with an empty set.
Further, the method further comprises:
and if the matching result of the test abnormal file information and the target test file information is that the matching is passed, generating early warning information for prompting the abnormal operation of the test target.
According to another aspect of the present invention, there is provided a software test exception handling apparatus, including:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring to-be-processed file information and to-be-processed exception information corresponding to a non-test target, and the to-be-processed exception information comprises to-be-processed exception methods and/or to-be-processed exception fields;
the loading module is used for loading the target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader;
and the processing module is used for processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content.
Further, the apparatus further comprises:
the acquisition module is further used for acquiring a target test file and test exception information, wherein the test exception information comprises a test exception field and/or a test exception method and a test exception file where the test exception field and/or the test exception method are located;
the first determining module is used for matching the test abnormal file information with the target test file information, and if the test abnormal file is a non-target test file, determining the test abnormal file as a file to be processed;
and the second determining module is used for determining the test exception information in the file to be processed as the exception information to be processed.
Further, the loading module includes:
the reading unit is used for reading a target file matched with the information of the file to be processed in the abnormal information to be processed from the global file based on a pre-configured loader;
the determining unit is used for determining target processing content from the target file based on the to-be-processed abnormal information;
and the storage unit is used for storing the target processing content to a memory space.
Further, the apparatus further comprises:
and the creating module is used for creating a listener for the target test system, and the listener is used for reading and loading the global file in the target test system.
Further, the processing module includes:
the first analysis unit is used for analyzing the target method content to obtain a target method type corresponding to the target method content and analyzing to obtain a first method declaration attribute value corresponding to the target method type;
the second analysis unit is used for obtaining a target method root attribute type through analysis according to the target method type and obtaining a second method declaration attribute value corresponding to the target method root attribute type through analysis;
a first replacing unit, configured to replace the first method declaration attribute value and the second method declaration attribute value with an empty set respectively.
Further, the processing module includes:
a third analyzing unit, configured to analyze the target field content to obtain a target field type corresponding to the target field content, and analyze the target field type to obtain a first field declaration attribute value corresponding to the target field type;
a fourth analyzing unit, configured to analyze the target field type to obtain a target field root attribute type, and analyze to obtain a second field declaration attribute value corresponding to the target field root attribute type;
a second replacing unit, configured to replace the first field declaration attribute value and the second field declaration attribute value with an empty set respectively.
Further, the apparatus further comprises:
and the early warning module is used for generating early warning information for prompting the abnormal operation of the test target if the matching result of the test abnormal file information and the target test file information is that the test abnormal file information and the target test file information pass the matching.
According to another aspect of the present invention, there is provided a storage medium having at least one executable instruction stored therein, where the executable instruction causes a processor to execute an operation corresponding to the processing method for the software test exception.
According to still another aspect of the present invention, there is provided a computer apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the processing method of the software test exception.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
the invention provides a processing method and a device for software test exception, a storage medium and computer equipment, wherein the embodiment of the invention obtains file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed; loading target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader; processing the target processing content based on a non-test target processing strategy to enable the abnormal information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content, loading the file into a memory, and modifying the statement attribute and the root attribute of the code in the memory, so that the existing service code can be prevented from being deleted, the influence of the test process on the existing service code is greatly reduced, and meanwhile, the effect of shielding the test abnormality caused by the non-target test file is achieved, thereby effectively reducing the risk of the existing service code deletion caused by the test process and improving the safety of the software test process.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating a method for handling a software test exception according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for handling software test exceptions provided by embodiments of the present invention;
FIG. 3 is a flowchart illustrating a method for handling a software test exception according to an embodiment of the present invention
FIG. 4 is a block diagram illustrating an apparatus for handling a software test exception according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Aiming at the technical problems that the existing software test exception handling method is not only a test environment containing the current test function but also an actual application environment of the whole service system, such as a local label machine environment, when the running environment of a test code is not the test environment containing the current test function, the deleted code is the existing service code corresponding to other functional modules in the service system, the code is content which does not need to be concerned about for the current test, but is very necessary for the service logic of the whole service system, therefore, the deleted code needs to be recovered after the test is finished, and if the code is not recovered and submitted, accidents such as system running exception, function loss and the like can be caused. The embodiment of the invention provides a method for processing software test exception, as shown in fig. 1, the method comprises the following steps:
101. and acquiring information of the file to be processed and the abnormal information to be processed corresponding to the non-test target.
In the embodiment of the invention, the test target is the main process code which needs to be verified in the current test. Non-test targets are non-main flow code that the current test does not require verification. The codes are stored in corresponding class files, and the codes stored in the class files also contain attribute contents of corresponding fields and/or methods. For example, the current category includes fields such as name, age, identification number, etc. in the user information category, and also includes methods such as singing with good skill, dancing, etc. The exception information to be processed is the specific information of the exception which is configured in advance and needs to be processed, and comprises an exception method to be processed and/or an exception field to be processed and file information to be processed corresponding to the exception method to be processed and/or the exception field to be processed. The exception method to be processed is a test exception method expected to need processing, and the exception field to be processed is a test exception field expected to need processing. The test exception may be an exception caused by a field or an exception caused by a method, or may be an exception caused by a field or an exception caused by a method.
The test is performed in an actual application environment such as a local machine or a system server. Because the actual application environment is different from the simple test environment to a certain extent, an exception which hinders the start of the test project or the operation of the test project can be generated. The abnormality may be an abnormality of a test target or an abnormality of a non-test target. In order to eliminate the influence of the non-test target on the test, the to-be-processed exception information determined based on the exception corresponding to the non-test target is obtained, so that the exception of the non-test target is processed.
102. And loading the target processing content matched with the to-be-processed abnormal information in the global file to a memory space based on a pre-configured loader.
In the embodiment of the invention, the global file is all class files included in the current service system operated by the test. The loader is a listener callback interface registered in the current service system, and the listener callback interface is used for acquiring class files from the current service system. According to the test exception field and the test exception method in the exception information to be processed, only the field or the method which generates the exception can be determined, but the attribute corresponding to the field or the method does not exist. For example, the test exception field is "F: idGenerator" and the test exception method is "M: init". But the specific content of the field or method is not known, therefore, the content of the test exception field, i.e. the content of the target field, and/or the content of the test exception method, i.e. the content of the target method, needs to be found from the current system based on a pre-configured loader. Further, the target field content and/or the target method content are/is stored in a system memory, so that subsequent processing is only performed on the target field content and/or the target method content in the memory, the existing service codes in the current service system are not deleted and modified, the influence of a testing process on the existing service codes is reduced, and the testing safety is improved.
103. And processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process.
In the embodiment of the invention, the target processing content at least comprises one of target method content and target field content. The non-test target processing strategy comprises a processing rule for performing vacancy processing on the attribute corresponding to the target field content and a processing rule for performing vacancy processing on the attribute corresponding to the target method content. And after actual code operation verification, if the attribute values of the declaration attributes of the types corresponding to the field content and the method content and the declaration attributes of the root attribute types corresponding to the field content and the method content are null, the field content and the method content of the part cannot be identified and operated. Therefore, by performing the null processing on the content with the test exception or the attribute of the field content, the test exception method and the test exception field can be bypassed in the next test process. By recording the test exception method and the test exception field in the non-target test file into the memory and performing attribute vacancy processing, the exception of the non-target test file can be avoided in the test process while the original service code is not modified, so that the test is smooth, and the test efficiency is improved.
In an embodiment of the present invention, for further explanation and limitation, as shown in fig. 2, before the step 101 acquires information of a file to be processed and exception information to be processed corresponding to a non-test target, the method further includes:
201. and acquiring a target test file and test exception information.
202. And matching the test abnormal file information with the target test file information, and if the test abnormal file is a non-target test file, determining the test abnormal file as a file to be processed.
203. And determining the test exception information in the file to be processed as exception information to be processed.
In the embodiment of the invention, in the process of software testing, once a starting or running error occurs, the system stops running continuously and generates the test exception information comprising the specific code information corresponding to the test function exception. The test exception information comprises a test exception field and/or a test exception method and file information of a test exception file where the test exception field and/or the test exception method are located, namely test exception file information. In order to determine whether the current exception is generated for the target test file requiring test verification, the information of the target test file requiring current test is acquired. And determining whether the current abnormal file is the target test file or not based on the matching of the target test file information and the test abnormal file information. Specifically, matching is performed based on the file name of the target test file and the file name of the test exception file. If the current exception is generated by the non-target test file, the current tested exception is the content which does not need to be concerned, namely the content which needs to be subjected to exception handling, therefore, the test exception file which generates the current exception is determined as a file to be processed, the test exception field is determined as a field to be processed exception, and the test exception method is determined as a method to be processed exception. And configuring the information of the file to be processed, the field to be processed with the exception and the method to be processed with the exception into a json file, for example, a file named as error. The target test file information is matched with the abnormal test file information to determine the file to be processed, so that the target test file is distinguished from the abnormal and non-target test file, and the test process is smoother while the expected test effect of the test target is ensured.
For further explanation and limitation, in an embodiment of the present invention, as shown in fig. 3, the step 102 of loading, based on a preconfigured loader, target processing content in a global file, which is matched with the to-be-processed exception information, into a memory space includes:
301. reading a target file matched with the information of the file to be processed in the abnormal information to be processed from a global file based on a pre-configured loader;
302. and determining target processing content from the target file based on the abnormal information to be processed.
303. And storing the target processing content to a memory space.
In the embodiment of the invention, the loader is configured in advance and is used for reading and loading all code files in the system. In order to avoid modifying an original code file in the system, the specific file content of a target file needs to be read from the system based on a loader, the file content is analyzed into an identifiable code, the target method content and/or the target field content is identified from the code based on at least one of a to-be-processed exception method and a to-be-processed exception field, and the target method content or the target field content, or the target method content, namely the target field content, is loaded into a memory. For example, if the file name of the target file to be processed is com, gap, etc., client, im, unicorn client, and the Field of the exception to be processed is F (Field): idgenertor, the file named "com, gap, etc., client, im, unicorn client" is read from the system based on the loader, and the Field (target Field content) corresponding to "idgenertor" is identified from the file. By loading the target method content or the target field content from the system based on the loader, the cache codes in the memory are modified instead of modifying the original file in the abnormal processing process of the non-target test file, so that the modification of the original file in the service system is avoided while the test fluency is ensured, and the safety of code debugging in the test process is ensured.
In an embodiment of the present invention, for further explanation and limitation, before the loading, based on the preconfigured loader, the target processing content in the global file, which is matched with the to-be-processed exception information, to the memory space in step 102, the method further includes:
and creating a listener aiming at the target test system, wherein the listener is used for reading and loading the global file in the target test system.
In the embodiment of the invention, the target test system is a system for executing the current test operation. The listener is a listener callback interface. In order to read a file in a system, a listener callback interface needs to be registered in the system in advance, so that reading of all files in a target test system and loading of part of files are realized based on the listener callback interface.
In an embodiment of the present invention, for further explanation and limitation, the target processing content in step 103 includes target method content, and the processing the target processing content based on the non-test target processing policy includes:
analyzing the target method content to obtain a target method type corresponding to the target method content, and analyzing to obtain a first method declaration attribute value corresponding to the target method type;
analyzing the target method type to obtain a target method root attribute type, and analyzing to obtain a second method declaration attribute value corresponding to the target method root attribute type;
and respectively replacing the first method declaration attribute value and the second method declaration attribute value with an empty set.
In the embodiment of the present invention, the target method type is a data type of the target method content, for example, if the target method content is composed of character type data, it is determined that the target method type is character type. The first method declaration attribute value is a declaration attribute corresponding to the target method type. The target method root attribute type is the type of the root attribute value corresponding to the target method type. The second method declaration attribute is an attribute value of a declaration attribute of the target method root attribute type. And replacing the obtained first method declaration attribute value and the second method declaration attribute value with a null set. For example, if the target method type is aclas, then find the declear indices attribute corresponding to aclas based on aclas, and replace the value of the attribute with new HashMap < Class >? extenss association >, association > (). Finding a root attribute based on ACLass, determining the type BClass of the value of the root attribute, finding a clasededanotions attribute corresponding to the BClass based on the BClass, and replacing the value of the attribute with new HashMap < Class >? extensions indication >, indication >.
It should be noted that by analyzing the first method declaration attribute value and the second method declaration attribute value of the target method content and replacing the attribute values with the null sets, the processed target method content is not triggered in the subsequent test operation, so that the obstruction of the non-test target to the test process is greatly reduced, and the test efficiency is effectively improved.
In an embodiment of the present invention, for further explanation and limitation, the step 103 of processing the target processing content includes target field content, and the processing the target processing content based on the non-test target processing policy includes:
analyzing the target field content to obtain a target field type corresponding to the target field content, and analyzing to obtain a first field declaration attribute value corresponding to the target field type;
analyzing according to the target field type to obtain a target field root attribute type, and analyzing to obtain a second field declaration attribute value corresponding to the target field root attribute type;
and respectively replacing the first field declaration attribute value and the second field declaration attribute value with an empty set.
In the embodiment of the invention, the target field type is the data type corresponding to the target field content. The first field declaration attribute value is an attribute value of the declaration attribute corresponding to the target field type. The target field root attribute type is the type of the root attribute value corresponding to the target field type. The second field declaration attribute value is an attribute value of a declaration attribute of the target field root attribute type. The method for processing the target field content based on the non-test target processing policy is consistent with the method for processing the target method content, and a specific implementation process for processing the target method content can be referred to, which is not described herein again in the embodiments of the present invention.
It should be noted that by analyzing the first field declaration attribute value and the second field declaration attribute value of the target field content and replacing the attribute values with null sets, the processed target field content is not triggered in subsequent test operation, so that the obstruction of a non-test target on the test process is greatly reduced, and the test efficiency is effectively improved.
In an embodiment of the present invention, for further explanation and limitation, the method further comprises:
and if the matching result of the test abnormal file information and the target test file information is that the matching is passed, generating early warning information for prompting the abnormal operation of the test target.
In the embodiment of the invention, if the current exception is generated by the target test file and indicates that the current tested exception is the content needing attention and modification, the early warning information for prompting the exception handling is generated, so that a developer can adjust the code in time.
The invention provides a processing method of software test exception, which comprises the steps of acquiring file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed; loading target processing content matched with the to-be-processed abnormal information in the global file to a memory space based on a pre-configured loader; processing the target processing content based on a non-test target processing strategy to enable the abnormal information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content, loading the file into a memory, and modifying the statement attribute and the root attribute of the code in the memory, so that the existing service code can be prevented from being deleted, the influence of the test process on the existing service code is greatly reduced, and meanwhile, the effect of shielding the test abnormality caused by the non-target test file is achieved, thereby effectively reducing the risk of the existing service code deletion caused by the test process and improving the safety of the software test process.
As an implementation of the method shown in fig. 1, an embodiment of the present invention provides a device for processing a software test exception, where as shown in fig. 4, the device includes:
the acquiring module 41 is configured to acquire to-be-processed file information and to-be-processed exception information corresponding to a non-test target, where the to-be-processed exception information includes to-be-processed exception methods and/or to-be-processed exception fields;
a loading module 42, configured to load, based on a preconfigured loader, target processing content in the global file that is matched with the to-be-processed exception information to a memory space;
a processing module 43, configured to process the target processing content based on a non-test target processing policy, so that the to-be-processed exception information is not triggered in a test process, where the non-test target processing policy includes at least one processing rule for performing null processing on an attribute corresponding to the target processing content.
Further, the apparatus further comprises:
the acquisition module is further used for acquiring a target test file and test exception information, wherein the test exception information comprises a test exception field and/or a test exception method and a test exception file where the test exception field and/or the test exception method are located;
the first determining module is used for matching the test exception file information with the target test file information, and if the test exception file is a non-target test file, determining the test exception file as a file to be processed;
and the second determining module is used for determining the test exception information in the file to be processed as exception information to be processed.
Further, the loading module 42 includes:
the reading unit is used for reading a target file matched with the information of the file to be processed in the abnormal information to be processed from a global file based on a pre-configured loader;
the determining unit is used for determining target processing content from the target file based on the to-be-processed abnormal information;
and the storage unit is used for storing the target processing content to a memory space.
Further, the apparatus further comprises:
and the creating module is used for creating a listener for the target test system, and the listener is used for reading and loading the global file in the target test system.
Further, the processing module 43 includes:
the first analysis unit is used for analyzing the target method content to obtain a target method type corresponding to the target method content and analyzing to obtain a first method declaration attribute value corresponding to the target method type;
the second analysis unit is used for obtaining a target method root attribute type through analysis according to the target method type and obtaining a second method declaration attribute value corresponding to the target method root attribute type through analysis;
a first replacement unit, configured to replace the first method declaration attribute value and the second method declaration attribute value with an empty set respectively.
Further, the processing module 43 includes:
a third analyzing unit, configured to analyze the target field content to obtain a target field type corresponding to the target field content, and analyze the target field type to obtain a first field declaration attribute value corresponding to the target field type;
the fourth analysis unit is used for obtaining a target field root attribute type through analysis according to the target field type and obtaining a second field declaration attribute value corresponding to the target field root attribute type through analysis;
a second replacing unit, configured to replace the first field declaration attribute value and the second field declaration attribute value with an empty set respectively.
Further, the apparatus further comprises:
and the early warning module is used for generating early warning information for prompting the abnormal operation of the test target if the matching result of the test abnormal file information and the target test file information is that the test abnormal file information and the target test file information pass the matching.
The invention provides a processing device for software test exception, which is characterized in that the embodiment of the invention obtains file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed; loading target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader; processing the target processing content based on a non-test target processing strategy so as to prevent the abnormal information to be processed from being triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content, loading the file into the memory, and modifying the declaration attribute and the root attribute of the code in the memory, so that the existing service code can be prevented from being deleted, the influence of the test process on the existing service code is greatly reduced, and meanwhile, the effect of shielding the test abnormality caused by the non-target test file is achieved, so that the risk of the existing service code missing caused by the test process is effectively reduced, and the safety of the software test process is improved.
According to an embodiment of the present invention, a storage medium is provided, where at least one executable instruction is stored, and the computer executable instruction can execute the processing method of the software test exception in any of the above method embodiments.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computer device.
As shown in fig. 5, the computer apparatus may include: a processor (processor) 502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with each other via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically execute relevant steps in the above-described method for handling a software test exception.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The computer device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may specifically be used to cause the processor 502 to perform the following operations:
acquiring file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed;
loading target processing content matched with the to-be-processed abnormal information in the global file to a memory space based on a pre-configured loader;
and processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content.
It will be apparent to those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented in program code executable by a computing device, such that they may be stored in a memory device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for processing software test exception is characterized by comprising the following steps:
acquiring file information to be processed and exception information to be processed corresponding to a non-test target, wherein the exception information to be processed comprises an exception method to be processed and/or an exception field to be processed;
loading target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader;
and processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content.
2. The method according to claim 1, wherein before obtaining the to-be-processed file information and the to-be-processed exception information corresponding to the non-test target, the method further comprises:
acquiring target test file information, test abnormal file information and test abnormal information;
matching the test abnormal file information with the target test file information, and if the test abnormal file is a non-target test file, determining the test abnormal file as a file to be processed;
and determining the test exception information in the file to be processed as exception information to be processed.
3. The method according to claim 1, wherein the loading target processing content matched with the exception information to be processed in the global file to a memory space based on a preconfigured loader comprises:
reading a target file matched with the information of the file to be processed in the abnormal information to be processed from a global file based on a pre-configured loader;
determining target processing content from the target file based on the abnormal information to be processed;
and storing the target processing content to a memory space.
4. The method according to claim 1, wherein before loading the target processing content matched with the exception information to be processed in the global file into the memory space based on the preconfigured loader, the method further comprises:
and creating a listener aiming at the target test system, wherein the listener is used for reading and loading the global file in the target test system.
5. The method of claim 1, wherein the target process content comprises target method content, and wherein processing the target process content based on a non-test target processing policy comprises:
analyzing the target method content to obtain a target method type corresponding to the target method content, and analyzing to obtain a first method declaration attribute value corresponding to the target method type;
analyzing the target method type to obtain a target method root attribute type, and analyzing to obtain a second method declaration attribute value corresponding to the target method root attribute type;
and respectively replacing the first method declaration attribute value and the second method declaration attribute value with an empty set.
6. The method of claim 1, wherein the target processing content comprises target field content, and wherein processing the target processing content based on a non-test target processing policy comprises:
analyzing the target field content to obtain a target field type corresponding to the target field content, and analyzing to obtain a first field declaration attribute value corresponding to the target field type;
analyzing according to the target field type to obtain a target field root attribute type, and analyzing to obtain a second field declaration attribute value corresponding to the target field root attribute type;
and respectively replacing the first field declaration attribute value and the second field declaration attribute value with an empty set.
7. The method of claim 2, further comprising:
and if the matching result of the test abnormal file information and the target test file information is that the matching is passed, generating early warning information for prompting the abnormal operation of the test target.
8. A device for handling software test exceptions, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring to-be-processed file information and to-be-processed exception information corresponding to a non-test target, and the to-be-processed exception information comprises to-be-processed exception methods and/or to-be-processed exception fields;
the loading module is used for loading the target processing content matched with the abnormal information to be processed in the global file to a memory space based on a pre-configured loader;
and the processing module is used for processing the target processing content based on a non-test target processing strategy so as to enable the exception information to be processed not to be triggered in the test process, wherein the non-test target processing strategy comprises at least one processing rule for performing null processing on the attribute corresponding to the target processing content.
9. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the method of handling a software test exception as recited in any one of claims 1-7.
10. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the processing method of the software test exception according to any one of claims 1-7.
CN202211425994.2A 2022-11-15 2022-11-15 Software test exception processing method and device, storage medium and computer equipment Pending CN115904965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211425994.2A CN115904965A (en) 2022-11-15 2022-11-15 Software test exception processing method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211425994.2A CN115904965A (en) 2022-11-15 2022-11-15 Software test exception processing method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN115904965A true CN115904965A (en) 2023-04-04

Family

ID=86486384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211425994.2A Pending CN115904965A (en) 2022-11-15 2022-11-15 Software test exception processing method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN115904965A (en)

Similar Documents

Publication Publication Date Title
CN109726093B (en) Method, apparatus and computer program product for executing test cases
US11157390B2 (en) Automatic software defect repair
US8997086B2 (en) Fix delivery system
US10977162B2 (en) Real time application error identification and mitigation
US7712087B2 (en) Methods and systems for identifying intermittent errors in a distributed code development environment
CN110413507B (en) System test method, device, computer equipment and storage medium
CN114116496A (en) Automatic testing method, device, equipment and medium
CN111782526A (en) Interface testing method and device, electronic equipment and storage medium
CN115328759A (en) Form verification method and device
CN110245074B (en) Log record generation method and device, storage medium and server
CN117370767B (en) User information evaluation method and system based on big data
US8479163B2 (en) Simplifying maintenance of large software systems
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN112988578A (en) Automatic testing method and device
CN112256532A (en) Test interface generation method and device, computer equipment and readable storage medium
CN111752838A (en) Question checking method and device, server and storage medium
CN115904965A (en) Software test exception processing method and device, storage medium and computer equipment
US11880470B2 (en) System and method for vulnerability detection in computer code
CN111752600B (en) Code anomaly detection method and device, computer equipment and storage medium
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN112748950A (en) Software code examination method and device
US8826262B2 (en) Realtime tracking of software components
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN113360365A (en) Flow testing method and flow testing system
CN111290870A (en) Method and device for detecting abnormity

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