Method and electronic device for supporting code test

The method compares test images with reference images to determine code merging in CI/CD environments, addressing the need for effective code testing and ensuring UI consistency, thereby enhancing code testing productivity and accuracy in collaborative development.

WO2025009641A1PCT designated stage expired Publication Date: 2025-01-09COUPANG CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2023/009749
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-05
Filing Date
2023-07-10
Publication Date
2025-01-09

AI Technical Summary

Technical Problem

In CI/CD environments, there is a growing need for effective code testing methods that verify test case passing criteria and manage test-related data across multiple developers, as service version upgrades diversify, and existing methods are inadequate for ensuring accurate code merging and UI consistency.

Method used

A method and device that support code testing by comparing a test image generated based on target code with a reference image, determining whether to merge the target code into the reference code based on the comparison result, and generating control information for merging, including requests for confirmation or modification if differences exceed a threshold.

Benefits of technology

This approach ensures accurate code merging and UI consistency by effectively comparing test images with reference images, allowing for efficient management of code changes and preventing unintended UI changes, thereby improving code testing productivity in collaborative development environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2023009749_09012025_PF_FP_ABST
    Figure KR2023009749_09012025_PF_FP_ABST
Patent Text Reader

Abstract

A method and an electronic device for supporting a code test are disclosed. The method comprises the steps of: identifying a pull request for a target code to be subjected to a code test; identifying test case information for the code test; identifying a reference image corresponding to the test case information; identifying the pull request for the target code; identifying, in response to the pull request, a test image generated on the basis of the target code according to the test case information; identifying a comparison result of the reference image and the test image; and generating control information regarding whether to merge the target code into a reference code on the basis of the comparison result.
Need to check novelty before this filing date? Find Prior Art

Description

Methods and electronic devices to support code testing

[0001] Embodiments of the present disclosure relate to a method and an electronic device for supporting code testing. More specifically, embodiments of the present disclosure relate to a method and device for supporting code testing by comparing an image generated based on a code test with a reference image.

[0002] In a continuous integration / continuous delivery (CI / CD) workflow environment that automates application development steps to deliver applications to customers in shorter cycles, the need for multiple developers to perform various types of code tests is increasing. As service version upgrades diversify, methods for verifying whether test case pass criteria are met based on test case configuration are necessitating improved methods. Furthermore, in an environment where multiple developers are modifying code, the need for effective and productive management of test-related data is growing.

[0003] In relation to this, reference can be made to prior literature such as KR102156931B1 and KR101691929.

[0004] The present disclosure is proposed to solve the above-described problems, and provides a method and an electronic device to support code testing.

[0005] More specifically, the present disclosure provides a device that verifies test case information, verifies a corresponding reference image, and then compares a test image generated based on a test target code with the reference image to generate control information on whether to merge the target code into the reference code.

[0006] The technical tasks to be achieved by this embodiment are not limited to the technical tasks described above, and other technical tasks can be inferred from the following embodiments.

[0007] As a technical means for achieving the above-described task, a method for supporting code testing in an electronic device according to a first aspect of the present disclosure may include: a step of confirming a pull request for a target code to be the target of the code test; a step of confirming test case information for the code test; a step of confirming a reference image corresponding to the test case information; a step of confirming a test image generated based on the target code according to the test case information in response to the pull request; a step of confirming a comparison result between the reference image and the test image; and a step of generating control information on whether to merge the target code into the reference code based on the comparison result.

[0008] The above reference image may include a basic reference image generated based on the target code according to the test case information and a temporary reference image generated based on the temporary code according to the test case information.

[0009] A method for supporting code testing in an electronic device may further include a step of generating a base reference image generated based on a new reference code into which the target code is merged.

[0010] The step of verifying the test image may include a step of generating the test image based on a reference code that merges the target code into the reference code through a test server, and verifying the test image.

[0011] The step of generating control information on whether to merge the target code into the reference code may include the step of passing the pull request when the comparison results are the same, and the step of generating control information on whether to merge the target code into the reference code.

[0012] The step of generating control information on whether to merge the target code into the reference code may include the step of generating a control signal requesting confirmation of the target code from the worker terminal when the comparison results are not the same, and the step of generating control information on whether to merge the target code into the reference code based on the request.

[0013] The step of generating control information on whether to merge the target code into the reference code based on the request may include the steps of: receiving a response to the request; passing the pull request if the difference between the reference image and the test image is less than a threshold value; and generating control information on whether to merge the target code into the reference code.

[0014] The step of generating control information on whether to merge the target code into the reference code may include the step of generating a control signal requesting confirmation of the target code from the worker terminal when the comparison results are not the same, and the step of generating control information on whether to merge the target code into the reference code based on the request.

[0015] The step of generating control information on whether to merge the target code into the reference code based on the request may include the steps of: receiving a response to the request; passing the pull request if the difference between the reference image and the test image is less than a threshold value; and generating control information on whether to merge the target code into the reference code.

[0016] The step of generating control information on whether to merge the target code into the reference code based on the request may include: receiving a response to the request; blocking the pull request if the difference between the reference image and the generated test image is greater than or equal to a threshold value; transmitting a control signal on a request for modifying the test code to a worker terminal; passing the modified pull request if the difference between the reference image and the modified test image is less than the threshold value based on the response to the modification request; and generating control information on whether to merge the target code into the reference code.

[0017] A method for supporting code testing in an electronic device may further include a step of merging the target code based on the control information, and a step of dropping the temporary reference image included in the reference image if the reference image includes a temporary reference image.

[0018] The step of verifying the above comparison result may include a step of verifying the comparison result between a basic reference image generated based on the target code and a test image generated based on the target code, if the reference image does not include a temporary reference image.

[0019] An electronic device supporting a code test according to a second aspect of the present disclosure may include a transceiver; a storage for storing one or more commands; and a processor configured to: confirm a pull request for a target code to be the target of the code test; confirm test case information for the code test; confirm a reference image corresponding to the test case information; confirm a test image generated based on the target code according to the test case information in response to the pull request; confirm a comparison result of the reference image and the test image; and generate control information on whether to merge the target code into the reference code based on the comparison result.

[0020] The recording medium according to the third aspect of the present disclosure may be a non-transitory recording medium readable by a computer having recorded thereon a program for execution on a computer.

[0021]

[0022] According to one embodiment of the present specification, when supporting code testing, an electronic device may check test case information, check a corresponding reference image, check a test image generated based on a target code for which a pull request has been received, compare the test image with the reference image, and then generate control information on whether to merge the target code into the reference code. In addition, the electronic device may further reduce the weight of the code testing support system by discarding a temporary reference image included in the reference image after the target code has been merged into the reference code.

[0023] The effects of the invention are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description of the claims.

[0024]

[0025] Figure 1 illustrates a system according to one embodiment.

[0026] FIG. 2 is a diagram illustrating a concept of a method for supporting code testing according to one embodiment.

[0027] FIG. 3 is a diagram illustrating an embodiment of performing error tracing in a method for supporting code testing according to one embodiment.

[0028] Figure 4 is a flowchart illustrating a method for supporting code testing according to one embodiment.

[0029] FIG. 5a and FIG. 5b are flowcharts specifically describing a system that supports code testing according to one embodiment.

[0030] FIG. 6 is a block diagram schematically illustrating an electronic device supporting code testing according to one embodiment.

[0031]

[0032] The terms used in the embodiments have been selected from widely used and common terms, taking into account the functions of the present disclosure. However, these terms may vary depending on the intentions of those skilled in the art, precedents, the emergence of new technologies, etc. Furthermore, in certain cases, terms may be arbitrarily selected by the applicant, in which case their meanings will be described in detail in the relevant description. Therefore, the terms used in this disclosure should not be defined simply as names of terms, but rather based on the meanings of the terms and the overall content of the present disclosure.

[0033] When a part of the specification is said to "include" a component, this does not exclude other components, but rather implies the inclusion of other components, unless otherwise specifically stated. Furthermore, terms such as "part" and "module" used in the specification mean a unit that processes at least one function or operation, which may be implemented in hardware, software, or a combination of hardware and software.

[0034] The expression “at least one of a, b, and c” described throughout the specification may encompass ‘a alone’, ‘b alone’, ‘c alone’, ‘a and b’, ‘a and c’, ‘b and c’, or ‘all of a, b, and c’.

[0035] The "terminal" mentioned below may be implemented as a computer or portable terminal that can connect to a server or other terminal via a network. Here, the computer includes, for example, a notebook, desktop, laptop, etc. equipped with a web browser, and the portable terminal may include, for example, a wireless communication device that guarantees portability and mobility, and may include all types of handheld-based wireless communication devices such as communication-based terminals such as IMT (International Mobile Telecommunication), CDMA (Code Division Multiple Access), W-CDMA (W-Code Division Multiple Access), LTE (Long Term Evolution), smartphones, tablet PCs, etc.

[0036] Below, embodiments of the present disclosure are described in detail with reference to the attached drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be implemented in various different forms and is not limited to the embodiments described herein.

[0037] Hereinafter, embodiments of the present invention will be described in detail with reference to the attached drawings.

[0038] In describing the embodiments, descriptions of technical details that are well known in the technical field to which the present invention pertains and are not directly related to the present invention will be omitted. This is to avoid obscuring the gist of the present invention by omitting unnecessary explanations and to convey the gist more clearly.

[0039] For the same reason, some components in the attached drawings are exaggerated, omitted, or schematically depicted. Furthermore, the dimensions of each component do not entirely reflect its actual size. Identical or corresponding components in each drawing are assigned the same reference numbers.

[0040] The advantages and features of the present invention, and the methods for achieving them, will become clearer with reference to the embodiments described in detail below together with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below and may be implemented in various different forms. These embodiments are provided only to ensure that the disclosure of the present invention is complete and to fully inform those skilled in the art of the scope of the invention, and the present invention is defined only by the scope of the claims. Like reference numerals refer to like elements throughout the specification.

[0041] At this time, it will be understood that each block of the processing flow diagrams and combinations of the flow diagrams can be performed by computer program instructions. These computer program instructions can be installed in a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing equipment, so that the instructions executed by the processor of the computer or other programmable data processing equipment create a means for performing the functions described in the flow diagram block(s). These computer program instructions can also be stored in a computer-available or computer-readable memory that can direct a computer or other programmable data processing equipment to implement the functions in a specific manner, so that the instructions stored in the computer-available or computer-readable memory can also produce a manufactured item that includes an instruction means for performing the functions described in the flow diagram block(s). Since the computer program instructions may be installed on a computer or other programmable data processing device, a series of operational steps may be performed on the computer or other programmable data processing device to create a computer-executable process, and the instructions that cause the computer or other programmable data processing device to perform the steps for performing the functions described in the flowchart block(s) may also provide steps for performing the functions described in the flowchart block(s).

[0042] Additionally, each block may represent a module, segment, or portion of code that contains one or more executable instructions for performing a specific logical function(s). It should also be noted that in some alternative implementation examples, the functions described in the blocks may occur out of order. For example, two blocks depicted in succession may actually be executed substantially concurrently, or the blocks may sometimes be executed in reverse order, depending on their respective functions.

[0043]

[0044] Figure 1 illustrates a system according to one embodiment.

[0045] Referring to FIG. 1, the system may include at least one of an electronic device (100), a worker terminal (120), a database (140), and a network (160). Meanwhile, the system illustrated in FIG. 1 only illustrates components related to the present embodiment. Therefore, those skilled in the art will appreciate that, in addition to the components illustrated in FIG. 1, other general-purpose components may be included.

[0046] An electronic device (100) is a device that configures and provides various types of information. The electronic device (100) may provide the configured information as a web page or application screen, or may provide the information in a form that can be displayed as a web page or application screen on a receiving terminal.

[0047] According to one embodiment, the electronic device (100) can convert log data that the operator wants to check into a set type and store it in a database (140).

[0048] For example, the electronic device (100) may receive a pull-up request for a test target code for modifying an application from a worker terminal (120) for an application that is the target of a task, and may obtain test case setup information for performing a test case for the application through a database (140). The test case setup information obtained through the database (140) may be used in the process of the electronic device (100) obtaining a result for the test case. In addition, the electronic device (100) may check log data including information according to the execution of the application obtained based on a code regarding log data including information about access to the database (140), and may store one or more raw data including the log data in the database (140). Thereafter, the electronic device (100) may check at least one raw data including set identification information among the one or more raw data, and may convert the type of at least one log data included in the at least one raw data and store the converted data in the database (140).

[0049] The worker terminal (120) allows workers to more conveniently check log data corresponding to a specific field using the worker terminal (120). For example, the worker can provide a code related to the log data they wish to check via the worker terminal (120). Furthermore, the worker can check log data stored in the database (140) using the worker terminal (120).

[0050] The database (140) can freely perform functions such as storing, searching, deleting, editing, or adding data. For example, the database (140) may include fields or components for processing functions such as storing, searching, deleting, editing, or adding data. In addition, the database (140) may store log data including information according to the execution of an application, one or more raw data including the log data, and log data converted into a set type.

[0051] Meanwhile, although FIG. 1 illustrates that the database (140) exists outside the electronic device (100), this is merely an example, and the database (140) may be included in the electronic device (100). In addition, the database (140) may include one or more sub-databases, and each of the one or more sub-databases may store log data including information according to the execution of the application, one or more raw data including the log data, and log data converted into a set type. In addition, the electronic device (100) and the database (140) may be logically distinguished on a cloud infrastructure that provides computing resources and networking functions necessary for the execution and management of the application, and may be implemented to be able to communicate with each other through a networking protocol on the cloud infrastructure.

[0052] The worker terminal (120), the database (140), and the electronic device (100) can communicate with each other within the network (160). The network (160) includes a Local Area Network (LAN), a Wide Area Network (WAN), a Value Added Network (VAN), a mobile radio communication network, a satellite communication network, and a combination thereof, and is a comprehensive data communication network that enables each network component illustrated in FIG. 1 to communicate smoothly with each other, and may include wired Internet, wireless Internet, and a mobile radio communication network. Wireless communication may include, but is not limited to, wireless LAN (Wi-Fi), Bluetooth, Bluetooth low energy, Zigbee, Wi-Fi Direct (WFD), ultra wideband (UWB), infrared communication (IrDA, infrared Data Association), NFC (Near Field Communication), etc., for example.

[0053] Each of the electronic device (100) and the worker terminal (120) may include a transceiver, storage, and a processor. In addition, each of the electronic device (100) and the worker terminal (120) refers to a unit that processes at least one function or operation, which may be implemented by hardware, software, or a combination of hardware and software. Meanwhile, throughout the embodiments, each of the electronic device (100) and the worker terminal (120) is referred to as a separate device or server, but this may be a logically divided structure, and at least some of them may be implemented by a separate function in one device or server.

[0054] According to one embodiment, the electronic device (100) and the worker terminal (120) may include a plurality of computer systems or computer software implemented as network servers. For example, at least some of the electronic device (100) and the worker terminal (120) may refer to a computer system and computer software that are connected to a lower device that can communicate with other network servers through a computer network such as an intranet or the Internet, receive a task execution request, perform the task accordingly, and provide the execution result. In addition, at least some of the electronic device (100) and the worker terminal (120) may be understood as a broad concept that includes a series of application programs that can operate on a network server, and various databases built on other internal or connected nodes. For example, at least some of the electronic device (100) and the worker terminal (120) may be implemented using a network server program that is variously provided according to an operating system such as DOS, Windows, Linux, UNIX, or MacOS.

[0055] The electronic device (100) and the worker terminal (120) can communicate with each other through a network (160). The network (160) includes a local area network (LAN), a wide area network (WAN), a value-added network (VAN), a mobile radio communication network, a satellite communication network, and a combination thereof, and is a comprehensive data communication network that allows the constituent entities of each network (160) illustrated in FIG. 1 to communicate smoothly with each other, and may include wired Internet, wireless Internet, and mobile radio communication networks. Wireless communication may include, but is not limited to, wireless LAN (Wi-Fi), Bluetooth, Bluetooth low energy, Zigbee, Wi-Fi Direct (WFD), ultra wideband (UWB), infrared communication (IrDA, infrared Data Association), NFC (Near Field Communication), etc., for example.

[0056]

[0057] FIG. 2 is a diagram illustrating a concept of a method for supporting code testing according to one embodiment.

[0058] Referring to FIG. 2, an electronic device (100) that performs a method for supporting code testing according to an embodiment can create (201) a release branch (202) for code testing. After a new branch (204) is created in a worker terminal (120), the electronic device (100) can check a pull request (205) for a target code to be tested from the worker terminal (120). The electronic device (100) that supports code testing can check a test image (new screen shot) (207) created based on the target code according to test case information that exists in response to the pull request (205) corresponding to an application to be the target of the code test. In one embodiment, a code change (204-1) may occur in a release branch (202) upon creation of a new branch (204), and based on this, the electronic device (100) may perform an operation of driving a code case for the application whenever the application is newly updated.

[0059] An electronic device (100) supporting code testing according to an embodiment can identify a reference image corresponding to test case information, and the reference image can include, for example, an image included in a default baseline image (203) including a basic reference image generated based on a target code according to test case information, or a temp baseline image (206) including a temporary reference image generated based on a temporary code according to test case information.

[0060] An electronic device (100) supporting code testing according to an embodiment can check a comparison result (208) of a reference image and a test image (207), and generate control information on whether to merge (209) the target code into the reference code based on the comparison result (208). For example, the reference image may be a snapshot image for checking a UI display in a desired direction that has already been confirmed based on the reference code. After the electronic device (100) executes a test case for an application in response to a pull request, the electronic device (100) can check whether the UI has been changed for the test case by comparing the test image based on the target code with the reference image. For example, if the comparison result of the test image and the reference image are the same, the electronic device (100) can pass the target code, and if the test image and the reference image are not the same, it can prevent unintended UI changes by checking whether the test image has been changed to suit the purpose of the code test. The electronic device (100) can generate control information on whether to merge (209) the target code into the reference code based on the comparison result (208) through the bug tracking system, which will be discussed in detail below. After merging (209) the target code into the reference code, the electronic device (100) can generate a basic reference image based on the new reference code into which the target code has been merged, and use this for future testing.

[0061] An electronic device (100) supporting code testing according to an embodiment can discard (210) a temp baseline (206) after merging (209) a target code into a reference code, and multiple code changes (211) can occur according to the new merged code. A method for supporting code testing through such steps can provide the effect of lightening the overall architecture by discarding (210) a temp baseline (206) generated for testing after merging the target code.

[0062]

[0063] FIG. 3 is a diagram illustrating an embodiment of performing error tracing in a method for supporting code testing according to one embodiment.

[0064] Referring to FIG. 3, an electronic device (100) supporting a code test according to an embodiment can check test case information (301) and check a reference image corresponding to the test case information (301). Here, the reference image may include, for example, an image included in a default baseline image (303) including a basic reference image generated based on a target code according to the test case information (301) as described in FIG. 2, or a temp baseline image (306) including a temporary reference image generated based on a temporary code according to the test case information.

[0065] An electronic device (100) supporting code testing according to an embodiment can check whenever a pull request (305) for a target code occurs. In an embodiment, the electronic device (100) can check test images (new screenshots) (307) generated based on the target code according to test case information (301) in response to the pull request (305) as described in FIG. 2. In an embodiment, the electronic device (100) can check a comparison result (308) of a reference image and a test image (307) as described in FIG. 2.

[0066] In one embodiment, the electronic device (100) may pass (310) the pull request (305) and generate control information on whether to merge the target code into the reference code if the comparison results (308) of the reference image and the test image (307) are the same, thereby merging (312) the target code into the reference code.

[0067] An electronic device (100) according to an embodiment may automatically create (305-1) an error tracking system (309) based on a pull request (305). In addition, the electronic device (100) according to an embodiment may pass (310) the pull request (305) through an error tracking system (309) that includes information about a link of the pull request (305), information about a title, and information about an owner, if the comparison result (308) of the reference image and the test image (307) are not the same, or may block (311) the pull request (305). In one embodiment, the electronic device (100) may merge (312) the target code without a separate target code modification according to the passage (310) of the pull request (305) or the block (311) of the pull request (305), or may merge (312) the modified target code after requesting modification of the target code to the worker terminal (120) of the target code.

[0068] According to one embodiment, the electronic device (100) may discard (313) a temporary reference image generated based on the temporary code according to the test case information for testing as described above in FIG. 2 after merging (312) the target code. The electronic device (100) may then perform a code change (314) according to the newly merged code.

[0069] An electronic device (100) according to one embodiment can update a default baseline image (203) according to a new code by generating new basic reference images based on a new test code after performing a code change (314).

[0070]

[0071] Figure 4 is a flowchart illustrating a method for supporting code testing according to one embodiment.

[0072] Referring to FIG. 4, an electronic device (100) supporting code testing according to an embodiment may check a pull request for target code to be subjected to a code test in step S430. The step of checking a pull request for target code to be subjected to a code test may include a step of receiving changes to a code repository through a pull request for the code being tested in the worker terminal (120) described above. This step may occur in a collaborative software development environment in which a developer provides code to a project through the worker terminal (120), and the step of checking a pull request for the target code may include a step of receiving a pull request generated when a developer changes a code base, reviews the changes, and wants to integrate the changes into a basic code repository through the worker terminal (120). The pull request may include a branch with modified code, a description of the code changes, and additional related information.

[0073] An electronic device (100) supporting code testing according to an embodiment may check test case information for a code test in step S420. The step of checking the test case information may include a step of defining a specific scenario or condition for evaluating a code segment or a step or function of a system before checking the test case information. This may include a step of defining an input of the test case, an expected output of the test case, and a precondition or postcondition. The step of checking the test case information may include a mechanism for storing and configuring the test case through a test case repository, a test suite, or a format of a file containing test case information.

[0074] An electronic device (100) supporting code testing according to an embodiment may identify a reference image corresponding to test case information in step S430. The step of identifying the reference image may include, for example, a step of defining a test including specific steps or operations to be performed to create a snapshot image, and then, for example, a step of creating a visual output for an expected item. The step of identifying the reference image may include, for example, a step of identifying a reference image related to an actual visual output created according to the test case information described above.

[0075] An electronic device (100) supporting code testing according to an embodiment may, in step S440, verify a test image generated based on a target code according to test case information in response to a pull request. The step of verifying the test image may include a step of generating a test image based on a reference code that merges the target code into the reference code through a test server, and verifying the test image. The step of verifying the test image may include, for example, a step of executing the target code, including modifications introduced in the pull request, to generate a test image representing a visual output generated by a code change under a specified test case condition, and verifying the same. In this step, the electronic device (100) may obtain test case information including an expected visual output or step as reference material for comparing the generated test image.

[0076] An electronic device (100) supporting code testing according to an embodiment may check the comparison result between a reference image and a test image in step (S450). The step of checking the comparison result may include, for example, a step of comparing the reference image checked in step (S420) with the test image checked in step (S440). The reference image may include, for example, a basic reference image generated based on a target code according to test case information and a temporary reference image generated based on a temporary code according to test case information. In one embodiment, the electronic device (100) may check the comparison result between a basic reference image generated based on a target code and a test image generated based on the target code when the temporary reference image is not included in the reference image. The step of checking the comparison result may include, for example, a step of checking the comparison result between the reference image and the test image through a feature-based analysis using a pixel-based comparison, a histogram comparison, a structural similarity index (SSIM), a mean square error (MSE), or a computer vision algorithm. The step of verifying the comparison results may include applying a comparison technique to quantitatively or qualitatively assess the similarities or differences between the reference image and the test image. This step may also include generating a request signal for a review process to request that other team members, such as a senior developer or project leader involved in the test, review the changes, and receiving a response to ensure code quality, compliance with coding standards, and compatibility with project goals.

[0077] An electronic device (100) supporting code testing according to an embodiment may generate control information on whether to merge the target code into the reference code based on the comparison result in step (S460). The step of generating the control information on whether to merge the target code into the reference code may include a step of generating control information for passing the pull request and merging the target code into the reference code if the comparison result between the reference image and the test image mentioned above is the same. The step of generating the control information on whether to merge the target code into the reference code may include a step of generating a control signal for requesting confirmation of the target code from the worker terminal (120) if the comparison result is not the same, receiving a response regarding the request from the worker terminal (120), and generating control information for passing the pull request and merging the target code into the reference code if the difference between the reference image and the test image is less than a threshold value. The step of generating control information on whether to merge the target code into the reference code may include the steps of generating a control signal requesting confirmation of the target code from the worker terminal (120) if the comparison results are not the same, receiving a response to the request from the worker terminal (120), transmitting a control signal requesting modification of the test code to the worker terminal (120) if the difference between the reference image and the test image is greater than or equal to a threshold value, and generating control information for passing a pull request for the modified code and merging the target code into the reference code based on the response to the modification request if the difference between the reference image and the modified test image is less than the threshold value.

[0078]

[0079] FIG. 5a and FIG. 5b are flowcharts specifically describing a system that supports code testing according to one embodiment.

[0080] Referring to FIGS. 5A and 5B , a system supporting code testing according to various embodiments may be implemented using various types of devices. For example, the system supporting code testing may include an electronic device (100), a worker terminal (120), and a database (140). The database (140) may be storage within the electronic device (100) or storage external to the electronic device (100), but is not limited thereto. In addition, the data storage may be an open source-based, non-relational database management system such as Redis (Remote Dictionary Server).

[0081] Referring to FIG. 5a, in step S510, the worker terminal (120) can transmit a pull request for the target code to the electronic device (100), and accordingly, the electronic device (100) can receive the pull request for the target code from the worker terminal (120).

[0082] In step S520, the database (140) can transmit test case information to the electronic device (100), and the electronic device (100) can receive the same from the database (140). Upon receiving the test case information, the electronic device (100) can verify information necessary for performing code testing. For example, the database (140) can include a repository based on git-hub and can perform a step of transmitting the test case information.

[0083] In step S530, the electronic device (100) can check the test image generated based on the target code according to the test case information in response to the pull request.

[0084] In step S540, the electronic device (100) can check the comparison results between the reference image and the test image. The step of checking the comparison results between the reference image and the test image can be performed using various analysis techniques, such as pixel-based comparison, histogram comparison, SSIM (structural similarity index), MSE (mean square error), or feature-based analysis using a computer vision algorithm, as previously discussed.

[0085] In step S545, the electronic device (100) can determine whether the comparison results of the reference image and the test image are the same, and if the comparison results of the reference image and the test image are the same, the electronic device (100) can pass the pull request for the target code in step S560. If the comparison results of the reference image and the test image are not the same, the electronic device (100) can generate a control signal requesting confirmation of the target code in step S550 and transmit the control signal to the worker terminal (120). In step S555, the worker terminal (120) can transmit a response to the confirmation request, and thereafter, the electronic device (100) can pass the pull request for the target code in step S560. The process of making the confirmation request and the response thereto will be described in detail below with reference to FIG. 5b.

[0086] In step S570, the electronic device (100) may merge the target code with the reference code. After merging the target code with the reference code, the electronic device (100) may perform additional code testing based on the new reference code. For example, a test reviewer may review, improve, and test changes to the pull-requested target code. If the target code meets the overall project's quality standards and aligns with the development goals, the electronic device (100) may decide to merge the target code into the existing code repository. The electronic device (100) may then perform this merging.

[0087] In step S580, the electronic device (100) may transmit a target code merging notification to the worker terminal (120). For example, the worker terminal (120) may receive the target code merging notification from the electronic device (100) and, when performing additional code testing thereafter, may perform additional code testing based on the previously merged target code.

[0088] In step S590, the electronic device (100) may transmit a request to discard a temporary reference image. The electronic device (100) may reduce the weight of the entire system by discarding a temporary reference image already used after merging.

[0089] Referring to FIG. 5B, in step S545, the electronic device (100) can determine whether the comparison results of the reference image and the test image are the same, and if the comparison results of the reference image and the test image are the same, the electronic device (100) can pass the pull request for the target code in step S560. If the comparison results of the reference image and the test image are not the same, the electronic device (100) can generate a control signal requesting confirmation of the target code in step S550 and transmit the control signal to the worker terminal (120), and based on a response from the worker terminal (120), determine whether the target code has passed the manual review in step S511. If the target code has passed the manual review, the electronic device can pass the pull request for the target code in step S560.

[0090] If the target code does not pass the manual review, the electronic device may block the pull request in step S522 and transmit a control signal regarding a request for modification of the test code to the worker terminal (120), and repeat the above steps until the modified code passes the manual review. For example, in the above step, the reviewer of the target code may provide feedback and comments on the pull request to the worker terminal (120). The reviewer performing the manual review may suggest improvements to the target code to the worker of the target code, highlight potential problems with the target code, or request an explanation of the target code, thereby guiding the worker of the target code to improve the target code so that the target code can generate a suitable test image. Based on the response to the modification request, if the difference between the reference image and the modified test image is less than a threshold value, the electronic device (100) may pass the pull request in step S560 and perform merging as discussed above.

[0091]

[0092]

[0093] *Figure 6 is a block diagram schematically illustrating an electronic device supporting code testing according to one embodiment.

[0094] Referring to FIG. 6, the electronic device (600) of FIG. 6 may correspond to the electronic device (100) of the present specification. The electronic device (600) of the present disclosure may include a transceiver (610), a storage (620), and a processor (630), according to one embodiment. The components illustrated in FIG. 6 are not essential for implementing the electronic device, and thus, it will be understood by those skilled in the art related to the present embodiment that the electronic device (600) described in the present specification may have more or fewer components than the components listed above. Meanwhile, in the embodiment, the processor (630) may include at least one processor. In addition, the electronic device (600) may also operate as a server or a proxy server.

[0095] The transceiver (610) can communicate with an external device using wired or wireless communication technology and can include the transceiver (610). The external device can be a terminal or server including a terminal of a developer or a quality assurance team. In addition, the communication technology used by the transceiver (610) can include, but is not limited to, GSM (Global System for Mobile communication), CDMA (Code Division Multi Access), LTE (Long Term Evolution), 5G, WLAN (Wireless LAN), Wi-Fi (Wireless-Fidelity), Bluetooth, RFID (Radio Frequency Identification), Infrared Data Association (IrDA), ZigBee, NFC (Near Field Communication), etc.

[0096] According to one embodiment, the transceiver (610) can communicate with the worker terminal (120) and the database (140) via the network (160) to exchange information. More specifically, the transceiver (610) can receive test case information from the database (140) and can receive a pull request for the target code from the worker terminal (120).

[0097] Storage (620) can store information for performing at least one of the methods described above through FIGS. 1 to 5b. Storage (620) can be referred to as memory and can be volatile memory or non-volatile memory.

[0098] The processor (630) can control the overall operation of the electronic device (600) and process data and signals. The processor (630) can perform one of the methods described above with reference to FIGS. 1 to 5B. The processor (630) can control embodiments performed by the electronic device (600) through interaction with the transceiver (610) and the storage (620), and further components that the electronic device (600) may include. According to one embodiment, the processor (630) can check a pull request for a target code to be subjected to a code test, check test case information for the code test, check a reference image corresponding to the test case information, check a test image generated based on the target code according to the test case information in response to the pull request, check a comparison result of the reference image and the test image, and generate control information on whether to merge the target code into the reference code based on the comparison result.

[0099]

[0100] Meanwhile, the present specification and drawings disclose preferred embodiments of the present invention. Although specific terms have been used, they are used in a general sense only to easily explain the technical contents of the present invention and to assist in understanding the invention, and are not intended to limit the scope of the present invention. It will be apparent to those skilled in the art that other modified examples based on the technical concept of the present invention are possible in addition to the embodiments disclosed herein.

[0101] The electronic device or terminal according to the above-described embodiments may include a processor, a memory for storing and executing program data, permanent storage such as a disk drive, a communication port for communicating with an external device, a user interface device such as a touch panel, a key, an icon, etc. The methods implemented as software modules or algorithms may be stored on a computer-readable recording medium as computer-readable codes or program commands executable on the processor. Here, the computer-readable recording medium includes a magnetic storage medium (e.g., read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and an optical reading medium (e.g., CD-ROM, DVD: Digital Versatile Disc)). The computer-readable recording medium may be distributed to computer systems connected to a network, so that the computer-readable code may be stored and executed in a distributed manner. The medium may be readable by a computer, stored in a memory, and executed by a processor.

[0102] The present embodiment may be represented by functional block configurations and various processing steps. These functional blocks may be implemented by various hardware and / or software configurations that perform specific functions. For example, the embodiment may employ direct circuit configurations such as memory, processing, logic, look-up tables, etc., which may perform various functions under the control of one or more microprocessors or other control devices. Similarly, the present embodiment may be implemented in a programming or scripting language such as C, C++, Java, assembler, Python, etc., including various algorithms implemented as a combination of data structures, processes, routines, or other programming configurations. Functional aspects may be implemented as algorithms that execute on one or more processors. Furthermore, the present embodiment may employ conventional techniques for electronic configuration, signal processing, and / or data processing. Terms like "mechanism," "element," "means," and "composition" can be used broadly and are not limited to mechanical or physical components. These terms can also encompass a series of software routines, such as those associated with a processor.

[0103] The above-described embodiments are merely examples, and other embodiments may be implemented within the scope of the claims set forth below.

Claims

1. In a method for supporting code testing in an electronic device, A step of checking a pull request for the target code that is the subject of the above code test; A step of checking test case information for the above code test; A step of checking a reference image corresponding to the above test case information; A step of verifying a test image generated based on the target code according to the test case information in response to the pull request; A step of checking the comparison results of the above reference image and the above test image; and A step of generating control information on whether to merge the target code into the reference code based on the comparison result, How to support code testing.

2. In paragraph 1, The above reference image is, Including a basic reference image generated based on the target code according to the test case information and a temporary reference image generated based on the temporary code according to the test case information, How to support code testing.

3. In paragraph 1, Further comprising the step of generating a basic reference image generated based on a new reference code into which the above target code is merged. How to support code testing.

4. In paragraph 1, The steps to check the above test image are: A step of generating the test image based on the reference code that merges the target code into the reference code through a test server, and verifying the test image, How to support code testing.

5. In paragraph 1, The step of generating control information on whether to merge the above target code into the reference code is as follows: If the above comparison results are the same, Steps to pass the above pull request and comprising a step of generating control information on whether to merge the target code into the reference code; How to support code testing.

6. In paragraph 1, The step of generating control information on whether to merge the above target code into the reference code is as follows: If the above comparison results are not identical, A step of generating a control signal requesting confirmation of the target code from the worker terminal, and a step of generating control information on whether to merge the target code into the reference code based on the request, How to support code testing.

7. In paragraph 6, The step of generating control information on whether to merge the target code into the reference code based on the above request is: A step of receiving a response to the above request; If the difference between the reference image and the test image is less than a threshold value, a step of passing the pull request; and comprising a step of generating control information on whether to merge the target code into the reference code; How to manage test images.

8. In paragraph 6, The step of generating control information on whether to merge the target code into the reference code based on the above request is: A step of receiving a response to the above request; A step of blocking the pull request when the difference between the reference image and the generated test image is greater than a threshold value; A step of transmitting a control signal regarding a request for modification of a test code to a worker terminal; Based on the response to the above modification request, a step of passing the modified pull request if the difference between the reference image and the modified test image is less than a threshold value; and comprising a step of generating control information on whether to merge the target code into the reference code; How to support code testing.

9. In paragraph 1, A step of merging the target code based on the above control information, and If the reference image includes a temporary reference image, further comprising a step of dropping the temporary reference image included in the reference image. How to support code testing.

10. In paragraph 1, The steps to check the above comparison results are: If the above reference image does not include a temporary reference image, A step of checking the comparison result between a basic reference image generated based on the target code and a test image generated based on the target code, How to manage test images.

11. In electronic devices supporting code testing, transceiver; Storage for storing one or more commands; and Check the pull request for the target code that is the subject of the above code test, Check the test case information for the above code test, Check the reference image corresponding to the above test case information, In response to the above pull request, check the test image generated based on the above target code according to the above test case information, Check the comparison results of the above reference image and the above test image, Generating control information on whether to merge the target code into the reference code based on the above comparison results, An electronic device containing a processor.

12. A non-temporary computer-readable recording medium having recorded thereon a program for executing the method of paragraph 1 on a computer.

Citation Information

Patent Citations

  • System for automatically testing software

    JP2001273168A

  • Method for correcting violation of source code and computer readable recording medium having program the same

    KR101850303B1

  • Application Graphic User Interface Test Automation System and Method Thereof

    KR1020120121950A

  • A method for providing an application developing environment and recording media for that

    KR1020150099175A

  • Appratus of estimating program coded by using block coding, method and system thereof and computer program stored in recoring medium

    KR102156931B1