Program defect state synchronization method and device, equipment and storage medium
By automatically obtaining and synchronizing the configuration information of test management services and defect management services, the problem of complexity of operation switching between test management services and defect management services is solved, and automatic synchronization and update of defect status is achieved, and testing efficiency is improved.
Patent Information
- Application Number
- CN202410971698.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-05
AI Technical Summary
During software development and testing, operational switching between test management services and defect management services increases the complexity of management and tracking, resulting in a large amount of workload for manual maintenance programs.
By obtaining configuration information of test management services and defect management services, automatically create defect record items and establish association relationships, realize automatic synchronization and update of defect status, and reduce manual operations.
Reduces the complexity of management and tracking, improves program testing efficiency, and reduces the need for manual operations.
Smart Images

Figure CN118897701A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device and storage medium for synchronizing program defect status. Background Art
[0002] During the software development and testing process, test management service and defect management service are two independently set up services. Among them, test management service is used to effectively organize and manage the creation, maintenance and execution of test cases, and defect management service is used to record, track, report and solve problems or defects found in the software development process.
[0003] Among them, when developers discover defects when executing test cases in the test management service, they need to manually switch to the defect management service to submit defect record items. Moreover, after modifying the defect status of the defect record items in the defect management service according to the defect repair status, they need to manually update the corresponding use case execution results in the test management service, which increases the complexity of management and tracking. The workload of manual maintenance programs is large and needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for synchronizing the status of program defects, which solves the problem that the complexity of management and tracking is increased and the workload of manual maintenance of programs is large due to the need to manually switch between the test management service and the defect management service. It is achieved that there is no need to manually switch to the defect management service to create defect record items, and there is no need to manually switch to the test management service to update the defect status of defect record items, which reduces the complexity of management and tracking and is conducive to improving program testing efficiency.
[0005] In a first aspect, an embodiment of the present application provides a method for synchronizing a program defect state, the method comprising:
[0006] Obtaining first configuration information corresponding to the test management service, a test item identifier, and second configuration information corresponding to the defect management service;
[0007] Based on the first configuration information and the test item identifier, obtaining a test case identifier and defect detail information corresponding to the test case from the test management service;
[0008] Based on the second configuration information and the defect detail information, creating a defect record item in the defect management service and obtaining a defect identifier corresponding to the defect record item;
[0009] Establishing an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier;
[0010] When a trigger condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
[0011] In a second aspect, an embodiment of the present application further provides a program defect state synchronization device, including:
[0012] A service information acquisition module configured to acquire first configuration information corresponding to the test management service, a test item identifier, and second configuration information corresponding to the defect management service;
[0013] a test case information acquisition module configured to acquire a test case identifier and defect detail information corresponding to the test case from the test management service based on the first configuration information and the test item identifier;
[0014] a defect information determination module, configured to create a defect record item in the defect management service and obtain a defect identifier corresponding to the defect record item based on the second configuration information and the defect detail information;
[0015] a test case defect association module, configured to establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier;
[0016] The defect status updating module is configured to update the defect status identifier of the defect record item in the associated test case in the test management service according to the defect status of the defect record item in the defect management service when the triggering condition for updating the defect record item in the test management service is met.
[0017] In a third aspect, an embodiment of the present application further provides a program defect state synchronization device, the device comprising:
[0018] one or more processors;
[0019] a storage device configured to store one or more programs,
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the program defect status synchronization method described in the embodiment of the present application.
[0021] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the program defect state synchronization method described in the embodiment of the present application.
[0022] In an embodiment of the present application, by obtaining first configuration information corresponding to a test management service, a test project identifier, and second configuration information corresponding to a defect management service, based on the first configuration information and the test project identifier, a test case identifier and defect details information corresponding to the test case are obtained from the test management service, based on the second configuration information and the defect details information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained, and an association relationship between the test case and the defect record item is established in the test management service according to the first configuration information, the test case identifier, and the defect identifier, and when a trigger condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service. In the above scheme, by creating defect record items in the defect management service based on the acquired test case identifier and defect detail information, the defects generated after running the test case in the test management service can be automatically synchronized to the defect management service, without the need to manually switch to the defect management service to create defect record items; by establishing an association between test cases and defect record items in the test management service, the connection between the test management service and the defect management service can be effectively established, which is conducive to quickly locating the relevant test cases in the test management service when the defect status is updated; by regularly updating the relevant defect status of the test cases associated with the defect record items in the defect management service in the test management service, there is no need to manually switch the test management service to update the defect status of the defect record items, thereby reducing the complexity of management and tracking, which is conducive to improving program testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of a program defect status synchronization method provided by an embodiment of the present application;
[0024] Figure 2 A flowchart of a method for synchronizing program defect status including a process of obtaining a test case identifier and defect detail information corresponding to a test case provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a method for synchronizing a program defect status including a process of creating a defect record item and obtaining a defect identifier corresponding to the defect record item provided in an embodiment of the present application;
[0026] Figure 4 A flowchart of a program defect status synchronization method including a process of establishing an association relationship between a test case and a defect record item provided by an embodiment of the present application;
[0027] Figure 5A flowchart of a program defect status synchronization method including a process of updating a defect status identifier of a defect record item in a test management service through a client object is provided in an embodiment of the present application;
[0028] Figure 6 A flowchart of a program defect status synchronization method including a process of updating a defect status identifier of a defect record item in a test management service provided by an embodiment of the present application;
[0029] Figure 7 A structural block diagram of a program defect state synchronization device provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of a program defect status synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0033] In the program defect status synchronization method provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.
[0034] Figure 1 A flowchart of a method for synchronizing a program defect state provided by an embodiment of the present application. Figure 1 As shown, the program defect status synchronization method specifically includes the following steps:
[0035] Step S101: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service.
[0036] Among them, the test management service can be provided by a test management tool deployed on the server, and the test management tool can include Excel, PingCode, TestRail and TestLink, etc. The defect management service can be provided by a defect management tool deployed on the server, and the defect management tool can include Jira, Bugzilla, Redmin and ZenTao, etc., which are not limited in this application. The first configuration information can be the necessary configuration information for interacting with the test management service, and the second configuration information can be the necessary configuration information for interacting with the defect management service. The first configuration information or the second configuration information can include service resource address, user verification information, key information, access token information, etc., which can be selected by the developer according to the service access method of the actual application scenario, which is not limited in this application. In addition, at least one test project can be set in the test management service, and each test project can be set with a corresponding test case. If a defect occurs when the test case is running, a defect record item corresponding to the test case will be created.
[0037] Step S102: Based on the first configuration information and the test item identifier, obtain a test case identifier and defect detail information corresponding to the test case from a test management service.
[0038] According to different access protocols used in actual application scenarios, the communication method with the test management service is also different. The relevant access protocols may be HTTP, HTTPS, SSH, SOAP, FTP, etc., which are not limited in this application. In one embodiment, the HTTP access protocol may be used, and accordingly, the first configuration information may include a resource address and authentication information. The resource address may include a protocol, a domain name or an IP address, a port number, and a resource name, etc. The authentication information may be a user authentication information, a security key, or a security token, etc. Data interaction with the test management service may be achieved by sending an HTTP request. In one embodiment, the SSH access protocol may be used, and accordingly, the first configuration information may include a server address, a port number, and authentication information. The authentication information may be a user authentication information or a security key, etc. Data interaction with the test management service may be achieved by establishing a secure connection with the test management service. Of course, the aforementioned access method is only an exemplary description, and developers can make adaptive choices based on the security requirements and network configuration of the actual application scenario, which are not limited in this application. On the basis of successfully achieving data interaction with the test management service based on the first configuration information, the test case in the test management service can be located according to the test project identifier, and the corresponding test case identifier and defect detail information can be obtained. The test case identifier can be used to provide key information for establishing an association between the test case and the defect record item. The defect detail information can be the defect description content corresponding to the test case in the test management service, providing the required key information for synchronously creating a defect record item in the defect management service, such as title information, description information, version information, reproduction step information, and priority information.
[0039] Step S103: Based on the second configuration information and the defect detail information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained.
[0040] According to different access protocols used in actual application scenarios, the communication mode with the defect management service is also different. The relevant access protocols may be HTTP, HTTPS, SSH, SOAP, FTP, etc. In addition, the communication modes corresponding to the defect management service and the test management service may be the same or different, which is not limited in this application. In one embodiment, the HTTPS access protocol may be used. Accordingly, the second configuration information may include a resource address and a security certificate. The resource address may include a domain name or IP address of the server and a resource path to be accessed. The security certificate may include a public key, information of the certificate issuing authority, information of the certificate holder, and the validity period of the certificate. By establishing a secure communication channel, data interaction with the test management service is achieved by encrypting HTTP requests using an encryption algorithm and a session key. In one embodiment, the SOAP access protocol may be used. Accordingly, the second configuration information may include description information, subject information, and security authentication information. The description information may include a sender, a receiver, a processor, and a message processing rule. The subject information may include a method name, parameters, etc. The security authentication information may include user verification information or a digital signature, etc. Of course, the aforementioned access method is only an exemplary description, and developers can make adaptive choices based on the security requirements and network configuration of the actual application scenario, and this application does not limit it. Based on the successful data interaction with the defect management service based on the second configuration information, a defect record item can be created in the defect association service according to the defect details information, and the defect identifier corresponding to the defect record item can be obtained. The defect identifier can be used to provide key information for establishing the association relationship between the test case and the defect record item.
[0041] Step S104: Establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier.
[0042] Among them, based on the successful data interaction with the test management service based on the first configuration information, an association relationship between test cases and defect record items can be established accordingly, where the association relationship can include key-value pairs, comparison tables, etc., which are not limited in this application.
[0043] Step S105: When the triggering condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
[0044] Among them, since the developer needs to update the defect status of the relevant defect record item in the defect management service after completing the program repair, in order to synchronously update the corresponding defect record item in the test management service, the trigger condition of the defect record item in the test management service can be pre-set. In one embodiment, an update cycle can be set, and the trigger condition is that the current time reaches the cycle time node. The update cycle can be adaptively set by the developer according to the development cycle and time requirements of the actual application scenario, and this application is not limited here. In one embodiment, the defect management service can be configured to feedback an update notification message when a defect status update occurs, and the trigger condition is the update notification message received from the defect management service feedback. Of course, the developer can also set other trigger conditions according to the defect management requirements of the actual application scenario, and this application is not limited here. The defect status can be resolved, closed, suspended processing, etc., and the specific status type setting can be adaptively set by the developer according to the actual development needs, and this application is not limited here. In the case where an association relationship between test cases and defect record items has been established in the test management service, the defect record items in the defect management service can be obtained when the relevant trigger conditions are met. Since an association relationship between the test case and the defect record item has been established in step S104, the defect identifier of the defect record item can provide index information for determining the associated test case in the test management service, and, based on the defect status of the defect record item, the defect status identifier of the defect record item in the test case is updated accordingly. The defect status identifier can be used to characterize the processing status of the defect record item in the test case, and its specific form can be binary coding, digital numbering, etc., which is not limited in this application.
[0045] In the above, by obtaining the first configuration information corresponding to the test management service, the test project identifier and the second configuration information corresponding to the defect management service, based on the first configuration information and the test project identifier, the test case identifier and defect details information corresponding to the test case are obtained from the test management service, based on the second configuration information and the defect details information, a defect record item is created in the defect management service and the defect identifier corresponding to the defect record item is obtained, according to the first configuration information, the test case identifier and the defect identifier, an association relationship between the test case and the defect record item is established in the test management service, and when the trigger condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service. In the above scheme, by creating defect record items in the defect management service based on the acquired test case identifier and defect detail information, the defects generated after running the test case in the test management service can be automatically synchronized to the defect management service, without the need to manually switch to the defect management service to create defect record items; by establishing an association between test cases and defect record items in the test management service, the connection between the test management service and the defect management service can be effectively established, which is conducive to quickly locating the relevant test cases in the test management service when the defect status is updated; by regularly updating the relevant defect status of the test cases associated with the defect record items in the defect management service in the test management service, there is no need to manually switch the test management service to update the defect status of the defect record items, thereby reducing the complexity of management and tracking, which is conducive to improving program testing efficiency.
[0046] Figure 2 A flowchart of a method for synchronizing program defect status including a process of obtaining a test case identifier and defect details information corresponding to a test case is provided in an embodiment of the present application. Figure 2 As shown, the program defect status synchronization method specifically includes the following steps:
[0047] Step S201: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service, wherein the first configuration information includes a first resource address and a developer key.
[0048] Step S202: construct a second resource address for obtaining a test case identifier and defect detail information corresponding to the test case according to the first resource address, the developer key, and the test project identifier.
[0049] Wherein, taking the test management service as the TestLink service as an example, the first resource address may be the URL (Uniform Resource Locator) address of the TestLink service, for example, the first resource address is testlink_url='http: / / your-testlink-url', the developer key may be the authentication information for accessing the test management service, for example, the developer key is dev_key, and the test project identifier may be used to locate the program test project that currently needs to synchronize defect information, for example, the test project identifier is test_project_id. Taking Python and the Requests library as an example, the constructed second resource address may be as follows:
[0050] f'{testlink_url} / lib / api / xmlrpc / v1 / testcases / getTestCase&devKey={dev_key}&testproject_id={test_project_id}',
[0051] Among them, / lib / api / xmlrpc / v1 / testcases / getTestCase can be the endpoint path of the TestLink service API, which is used to obtain test case information, including the test case identifier and defect detail information.
[0052] Step S203: Send a first request corresponding to the second resource address to the test management service, so that the test management service feeds back first response information including the test case identifier and defect detail information.
[0053] Among them, taking the use of the Requests library as an example, the first request can be an HTTP GET request, which is used to request the test management service to obtain test case information according to the second resource address. If the first request response is successful, the first response information fed back by the test management service can be received. If the first request response fails, a response failure message is output, indicating that the acquisition of the test case information failed.
[0054] Step S204: When receiving the first response information fed back by the test management service, the first response information is parsed to obtain the test case identifier and defect detail information.
[0055] The first response information may be data in XML format or JSON format, etc. By using the corresponding parsing method or library to extract the target field value, the test case identifier and defect details information corresponding to the test case can be parsed.
[0056] Step S205: Based on the second configuration information and the defect detail information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained.
[0057] Step S206: Establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier.
[0058] Step S207: When the triggering condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
[0059] As described above, by constructing the second resource address, the endpoint related to the test case in the test management service can be accurately called. By initiating a first request to the test management service based on the second resource address, it can adapt to the access of different devices and platforms to the test management service, achieve stable communication interaction with the test management service, and effectively obtain the test case identification and defect details information.
[0060] Figure 3 A flowchart of a method for synchronizing a program defect status including a process of creating a defect record item and obtaining a defect identifier corresponding to the defect record item is provided in an embodiment of the present application. Figure 3 As shown, the program defect status synchronization method specifically includes the following steps:
[0061] Step S301: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service, wherein the second configuration information includes a third resource address and user verification information.
[0062] Step S302: Based on the first configuration information and the test item identifier, obtain the test case identifier and defect detail information corresponding to the test case from the test management service.
[0063] Step S303: construct a fourth resource address for operating the defect record item according to the third resource address.
[0064] In which, taking the defect management service as Jira service as an example, the third resource address may be the URL address of the Jira service, for example, the third resource address is jira_url='http: / / your-jira-url', and taking Python and Requests library as an example, the constructed fourth resource address may be as follows:
[0065] f'{jira_url} / rest / api / 2 / issue',
[0066] Among them, / rest / api / 2 / issue can be the endpoint path of the Jira API, which is used to operate the defect record items in the Jira service.
[0067] Step S304: Send a second request corresponding to the fourth resource address to the defect management service, so that the defect management service creates a defect record item and feeds back a second response information including a defect identifier corresponding to the defect record item. The second request carries user verification information and defect detail information.
[0068] Taking the Requests library as an example, the second request may be an HTTP POST request for requesting to create a defect record item in the defect management service. The user authentication information may be the username and password required to provide the authenticated user, for example, the user authentication information may include jira_username and jira_password. The defect details information may be the defect description content corresponding to the test case in the test management service, for example, the defect details information may be issue_data. The HTTP POST request may be as follows:
[0069] requests.post(f'{jira_url} / rest / api / 2 / issue',auth=(jira_username,jira_password),json=issue_data),
[0070] Wherein, jira_username and jira_password can be used for identity authentication, and issue_data can be converted into JSON format and used as the body of the request. If the second request response is successful, the second response information fed back by the defect management service can be received. If the second request response fails, a response failure message is output, indicating that the creation of the defect record item failed.
[0071] Step S305: When receiving the second response information fed back by the defect management service, the second response information is parsed to obtain a defect identifier.
[0072] The second response information may be data in XML format or JSON format, etc. By using a corresponding parsing method or library to extract the target field value, the defect identifier of the newly created absence record item can be parsed.
[0073] Step S306: Establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier.
[0074] Step S307: When the triggering condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
[0075] As described above, by constructing the fourth resource address, the endpoint related to the defect record item in the defect management service can be accurately called, and by initiating a second request to the defect management service based on the fourth resource address, it can adapt to the access of the defect management service to different devices and platforms, achieve stable communication interaction with the defect management service, and effectively create defect record items in the defect management service and obtain defect identifiers.
[0076] Figure 4 The present application embodiment provides a flowchart of a method for synchronizing a program defect status including a process of establishing an association relationship between a test case and a defect record item. Figure 4 As shown, the program defect status synchronization method specifically includes the following steps:
[0077] Step S401: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service, wherein the first configuration information includes a first resource address and a developer key.
[0078] Step S402: Based on the first configuration information and the test item identifier, obtain the test case identifier and defect detail information corresponding to the test case from the test management service.
[0079] Step S403: Based on the second configuration information and the defect detail information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained.
[0080] Step S404: construct a fifth resource address for establishing an association relationship between the test case and the defect record item according to the first resource address, the developer key, the test case identifier and the defect identifier.
[0081] Among them, taking the test management service as the TestLink service and the defect management service as the Jira service as an example, the first resource address can be the URL address of the TestLink service, for example, the first resource address is testlink_url, the developer key can be the authentication information for accessing the test management service, for example, the developer key is dev_key, the test case identifier can be taken from the test case that currently needs to synchronize defect information, for example, the test case identifier is test_case_id, and the defect identifier can be taken from the defect record item corresponding to the test case in the defect management service, for example, the defect identifier is jira_bug_key. Taking Python and the Requests library as an example, the fifth resource address constructed can be as follows:
[0082] f'{testlink_url} / lib / api / xmlrpc / v1 / testcases / addTcmBug&devKey={dev_key}&testcase_id={test_case_id}&tcm_bug_key={jira_bug_key}',
[0083] Among them, / lib / api / xmlrpc / v1 / testcases / addTcmBug may be an endpoint path of the TestLink service API, which is used to establish an association relationship between a test case and a defect record item.
[0084] Step S405: Send a third request corresponding to the fifth resource address to the test management service, so that the test management service establishes an association relationship between the test case and the defect record item.
[0085] Among them, taking the use of the Requests library as an example, the third request can be an HTTP GET request, which is used to request the test management service to establish an association relationship between the test case and the defect record item according to the fifth resource address. If the third request response is successful, the test management service can receive an association success message. If the third request response fails, a response failure message is output, indicating that the association failed. Optionally, if the third request response fails, the third request can be sent again to eliminate the impact of poor network fluctuations.
[0086] Step S406: When the triggering condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
[0087] As described above, by constructing the fifth resource address, the endpoint related to creating an association relationship in the test management service can be accurately called. By initiating a third request to the test management service based on the fifth resource address, stable communication interaction with the test management service can be achieved, and the association relationship between test cases and defect record items can be effectively created in the test management service.
[0088] Figure 5 The embodiment of the present application provides a flowchart of a method for synchronizing a program defect status including a process of updating a defect status identifier of a defect record item in a test management service through a client object. Figure 5 As shown, the program defect status synchronization method specifically includes the following steps:
[0089] Step S501: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service.
[0090] Step S502: Based on the first configuration information and the test item identifier, obtain the test case identifier and defect detail information corresponding to the test case from the test management service.
[0091] Step S503: Based on the second configuration information and the defect detail information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained.
[0092] Step S504: Establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier.
[0093] Step S505: When a trigger condition for updating the defect record item in the test management service is met, a target defect record item is queried from the defect management service through a pre-generated first client object.
[0094] The first client object may be created based on the configuration information required for interacting with the defect management service. In one embodiment, the specific implementation process of creating the first client object may be as follows:
[0095] The first target resource address and the first user authentication information of the defect management service are obtained, and the first client object is created according to the first target resource address and the first user authentication information. Taking Python and the defect management service as Jira service as an example, the configuration information required for interacting with the Jira service consists of the first target resource address and the first user authentication information. For example, the configuration information is as follows:
[0096]
[0097]
[0098] Correspondingly, the specific operations for creating the first client object are as follows:
[0099] jira_client=jira.JIRA(jira_options),
[0100] Among them, jira.JIRA (jira_options) can be used to create an instance of the JIRA class according to the configuration information, and jira_client is the first client object. The jira_client can be used to interact with the Jira service, such as creating issues, querying issue status, updating issues, etc. The specific operations of querying the target defect record item from the Jira service through jira_client are as follows:
[0101] jira_bugs=jira_client.search_issues('project="YourProjectKey"ANDissuetype=Bug'),
[0102] Among them, project="YourProjectKey" is the project identifier in the Jira service that needs to synchronize the defect status, issuetype="Bug" is to set the query field type to defect record item, jira_client.search_issues() is to query the defect record items in the Jira service according to the demand information through the first client object jira_client, and jira_bugs is the query result of the target defect record item.
[0103] In one embodiment, when it is detected that the interaction configuration information of the defect management service is changed or new interaction configuration information is received, the first client object may be regenerated.
[0104] Step S506: The pre-generated second client object requests the test management service to obtain the target defect identifier of the defect record item corresponding to the defect identifier in the associated test case according to the defect identifier of the target defect record item.
[0105] The second client object may be created based on the configuration information required to interact with the test management service. In one embodiment, the specific implementation process of creating the second client object may be as follows:
[0106] Get the second target resource address and second user authentication information of the test management service, and create a second client object according to the second target resource address and the second user authentication information. Taking Python and the test management service as the Testlink service as an example, the specific operations for creating the second client object are as follows:
[0107]
[0108]
[0109] Among them, 'http: / / testlink.yourcompany.com / testlink / lib / api / xmlrpc / v1 / xmlrpc.php' is the second target resource address, 'your_testlink_username' and 'your_testlink_password' are the username and password respectively, testlinkapi.TestlinkAPIClient() can be used to create a TestLink API client object according to the configuration information, tl_api is the second client object, and the tl_api can be used to interact with the TestLink service, such as creating test cases, querying test results, and associating defect records. The specific operation process of requesting the Testlink service to obtain the defect identifier of the defect record item in the associated test case through tl_api is as follows:
[0110] testlink_bugs=tl_api.getTestCaseIDByExternalID(bug.key),
[0111] if testlink_bugs:
[0112] testlink_bug_id=testlink_bugs[0],
[0113] Among them, bug.key is the defect identifier of the target defect record item queried from the defect management service, tl_api.getTestCaseIDByExternalID(bug.key) can be used to query the defect record item in the associated test case according to the defect identifier bug.key through the second client object tl_api, testlink_bugs is the acquisition result of the defect record item, and testlink_bug_id=testlink_bugs[0] is to extract the target defect identifier of the defect record item when the acquired defect record item is not empty.
[0114] In one embodiment, when it is detected that the interaction configuration information of the test management service has changed or new interaction configuration information has been received, the second client object may be regenerated.
[0115] Step S507: When the target defect identifier is obtained, the defect status identifier of the defect record item corresponding to the target defect identifier in the test management service is updated according to the defect status of the target defect record item through the second client object.
[0116] As described above, by creating the first client object and the second client object to communicate and interact with the defect management service and the test management service respectively, stable and reliable data transmission can be achieved, which is beneficial to security management and fault maintenance.
[0117] Figure 6 The present application embodiment provides a flowchart of a method for synchronizing a program defect status including a process of updating a defect status identifier of a defect record item in a test management service. Figure 6 As shown, the program defect status synchronization method specifically includes the following steps:
[0118] Step S601: Acquire first configuration information corresponding to a test management service, a test item identifier, and second configuration information corresponding to a defect management service.
[0119] Step S602: Based on the first configuration information and the test item identifier, obtain the test case identifier and defect detail information corresponding to the test case from the test management service.
[0120] Step S603: Based on the second configuration information and the defect detail information, a defect record item is created in the defect management service and a defect identifier corresponding to the defect record item is obtained.
[0121] Step S604: Establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier.
[0122] Step S605: When the trigger condition for updating the defect record item in the test management service is met, the state name attribute of the target defect record item in the defect management service is compared with a preset string, and the preset string includes a first string corresponding to the resolved state and a second string corresponding to the closed state.
[0123] Among them, the status name attribute can be used to characterize the current processing status of the defect record item in the defect management service. Taking Python as an example, the status name attribute of the defect record item can be expressed as bug.fields.status.name. The preset string can be set by the developer according to the different processing states of the defect record item. For example, the first string representing the resolved state can be "Resolved", which can indicate that the developer has completed the repair of the defect and has conducted necessary tests to ensure that the repair is effective, but further verification may be required. The second string representing the closed state can be "Closed", which can indicate that the developer has verified that the defect has been successfully repaired and no new problems have been introduced. Of course, developers can also set different defect states according to actual development needs, which is not limited in this application. The defect state of the defect record item can be determined by comparing the status name attribute of the defect record item with the first string and the second string for consistency.
[0124] Step S606: When the character content of the status name attribute is consistent with the first character string, the defect status indicator of the defect record item in the associated test case in the test management service is updated to a resolved indicator.
[0125] Among them, comparing the status name attribute with the first string can be to determine whether bug.fields.status.name=="Resolved" is true. If true, it means that the character content of the status name attribute is consistent with the first string. Accordingly, the defect status identifier of the defect record item in the test case associated with the test management service can be updated to a resolved identifier. The resolved identifier can be a representation that the defect record item is in a resolved state, and can be represented by binary encoding, digital numbering, etc., which is not limited in this application. In one embodiment, taking the test management service as the Testlink service as an example, a client object tl_api that interacts with the Testlink service can be created accordingly. The specific operation of updating the defect status identifier of the defect record item in the associated test case through the client object tl_api is as follows:
[0126] tl_api.updateTestCaseCustomField(testlink_bug_id,'status_id',17),
[0127] Among them, testlink_bug_id is the defect ID of the defect record item in the associated test case, status_id is the defect status ID, 17 is the resolved ID, tl_api.updateTestCaseCustomField()
[0128] The defect ID in the associated test case is updated to the defect status ID status_id of the defect record item of testlink_bug_id by calling the client object tl_api.
[0129] Step S607: When the character content of the status name attribute is consistent with the second character string, the defect status flag of the defect record item in the associated test case in the test management service is updated to a closed flag.
[0130] Among them, comparing the status name attribute with the second string can be to determine whether bug.fields.status.name=="Closed" is true. If true, it means that the character content of the status name attribute is consistent with the second string. Accordingly, the defect status identifier of the defect record item in the test case associated with the test management service can be updated to a closed identifier. The closed identifier can be a representation that the defect record item is in a closed state. It can be represented by binary encoding, digital numbering, etc., which is not limited in this application. In one embodiment, taking the test management service as the Testlink service as an example, a client object tl_api that interacts with the Testlink service can be created accordingly. The specific operation of updating the defect status identifier of the defect record item in the associated test case through the client object tl_api is as follows:
[0131] tl_api.updateTestCaseCustomField(testlink_bug_id,'status_id',18),
[0132] Among them, testlink_bug_id is the defect ID of the defect record item in the associated test case, status_id is the defect status ID, 18 is the closed ID, tl_api.updateTestCaseCustomField()
[0133] The defect ID in the associated test case is updated to the defect status ID status_id of the defect record item of testlink_bug_id by calling the client object tl_api.
[0134] As mentioned above, by comparing the status name attribute of the target defect record item with the preset string, the current processing status of the missing item record item in the defect management service can be effectively determined. By updating the defect status identifier of the defect record item in the associated test case in the test management service based on the comparison result, the defect status of the missing item management service and the test management service can be automatically synchronized, saving personnel workload and optimizing program defect management.
[0135] Figure 7 This is a structural block diagram of a program defect state synchronization device provided in an embodiment of the present application. The device is configured to execute the program defect state synchronization method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 7 As shown, the device specifically includes:
[0136] The service information acquisition module 101 is configured to acquire first configuration information corresponding to the test management service, a test item identifier, and second configuration information corresponding to the defect management service;
[0137] The use case information acquisition module 102 is configured to acquire the test case identifier and defect detail information corresponding to the test case from the test management service based on the first configuration information and the test project identifier;
[0138] The defect information determination module 103 is configured to create a defect record item in the defect management service and obtain a defect identifier corresponding to the defect record item based on the second configuration information and the defect detail information;
[0139] The test case defect association module 104 is configured to establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier and the defect identifier;
[0140] The defect status updating module 105 is configured to update the defect status identifier of the defect record item in the associated test case in the test management service according to the defect status of the defect record item in the defect management service when the triggering condition for updating the defect record item in the test management service is met.
[0141] In the above, by obtaining the first configuration information corresponding to the test management service, the test project identifier and the second configuration information corresponding to the defect management service, based on the first configuration information and the test project identifier, the test case identifier and defect details information corresponding to the test case are obtained from the test management service, based on the second configuration information and the defect details information, a defect record item is created in the defect management service and the defect identifier corresponding to the defect record item is obtained, according to the first configuration information, the test case identifier and the defect identifier, an association relationship between the test case and the defect record item is established in the test management service, and when the trigger condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service. In the above scheme, by creating defect record items in the defect management service based on the acquired test case identifier and defect detail information, the defects generated after running the test case in the test management service can be automatically synchronized to the defect management service, without the need to manually switch to the defect management service to create defect record items; by establishing an association between test cases and defect record items in the test management service, the connection between the test management service and the defect management service can be effectively established, which is conducive to quickly locating the relevant test cases in the test management service when the defect status is updated; by regularly updating the relevant defect status of the test cases associated with the defect record items in the defect management service in the test management service, there is no need to manually switch the test management service to update the defect status of the defect record items, thereby reducing the complexity of management and tracking, which is conducive to improving program testing efficiency.
[0142] In a possible embodiment, the first configuration information includes the first resource address and the developer key, and the use case information acquisition module 101 is further configured as follows:
[0143] Constructing a second resource address for obtaining a test case identifier and defect detail information corresponding to the test case according to the first resource address, the developer key, and the test project identifier;
[0144] Sending a first request corresponding to the second resource address to the test management service, so that the test management service feeds back a first response message including a test case identifier and defect detail information;
[0145] When the first response information fed back by the test management service is received, the first response information is parsed to obtain the test case identifier and defect detail information.
[0146] In a possible embodiment, the second configuration information includes the third resource address and user verification information, and the defect information determination module 102 is further configured as follows:
[0147] constructing a fourth resource address for operating the defect record item according to the third resource address;
[0148] Sending a second request corresponding to the fourth resource address to the defect management service, so that the defect management service creates a defect record item and feeds back second response information including a defect identifier corresponding to the defect record item, wherein the second request carries user verification information and defect detail information;
[0149] When the second response information fed back by the defect management service is received, the second response information is parsed to obtain a defect identifier.
[0150] In a possible embodiment, the first configuration information includes the first resource address and the developer key, and the use case defect association module 104 is further configured as follows:
[0151] Constructing a fifth resource address for establishing an association relationship between the test case and the defect record item according to the first resource address, the developer key, the test case identifier, and the defect identifier;
[0152] A third request corresponding to the fifth resource address is sent to the test management service, so that the test management service establishes an association relationship between the test case and the defect record item.
[0153] In a possible embodiment, the defect status updating module 105 is configured as follows:
[0154] Obtaining a target defect record item by querying from a defect management service through a pre-generated first client object;
[0155] By using the pre-generated second client object, according to the target defect identifier of the target defect record item, requesting the test management service to obtain the target defect identifier of the defect record item corresponding to the defect identifier in the associated test case;
[0156] When the target defect identifier is obtained, the defect status identifier of the defect record item corresponding to the target defect identifier in the test management service is updated according to the defect status of the target defect record item through the second client object.
[0157] In a possible embodiment, it further includes a client creation module configured to:
[0158] Acquire a first target resource address and first user authentication information of a defect management service, and create a first client object according to the first target resource address and the first user authentication information;
[0159] A second target resource address and second user authentication information of the test management service are obtained, and a second client object is created according to the second target resource address and the second user authentication information.
[0160] In a possible embodiment, the defect status updating module 105 is further configured to:
[0161] Comparing the state name attribute of the target defect record item in the defect management service with a preset string, the preset string including a first string corresponding to the resolved state and a second string corresponding to the closed state;
[0162] When the character content of the status name attribute is consistent with the first character string, updating the defect status indicator of the defect record item in the associated test case in the test management service to a resolved indicator;
[0163] When the character content of the status name attribute is consistent with the second character string, the defect status flag of the defect record item in the associated test case in the test management service is updated to a closed flag.
[0164] It is worth noting that in the embodiment of the above-mentioned program defect status synchronization device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the various modules are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0165] Figure 8 A schematic diagram of a program defect state synchronization device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 8 The example of connecting via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the program defect state synchronization method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned program defect state synchronization method. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0166] The program defect state synchronization device provided above can be used to execute the program defect state synchronization method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0167] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a program defect status synchronization method described in the above embodiment, which includes: obtaining first configuration information corresponding to a test management service, a test project identifier, and second configuration information corresponding to the defect management service; based on the first configuration information and the test project identifier, obtaining a test case identifier and defect details information corresponding to the test case from the test management service; based on the second configuration information and the defect details information, creating a defect record item in the defect management service and obtaining a defect identifier corresponding to the defect record item; establishing an association relationship between the test case and the defect record item in the test management service based on the first configuration information, the test case identifier, and the defect identifier; when a trigger condition for updating the defect record item in the test management service is met, updating the defect status identifier of the defect record item in the associated test case in the test management service based on the defect status of the defect record item in the defect management service.
[0168] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media or optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0169] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application is not limited to the above program defect state synchronization method, and the computer executable instructions can also execute related operations in the program defect state synchronization method provided in any embodiment of the present application.
[0170] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text when describing is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (fl ash RAM). The memory is an example of a computer-readable medium.
[0171] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0172] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for synchronizing program defect status, characterized in that: include: Obtaining first configuration information corresponding to the test management service, a test item identifier, and second configuration information corresponding to the defect management service; Based on the first configuration information and the test item identifier, obtaining a test case identifier and defect details information corresponding to the test case from the test management service; Based on the second configuration information and the defect details information, creating a defect record item in the defect management service and obtaining a defect identifier corresponding to the defect record item; Establishing an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier, and the defect identifier; When a trigger condition for updating the defect record item in the test management service is met, the defect status identifier of the defect record item in the associated test case in the test management service is updated according to the defect status of the defect record item in the defect management service.
2. The method for synchronizing program defect status according to claim 1, wherein: The first configuration information includes a first resource address and a developer key; The acquiring, from the test management service, a test case identifier and defect details information corresponding to the test case based on the first configuration information and the test item identifier, includes: Constructing a second resource address for obtaining a test case identifier and defect details corresponding to the test case according to the first resource address, the developer key, and the test project identifier; Sending a first request corresponding to the second resource address to the test management service, so that the test management service feeds back a first response message including the test case identifier and the defect details information; When the first response information fed back by the test management service is received, the first response information is parsed to obtain the test case identifier and the defect detail information.
3. The method for synchronizing program defect status according to claim 1, wherein: The second configuration information includes a third resource address and user authentication information; The creating a defect record item in the defect management service based on the second configuration information and the defect detail information and obtaining a defect identifier corresponding to the defect record item includes: constructing a fourth resource address for operating the defect record item according to the third resource address; sending a second request corresponding to the fourth resource address to the defect management service, so that the defect management service creates the defect record item and feeds back a second response message including a defect identifier corresponding to the defect record item, wherein the second request carries the user verification information and the defect details information; When the second response information fed back by the defect management service is received, the second response information is parsed to obtain the defect identifier.
4. The program defect status synchronization method according to claim 1, characterized in that: The first configuration information includes a first resource address and a developer key; The establishing, in the test management service, an association relationship between the test case and the defect record item according to the first configuration information, the test case identifier, and the defect identifier, includes: Constructing a fifth resource address for establishing an association relationship between the test case and the defect record item according to the first resource address, the developer key, the test case identifier, and the defect identifier; A third request corresponding to the fifth resource address is sent to the test management service, so that the test management service establishes an association relationship between the test case and the defect record item.
5. The method for synchronizing program defect status according to claim 1, wherein: The updating of the defect status identifier of the defect record item in the associated test case in the test management service according to the defect status of the defect record item in the defect management service includes: Obtaining a target defect record item by querying the defect management service through a pre-generated first client object; Using a pre-generated second client object, based on the defect identifier of the target defect record item, the test management service is requested to obtain the target defect identifier of the defect record item corresponding to the defect identifier in the associated test case; When the target defect identifier is obtained, the defect status identifier of the defect record item corresponding to the target defect identifier in the test management service is updated according to the defect status of the target defect record item through the second client object.
6. The method for synchronizing program defect status according to claim 5, wherein: Before obtaining the target defect record item from the defect management service through the pre-generated first client object, the method further includes: Acquire a first target resource address and first user authentication information of a defect management service, and create a first client object according to the first target resource address and the first user authentication information; A second target resource address and second user authentication information of the test management service are obtained, and a second client object is created according to the second target resource address and the second user authentication information.
7. The method for synchronizing program defect status according to claim 1, wherein: The updating of the defect identification of the defect record item in the associated test case in the test management service according to the defect status of the defect record item in the defect management service includes: Comparing a status name attribute of a defect record item in the defect management service with a preset character string, the preset character string including a first character string corresponding to a resolved status and a second character string corresponding to a closed status; When the character content of the status name attribute is consistent with the first character string, updating the defect status flag of the defect record item in the associated test case in the test management service to a resolved flag; When the character content of the status name attribute is consistent with the second character string, the defect status flag of the defect record item in the associated test case in the test management service is updated to a closed flag.
8. A program defect status synchronization device, characterized in that: include: A service information acquisition module configured to acquire first configuration information and a test item identifier corresponding to a test management service and second configuration information corresponding to a defect management service; a use case information acquisition module configured to acquire a test case identifier and defect details information corresponding to the test case from the test management service based on the first configuration information and the test item identifier; a defect information determining module configured to create a defect record item in the defect management service and obtain a defect identifier corresponding to the defect record item based on the second configuration information and the defect detail information; a use case defect association module configured to establish an association relationship between the test case and the defect record item in the test management service according to the first configuration information, the test case identifier, and the defect identifier; The defect status update module is configured to update the defect status identifier of the defect record item in the associated test case in the test management service according to the defect status of the defect record item in the defect management service when the trigger condition for updating the defect record item in the test management service is met.
9. A program defect status synchronization device, comprising: one or more processors; The storage device is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the program defect state synchronization method according to any one of claims 1 to 7.
10. A non-volatile storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the program defect state synchronization method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Cited By
Software tested test method based on defect embedding and defect switch
CN119201759A
