Method, apparatus, and recording medium for providing test code information

TWI941990BActive Publication Date: 2026-10-11COUPANG CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
TW113131047
Authority / Receiving Office
TW · TW
Patent Type
Patents
Current Assignee / Owner
Priority Date
2024-05-30
Filing Date
2024-08-19
Publication Date
2026-10-11
Estimated Expiration
2044-08-18

AI Technical Summary

Technical Problem

Existing unit testing methods face challenges in efficiently generating test code due to the current state of the service differing from the ideal scenario, leading to instability, and require skilled developers to write complex static code, which is time-consuming and difficult for non-developers to participate in.

Method used

An electronic device generates first and second code information using an artificial intelligence model to assist in writing test code, providing necessary structures and specifications, even for users unfamiliar with coding, by analyzing target code and user inputs.

Benefits of technology

Facilitates easier and faster test code generation, improving construction and runtime, enabling even non-developers to participate in unit testing with integrated management of test code information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure TWG2TB001915165_001
    Figure TWG2TB001915165_001
  • Figure TWG2TB001915165_002
    Figure TWG2TB001915165_002
  • Figure TWG2TB001915165_003
    Figure TWG2TB001915165_003
Patent Text Reader

Abstract

This invention relates to a method, apparatus, and recording medium implemented in an electronic device. One embodiment of the method may include the following steps: identifying target code information that is the target of a unit test; generating first code information, the first code information including test function information corresponding to the identified target code information; identifying specification information corresponding to the target code, the specification information including information related to the test type; and based on the specification information, generating second code information including one or more code pieces of information corresponding to the specification information.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to a technique for providing test code information. More specifically, it relates to a technique for providing code information for unit testing. [Previous Technology]

[0002] With the development of electronic technology, consumers of e-commerce services can use applications installed on their own terminals to search for and purchase items. Therefore, each service provider manages its own applications. Consumers can use the applications provided by various service providers to purchase items online, and the online purchase rate using these applications is gradually increasing. During the process of updating existing functions of such applications or developing new functions, various data used in the actual service can be used to test whether the updated or added functions are appropriately driven. However, when using data based on the actual service, the current state of the service may differ from the ideal situation to be tested. Furthermore, during the testing process, the data used in the actual service provision may change or affect the traffic of the actual service, leading to instability in service provision. However, when data is intentionally generated, data suitable for various test situations will be generated one by one, resulting in very low testing efficiency.

[0003] On the other hand, when writing materials suitable for the aforementioned testing scenarios, such as test code, even skilled developers may overlook necessary structures and specifications, or find it difficult to write them after searching for them. Furthermore, writing time also increases when directly inputting static code. Additionally, users conducting tests may include administrators, reviewers, and other users other than developers. Their experience or proficiency in coding may be lower, making it difficult for them to participate in the testing process for these reasons. [Summary of the Invention]

[0004] [Problem to be Solved by the Invention] The technical problem to be solved by one embodiment of the present invention is related to a technology that provides code information to make it easier for users to write test code in accordance with target code information when performing unit testing.

[0005] Another technical problem that an embodiment of the present invention aims to solve is a technique for providing information related to test code, thereby reducing the time required to write test code.

[0006] Another technical problem that an embodiment of the present invention aims to solve is a technique for providing information related to the test object, thereby improving the construction and runtime of test code.

[0007] Another technical problem that this invention aims to solve is a technique that enables even users unfamiliar with writing test code to easily write test code.

[0008] Another technical problem that an embodiment of the present invention aims to solve is a technology that manages various information related to integrated management and testing code, taking into account the convenience of each user.

[0009] The technical subject matter of this invention is not limited to the technical subject matter mentioned above. Those skilled in the art will readily understand other technical subject matter not mentioned below based on the description below. [Technical Means for Solving the Problem]

[0010] A method implemented in an electronic device according to one embodiment of the present invention may include the following steps: identifying target code information that is the target of unit testing; generating first code information, the first code information including test function information corresponding to the identified target code information; identifying specification information corresponding to the target code, the specification information including information related to the test type; and generating second code information based on the specification information, including one or more code information corresponding to the specification information.

[0011] In an embodiment, the step of generating the first code information may include the following steps: analyzing the target code and confirming analysis information related to the target code; and generating the first code based on the analysis information.

[0012] In an embodiment, the first code may include one or more code information for initializing the input parameters included in the target code.

[0013] In the embodiment, the step of generating the first code information is as follows: the first code information is generated based on at least a portion of the category, interface, package and test directory information corresponding to the target code.

[0014] In an embodiment, the step of confirming the above-mentioned specified information may include the following steps: confirming information related to the user requesting the above-mentioned unit test; providing a directory related to one or more test types based on the information related to the above-mentioned user; and confirming specified information corresponding to the selected test type based on the selection input of the above-mentioned user corresponding to the above-mentioned directory.

[0015] In an embodiment, the step of confirming the above-mentioned specified information may include the following steps: analyzing the above-mentioned target code and confirming the analysis information related to the above-mentioned target code; and based on the above-mentioned analysis information, providing a directory related to one or more test types to the user terminal; and in response to receiving a selection input corresponding to the above-mentioned directory from the above-mentioned user terminal, confirming the above-mentioned specified information.

[0016] In the embodiments, the above-mentioned specified information may include at least a portion of the information of functions and variables corresponding to the above-mentioned test type.

[0017] In the embodiments, the above-mentioned specified information may include at least a portion of the explanatory information of the purpose and implementation method corresponding to the above-mentioned test type.

[0018] In the embodiments, the above test types may include at least one of A / B testing, feature flag, feature control and test logger.

[0019] In the embodiments, the step of generating the second code may include the following steps: generating the second code based on the output value of the artificial intelligence model with the above-specified information as input.

[0020] In the embodiments, the above-mentioned artificial intelligence model may include a related model constructed in the following manner: using machine learning algorithms to model the relationship between the input data set and the output data set, wherein the input data set includes one or more preceding code information, and the output data set includes an input pattern of subsequent code information corresponding to the preceding code information.

[0021] In the embodiments, the above-mentioned artificial intelligence model may include a generative artificial intelligence model.

[0022] In an embodiment, the above method may further include the following steps: providing example code information corresponding to the above-specified information.

[0023] In an embodiment, the step of providing the above-mentioned example code may include the following steps: providing the above-mentioned example code information in response to user input corresponding to the above-mentioned specified information.

[0024] In an embodiment, the above method may further include the following steps: providing guidance information in response to a request to provide guidance outlines.

[0025] In an embodiment, the step of providing the above-mentioned guidance outline information may include the following steps: confirming information related to the user requesting the above-mentioned unit test; and providing the above-mentioned guidance outline information based on the information related to the above-mentioned user.

[0026] In an embodiment, the above method may further include the following steps: performing a test corresponding to the target code information based on the first code and the second code; generating a test instance corresponding to the test; and mapping and storing the test instance corresponding to the test and information related to the user requesting the unit test.

[0027] In an embodiment, the above method may include the following steps: receiving the added input information of the second code information; and correcting the second code information based on the added input information.

[0028] An electronic device according to one embodiment of the present invention may include: one or more processors; one or more memory, which store commands to be executed by the one or more processors; the electronic device is configured such that when the commands are executed by the one or more processors, the one or more processors execute the method of the present invention.

[0029] One embodiment of the present invention is a non-transitory computer-readable recording medium that records commands, when executed by one or more processors, to cause the one or more processors to perform actions, wherein the commands are configured to cause the one or more processors to execute the method of the present invention. [Effects of the Invention]

[0030] According to the present invention, code information related to test execution is generated corresponding to the target code, thereby enabling users to write test code more easily.

[0031] According to the present invention, information related to test code is provided, thereby reducing the time required to write test code.

[0032] According to the present invention, information related to the test object is provided, thereby improving the construction and running time of test code.

[0033] According to the present invention, various information related to test implementation is provided, thereby enabling even users unfamiliar with test code writing to easily write test code.

[0034] According to the present invention, various information related to the integrated management and testing code can be managed with the convenience of each user in mind.

[0035] The effects of the technical concept of the present invention are not limited to the effects mentioned above. Those skilled in the art can clearly understand other effects not mentioned based on the description in the specification.

Implementation Method

[0037] The various embodiments described in this invention are illustrated for the purpose of clearly explaining the technical concept of the invention and are not intended to limit them to specific implementation methods. The technical concept of the invention includes various modifications, equivalents, alternatives, and embodiments obtained by selectively combining all or part of the embodiments described in this invention. Furthermore, the scope of the technical concept of the invention is not limited to the various embodiments presented below or their specific descriptions.

[0038] The terms used in this invention, including technical or scientific terms, shall have the meanings commonly understood by those with common knowledge in the technical field to which this invention pertains, unless otherwise defined.

[0039] The expressions such as "comprising," "may include," "possibly possess," "may possess," "have," and "may have" used in this invention mean that there are object features (e.g., functions, actions, or constituent elements), and do not exclude the existence of other additional features. That is, the expressions described above should be understood as open-ended terms that have the possibility of including other embodiments.

[0040] The singular expressions used in this invention may include the meaning of plural forms unless otherwise stated in the context, and this also applies to the singular expressions described in the claims of this invention.

[0041] The terms “first,” “second,” “first,” “second,” etc., used in this document are used to distinguish one object from another when referring to multiple objects of the same kind, unless the context otherwise indicates, and are not used to limit the order or importance of such objects.

[0042] As used herein, “A, B and C”, “A, B or C”, “A, B and / or C” or “at least one of A, B and C”, “at least one of A, B or C”, “at least one of A, B and / or C”, etc., may refer to each of the listed items or all possible combinations of the listed items. For example, “at least one of A or B” may refer to (1) at least one A, (2) at least one B, (3) at least one A and at least one B.

[0043] The term “based on” used in this invention is used to describe one or more factors that affect the determination or judgment of an action or behavior described in a statement or article including the term. The term does not exclude other factors that affect the determination or judgment of an action or behavior.

[0044] The statement that a certain constituent element (e.g., the first constituent element) is "connected" or "linked" to another constituent element (e.g., the second constituent element) in the present invention can refer not only to the fact that the aforementioned constituent element is directly connected or linked to the aforementioned other constituent element, but also to the fact that it is connected or linked to the aforementioned other constituent element through a new other constituent element (e.g., the third constituent element).

[0045] Depending on the context, the expression "configured to" used in this invention may mean "configured in a specific manner," "possessing the capability to perform specific actions," "modified in a specific manner," "manufactured in a specific manner," or "capable of performing specific actions." This expression is not limited to the meaning of "specially designed in hardware." For example, a processor configured to perform a specific action may refer to a general-purpose processor that can perform that specific action by executing software, or a special-purpose computer that is programmed to perform that specific action.

[0046] The term "user interface" used in this invention can refer to a physical or virtual medium that enables communication between a user and things, systems, machines, or computer programs. Users can utilize e-commerce services through a user interface. For example, a user interface may include basic elements for displaying specific information such as images or text, and elements for receiving user input, such as icons and buttons that can be constructed using these basic elements. For example, a user interface selected (clicked) by a user can be described as receiving user input corresponding to the user interface. Furthermore, as a combination of basic elements such as images and text, and elements for receiving user input, elements that can display specific information to the user and perform all functions of receiving user input can, for example, provide a user interface in the form of an interface widget.

[0047] Hereinafter, various embodiments of the present invention will be described with reference to the accompanying drawings. In the drawings and descriptions thereof, the same or substantially equivalent constituent elements are given the same reference numerals. Furthermore, in the following descriptions of various embodiments, repeated descriptions of the same or corresponding constituent elements may be omitted, but this does not mean that the constituent element is not included in the embodiment.

[0048] Figure 1 illustrates an environment in which an electronic device of one embodiment of the present invention can be applied. The electronic device 101 and the user terminal 102 can communicate with each other via a network connection.

[0049] Electronic device 101 may be a server device providing an integrated development environment (IDE) according to one embodiment of the present invention. That is, electronic device 101 may be a device that provides an environment for integrated processing of various operations related to program development, such as coding, debugging, compiling, and publishing. In one embodiment, electronic device 101 may be a server device running under the management of a management entity (e.g., an e-commerce service provider), which manages object code information that is the target of unit testing, test code information written for testing the object code, and information related to testing.

[0050] The target code information managed by the electronic device 101 may be information received from the user terminal 102. The target code information may be stored in correspondence with the target code's name, identification information, and author information. The target code information may include category information, interface information, package information, test directory information, function information, parameter information, etc., of the target code. In one embodiment, the function information may include the function's name information and information related to the function's corresponding parameters, such as parameter name, number of parameters, parameter type, parameter declaration location information, and location information defined for the function.

[0051] The test code information managed by the electronic device 101 may include one or more code information written for performing unit tests. The test code information may include information related to the target code. For example, the test code information may include at least a portion of the target code's name, identification information, and author information. In one embodiment, the test code information may include code information used to perform unit tests. The test code information may include category information, interface information, package information, test directory information, function information, parameter information, etc., corresponding to the test. In one embodiment, the test code information may include information related to the test object. For example, the test object may correspond to the device being tested. Information related to the test object may include device identification information, device type information, user information corresponding to the device, etc. The test code information may be generated by the electronic device 101 based on input received from the user terminal 102, or it may be received by the electronic device 101 from the user terminal 102.

[0052] The test-related information managed by the electronic device 101 may include various information required for generating or writing test code. Test-related information may include information related to test regulations, information related to guidelines, sample code information, and catalog information related to test types.

[0053] Thus, in e-commerce services, various information used to perform testing of target code can be managed by electronic device 101. The management of information by electronic device 101 can refer to the general term for all actions of having control over and processing the information. For example, information management may include: obtaining, storing, updating or modifying the information.

[0054] The electronic device 101 described above may be implemented by one or more computing devices. For example, all functions of the electronic device 101 may be implemented in a single computing device. As another example, a first function of the electronic device 101 may be implemented in a first computing device, and a second function may be implemented in a second computing device. As yet another example, a plurality of computing devices may be used to implement all or specific functions of the electronic device 101. The aforementioned computing device may be a desktop computer, a laptop computer, an application server, a proxy server, or a cloud server, but is not limited thereto; any type of device with computing capabilities may be a computing device.

[0055] User terminal 102 may be a device used by a user to receive various information related to testing from electronic device 101 and to generate test code. The user is either writing target code information or writing test code to test the target code. User terminal 102 can be implemented as a terminal that can send and receive various information with electronic device 101 via a network. For example, user terminal 102 may be one of a computer, laptop, portable communication terminal (smartphone, etc.), portable multimedia device, wearable device, or HMD. However, the type of user terminal 102 is not limited to these. User terminal 102 may be any device that includes an input / output interface capable of receiving input information from or outputting information to the user, and capable of communicating with electronic device 101 or other devices via a network.

[0056] User terminal 102 can provide information received from electronic device 101 to the user, and receive input from the user and transmit it to electronic device 101. Specifically, user terminal 102 can obtain input from the user indicating calls to various pages, and generate commands indicating calls to various pages in response to the obtained input. User terminal 102 can transmit commands indicating calls to various pages to electronic device 101. Input obtained from the user may include various forms of input such as mouse clicking, touch control using a touch panel or touch screen, text input using voice recognition or keyboard, and other electronic input. User terminal 102 can receive and output various pages from electronic device 101.

[0057] In one embodiment, the user terminal 102 may be implemented as a terminal capable of sending and receiving various information with the electronic device 101 via a network. For example, the user terminal 102 may be one of a computer, a laptop, a portable communication terminal (such as a smartphone), a portable multimedia device, a wearable device, or an HMD. However, the type of user terminal 102 is not limited to this. The user terminal 102 may be any device including an input / output interface capable of receiving input information from the user or outputting information to the user, and capable of communicating with the electronic device 101 or other devices via a network.

[0058] The network can serve to connect electronic device 101, user terminal 102, or other external devices. For example, the network can provide a connection path to enable user terminal 102 to connect to electronic device 101 and send and receive packet data with electronic device 101. The network can be implemented as any type of wired or wireless network, such as a Local Area Network (LAN), a Wide Area Network (WAN), a Mobile Radio Communication Network, or Wibro (Wireless Broadband Internet).

[0059] In one embodiment, the electronic device 101 and the user terminal 102 can operate as a single device. The user terminal 102 can be included in the electronic device 101 as all or part of its constituent elements. In this case, for example, the various information exchanged between the electronic device 101 and the user terminal 102 via a network can be various information exchanged between the constituent elements within a single device.

[0060] Figure 2 is a block diagram of an electronic device according to one embodiment of the present invention. The electronic device 200 can process information related to e-commerce services and information related to events. In one embodiment, the electronic device 200 may include one or more processors 210, one or more memory units 220, and a communication interface 230 as constituent elements. In one embodiment, at least one of the constituent elements of the electronic device 200 may be omitted, or other constituent elements may be added to the electronic device 200. In one embodiment, some constituent elements may be additionally or alternatively integrated to achieve, or implemented as a single or multiple entities. In this invention, one or more processors 210 may be referred to as processor 210. Unless explicitly stated otherwise in the context, the term processor 210 may refer to a collection of one or more processors. In this invention, one or more memory units 220 may be referred to as memory units 220. Unless explicitly stated otherwise in the context, the term "memory 220" may refer to a collection of one or more memories. In one embodiment, at least some of the internal / external components of the electronic device 200 are interconnected via buses, GPIO (General Purpose Input / Output), SPI (Serial Peripheral Interface), or MIPI (Mobile Industry Processor Interface), thereby enabling the transmission and reception of information (data, signals, etc.).

[0061] The processor 210 can drive software (e.g., commands, programs, etc.) to control at least one component of the electronic device 200 connected to the processor 210. Furthermore, the processor 210 can perform various operations related to the present invention, such as calculations, processing, data generation, and manipulation. Also, the processor 210 can load data from or store such data in the memory 220. In one embodiment, the processor 210 can control the communication interface 230 to request various information from the user terminal 102 and receive various information from the user terminal 102.

[0062] Memory 220 can store various information (data). The information stored in memory 220, as information obtained, processed, or used by at least one component of electronic device 200, may include software (e.g., commands, programs, etc.). Memory 220 may include volatile and / or non-volatile memory. In this invention, commands or programs, as software stored in memory 220, may include an operating system, application programs, and / or middleware for controlling the resources of electronic device 200, which provides various functions to the application program to enable the application program to utilize the resources of electronic device 200. In one embodiment, memory 220 may store commands that, when executed by processor 210, cause processor 210 to perform operations. Memory 220 may store at least a portion of information received from a database and / or information sent to a database via communication interface 230. Specifically, memory 220 can store information related to e-commerce services and commands executed by processor 210.

[0063] The communication interface 230 enables wireless or wired communication between the electronic device 200 and a database or other external electronic devices. For example, the communication interface 230 can implement wireless communication in the following ways: eMBB (enhanced Mobile Broadband), URLLC (Ultra Reliable Low-Latency Communications), MMTC (Massive Machine Type Communications), LTE (Long-Term Evolution), LTE-A (LTE Advance), NR (New Radio), UMTS (Universal Mobile Telecommunications System), GSM (Global System for Mobile communications), CDMA (Code Division Multiple Access), WCDMA (Wideband CDMA), WiBro (Wireless Broadband), WiFi (Wireless Fidelity), Bluetooth, NFC (Near Field Communication), GPS (Global Positioning System), or GNSS (Global Navigation Satellite System), etc. For example, the communication interface 230 can implement wired communication in the following ways: USB (Universal Serial Bus), HDMI (High Definition Multimedia Interface), RS-232 (Recommended Standard-232), or POTS (Plain Old Telephone Service). In one embodiment, the electronic device 200 can also be integrated with other devices. In this case, the communication interface 230 can function as a connection circuit or interface for connecting the electronic device 200 to corresponding other devices.

[0064] Hereinafter, the actions described in Figures 3 and 7 as being performed by an electronic device can be understood as being performed by the processor 210 of the electronic device 200 described in Figure 2.

[0065] Figure 3 is a flowchart illustrating the operation of a method according to one embodiment of the present invention.

[0066] The method shown in Figure 3 can be understood as a series of actions related to the method of providing test code information.

[0067] Electronic device 101 can confirm target code information (S310).

[0068] In this embodiment, the electronic device 101 can confirm target code information. The electronic device 101 can receive target code information from the user terminal 102, or confirm the target code information corresponding to at least a portion of the target code information stored and managed by the electronic device 101. The electronic device 101 can confirm the target code information in response to input information related to the target code or selection information corresponding to the target code received from the user terminal 102. The electronic device 101 can confirm the target code information based on the name, identification information, author information, etc., of the target code. The target code may include code information that is the target of testing, and the target code may include code information including one or more commands for updating existing functions of an application or adding new functions.

[0069] Electronic device 101 can generate first code information (S320).

[0070] In an embodiment, the first code information may include one or more codes related to the test. In one embodiment, the first code information may include code that is related to the test and can be generally used. For example, the first code information may include code information related to a command that initializes input parameters included in the target code information.

[0071] In an embodiment, the first code information may include template code information. The template code may include code information that can be applied in the same way even in different target codes or different unit tests. For example, the template code information may include at least a portion of the code related to the initialization command of the input parameters and the code information declaring the test function.

[0072] In an embodiment, the first code information may be generated based on analysis information of the target code. The electronic device 101 may analyze the target code and confirm analysis information related to the target code. For example, the electronic device 101 may analyze the target code and confirm at least a portion of the category, interface, package, and test directory information corresponding to the target code. The electronic device 101 may declare test functions based on the analysis information related to the target code. In one embodiment, the electronic device 101 may confirm at least a portion of the properties, names, or types of the target code's categories based on the analysis information and declare test functions. Test functions may, for example, correspond to at least a portion of the functions included in the target code. That is, when there is one or more specific functions within the target code that are the targets of testing, they may be referred to as test functions. In one embodiment, the electronic device 101 may input information related to the target code or analysis information related to the target code into the artificial intelligence model and obtain the first code information as its output.

[0073] Electronic device 101 can confirm the specified information corresponding to the target code (S330).

[0074] The specified information may include information related to the type of unit test, which corresponds to the target code. Test type may refer to a classification of test types based on at least a portion of the test's purpose and the test's operation. For example, test types may include at least a portion of A / B testing, feature flags, feature control, and test loggers. A / B testing refers to a method of comparing different versions of target code when different versions exist, or a method of executing an application or comparing the results of unit tests based on information related to different test objects in different versions of target code. Feature flags may refer to a test type that indicates whether a specific function (e.g., a function) is activated in the target code via a flag. For example, when there is target code including more than one function, a specific function can be activated or deactivated, and the results of the test object executing the test code based on the target code can be compared. Feature control may refer to a test type that is similar to feature flags, utilizing adjustments to other parameters of functions related to a specific function, or test code including functions. Test logger may refer to a test type that, when testing is performed using test code, calculates and stores logs of the following data based on the execution of the test code corresponding to the target code: data sent and received between the test object and the target code's publishing server or electronic device 101 and other devices; data input or output based on the execution of the test code; and data calculated during the calculation process of the test code execution. In embodiments, the specified information may include the purpose of the test type or descriptive information related to the operation method of the corresponding type of test.

[0075] In this embodiment, the electronic device 101 may provide specified information corresponding to the target code to the user terminal 102. For example, the electronic device 101 may provide a directory related to one or more test types to the user terminal 102. The electronic device 101 may confirm the specified information corresponding to the selected test type based on the user's selection input corresponding to the directory.

[0076] In this embodiment, the electronic device 101 may, based on user information, confirm one or more corresponding test types and provide a directory including the confirmed one or more test types to the user terminal 102. For example, the electronic device 101 may confirm information related to the user corresponding to the user terminal 102, that is, the test instance corresponding to the user requesting unit testing. The electronic device 101 may confirm information related to one or more test types based on at least a portion of the following information: test information previously requested by the user requesting unit testing, test instance information generated accordingly, and result information corresponding to the test instance.

[0077] In this embodiment, the electronic device 101 can identify one or more test types based on the analysis information obtained from analyzing the target code information. The electronic device 101 can identify one or more test types based on at least a portion of the target code's corresponding category, interface, package, and test directory information obtained by analyzing the target code.

[0078] In this embodiment, the electronic device 101 may provide a catalog including one or more test types to the user terminal 102. The electronic device 101 may receive user selection input corresponding to the catalog. Based on the user's selection input, the electronic device 101 may confirm the specified information corresponding to the selected test type.

[0079] In an embodiment, the specified information pertains to a predefined mode of action and may include information related to one or more functions and variables. In one embodiment, the specified information may include annotation information, which includes the mode of action corresponding to the test type or explanatory information related to the purpose.

[0080] Electronic device 101 can generate second code information corresponding to specified information (S340).

[0081] The second code information may include code information generated based on the specified information. In an embodiment, the second code information may include one or more code information corresponding to the specified information. For example, the second code information may include code information declaring one or more functions and parameters corresponding to the specified information. In one embodiment, the second code information may include at least a portion of the code information declaring one or more functions and parameters corresponding to the specified information. In one embodiment, the electronic device 101 may generate the second code based on the specified information, analysis information related to the target code, and at least a portion of the first code information. For example, the electronic device 101 may generate the second code information based on the test function information declared, the variable information declared and initialized in the first code information, and the specified information. In one embodiment, the electronic device 101 may receive at least a portion of the code information corresponding to the specified information from the user terminal 102, and generate the second code information based on the received code information. For example, the electronic device 101 may provide at least a portion of the guideline information and example code information corresponding to the specified information to the user terminal 102. For example, referring to this, electronic device 101 can generate second code information based on at least a portion of the code information received from user terminal 102 by user input. Example code information and guidance information will be described below. In one embodiment, electronic device 101 can declare one or more functions corresponding to specified information to generate code information including commands declaring variables. Herein, input information such as instructions to modify the code generated from user terminal 102 or instructions to add a portion of the generated code can be received. In this case, electronic device 101 can generate second code information based on the input information. In one embodiment, electronic device 101 can generate second code based on an input data set with the second code generated by electronic device 101 as input and an output data set with information related to the modification or addition input received from the user as output, thereby generating the second code through the output of a learned artificial intelligence model. In this case, when learning is performed based on the modification or addition input, learning can be performed in association with the user information of the user performing the modification or addition input.

[0082] In one embodiment, the electronic device 101 can generate a second code based on the output value of an artificial intelligence model that takes at least a portion of target code information, first code information, and specified information as input. In one embodiment, when the specified information includes annotation information, the annotation information includes explanatory information related to the purpose corresponding to the test type or the operation method. The electronic device 101 can generate the second code information based on the output value of an artificial intelligence model learned by outputting corresponding codes with annotation information as input. In one embodiment, the artificial intelligence model may include a related model constructed by using machine learning algorithms to model the relationship between an input dataset and an output dataset, wherein the input dataset includes one or more preceding code information, and the output dataset includes an input pattern of subsequent code information corresponding to the preceding code information. The preceding code may refer to one or more code information that is pre-input, and the subsequent code may refer to code information that needs to be input after the preceding code. In one embodiment, this input data set may include description information, user information, object code information, statement information, structural information, etc., and not just antecedent code information. In another embodiment, the artificial intelligence model may include a generative artificial intelligence model.

[0083] The electronic device 101 can generate second code information and generate test code based on correction or addition input information received from the user terminal 102 in response to the second code information. The test code may include the first code information and the second code information. The test code may include code information that is corrected or added based on user addition or correction input corresponding to at least a portion of the first code information and the second code information.

[0084] In an embodiment, electronic device 101 may receive a request to provide guidance outline information. Electronic device 101 may receive a request to provide guidance outline information from user terminal 102. Electronic device 101 may provide guidance outline information to user terminal 102 in response to the request to provide guidance outline information. The guidance outline information may include guidance information related to the writing of test code. For example, it may include the following information: information related to common questions about writing test code and answers to them, explanatory information related to specification information, information on general rules related to test implementation, and guidance information related to test implementation for various development departments. In an embodiment, the request to provide guidance outline information may include a search request. The search request may include search term information. In an embodiment, electronic device 101 may provide guidance outline information confirmed based on the following information to user terminal 102: user information, test instance information, target code information, target code analysis information, specification information, information related to the selected test type, and at least a portion of the written code information.

[0085] In an embodiment, the electronic device 101 may provide sample code information corresponding to specified information. For example, when the electronic device 101 receives a selection related to a specific test type, it may provide the corresponding specified information. At this time, the electronic device 101 may provide sample code information corresponding to the specified information in response to user input corresponding to the specified information. The sample code information may include the following information: information on one or more functions corresponding to the specified information, parameter information and information related to the writing position between the function information and parameter information, structure information, statement information, etc. The sample code information may include example sentences of second code information generated corresponding to the specified information. The sample code information may be provided in the form of still images, video images or text. In one embodiment, the electronic device 101 may provide the specified information in response to a user request for sample code information. The user request may be implemented by input corresponding to the specified information. For example, the user request for sample code information may be implemented based on point input or mouse over input corresponding to the specified information. In one embodiment, the example code information may include code information output by an artificial intelligence model, taking specified information as input. Electronic device 101 may provide guidance outline information and / or example code information based on user information. For example, electronic device 101 may, in response to a user requesting testing, confirm test instance information and, based on test instance information related to previously performed tests, confirm at least a portion of one or more functions, one or more variables, and one or more specified information, and provide guidance outline information and / or example code information.

[0086] In one embodiment, the electronic device 101 may generate code information declaring a test object based on target code information. For example, when the analysis information based on the target code information includes information related to the device used to execute the target code in the target code, the electronic device 101 may generate code information declaring a test object corresponding to the device information.

[0087] Figure 4 is a diagram illustrating a method for providing test-related information by an electronic device according to one embodiment of the present invention.

[0088] Electronic device 101 can provide integrated development environments 400, 410, and 430. The integrated development environment may include other servers 400 implemented via electronic device 101 and plug-ins 410 implemented via user terminal 102. Server 400 can support operations such as encoding, debugging, compiling, and deploying target code. Through server 400, test code including first code information and second code information can be written and executed.

[0089] Server 400 may include test data 401 and artificial intelligence model 402. Test data 401 may include specification information and related text information. Electronic device 101 may provide sample code 442 information or generate specification information 432 included in test code based on the specification information included in test data 401. At this time, test data 401 can be managed by server 400, user terminal 102 can transmit update information of test data 401 to electronic device 101, and electronic device 101 can update test data 401 stored in server 400.

[0090] Plug-in 410 may refer to a local module installed in user terminal 102. Plug-in 410 may include an interface that enables user terminal 102 to support the actions of server 400, or enables user terminal 102 to instruct specific actions or functions on server 400. Plug-in 410 may include template information 411. Template information 411 may include template code information included in the first code. Template information 411 may include different information depending on the module, package, etc., including each object code, and may also include information managed individually by each user or managed independently by each user's department or development area. That is, test data 401, including specification information and related text information, is managed by server 400, and therefore can be generally generated, modified, and stored by the administrator. Template information 411 can be managed independently by each developer or test host, or managed by a smaller group of users compared to test data 401. Regarding template information 411, adaptive changes may be required based on the target code; therefore, it can be configured by including it in plugin 410.

[0091] Electronic device 101 can verify target code 420. Electronic device 101 can generate test code (430) including a first code and a second code based on target code 420. Electronic device 101 can verify template information 411 included in plug-in 410 based on the results of analyzing target code 420. Electronic device 101 can generate a first code 431 corresponding to target code 420 based on template information 411. Electronic device 101 can verify text data 401 based on user input, target code 420 and at least a portion of first code 431, and provide verified specified information 432. Electronic device 101 can generate a second code 433 based on specified information 432.

[0092] Electronic device 101 can verify test code (440) including first code 431 and second code 433. Electronic device 101 can provide guideline information 441 or sample code 442, thereby providing various information for users to verify test code. At this time, guideline information 441 or sample code 442 can also be provided during the generation of test code (430). Electronic device 101 can execute test code (443) and confirm whether test code is executed normally based on the execution result of test code (444). Electronic device 101 can receive corrections, changes, and additions to test code during the process of re-verifying test code (440) based on whether test code is normal.

[0093] Figure 5 is a diagram illustrating the process of generating code information using a learning model that learns in a manner that generates code information, according to one embodiment of the present invention.

[0094] In one embodiment, the learning model 500 may be the following model: learning is performed by using learning data 510 of other code information during the learning process to generate code information corresponding to the test code, and output data 930 is generated during the inference process. The output data is test code that needs to be added to the input data 520 of the written code that includes at least a part of the target code, the first code information and the specified information, or as part of the test code.

[0095] For example, electronic device 101 may input at least a portion of the function information and parameter information included in the target code information as input data to learning model 500, and may obtain at least a portion of the test code information for unit testing of the target code as output data 530. In one embodiment, electronic device 101 may input description information included in the specification information corresponding to the test type selected by the user as input data 520 to learning model 500, and obtain at least a portion of the test code information as output data 530. Electronic device 101 may input target code information and user information as input data 520 to learning model 500, and obtain at least a portion of the test code information as output data 530.

[0096] In one embodiment, the learning model 500 may be a model that learns by using one or more other codes and test codes corresponding to those other codes as learning data 510. Here, the one or more other codes may be code information that distinguishes it from the target code.

[0097] Figures 6a, 6b, 6c and 6d are used to illustrate an embodiment of the present invention, showing the target code information and the test-related information corresponding to the target code information.

[0098] Referring to Figures 6a and 6b, in order to begin generating test code corresponding to the information of target code 610, electronic device 101 may provide user interfaces 621 and 622 for receiving input from the user related to test generation to user terminal 102. Electronic device 101 may utilize a template to confirm template information corresponding to the target code in response to user input corresponding to the input interface 621 for generating test code. Electronic device 101 may generate a first code (630) based on the target code and template information. In one embodiment, without utilizing a template and in response to user input corresponding to the input interface 622 for generating test code, electronic device 101 may generate test code without referring to template information. In this case, electronic device 101 may also provide only the category declaration code corresponding to the test code.

[0099] Referring to Figures 6c and 6d, the electronic device 101 can provide example code information 650 and 652 corresponding to the specified information 651 and 653. At this time, the specified information 651 and 653 can also be declared as methods corresponding to the test type. The electronic device 101 can provide example code information 650 and 652 in response to input (e.g., clicking, mouse hovering, etc.) of the method declared corresponding to the test type.

[0100] Figure 7 is a flowchart illustrating the method of executing test code according to one embodiment of the present invention.

[0101] The method shown in Figure 7 may include a series of actions related to the method of performing tests by executing test code.

[0102] Electronic device 101 can generate test code (S710).

[0103] The test code may include the first code and the second code generated by the electronic device 101. When there are user corrections and additions to the inputs, at least some of the first code and the second code, the test code may include information on such corrections and additions.

[0104] Electronic device 101 can execute test code (S720).

[0105] The electronic device 101 can perform unit tests corresponding to one or more functions and variables included in the test code. In this case, the unit test is performed only by executing the test code corresponding to the object code, and can also be performed without executing the entire application. The electronic device 101 can process data according to one or more functions and commands composed of variables included in the test code, and output the related result data.

[0106] Electronic device 101 can generate test cases (S730).

[0107] Instance information may correspond to one or more tests implemented by test code generated by executing the target code. According to one embodiment, instance information may include at least a portion of target code information, test code information, user information requesting the test, and test result information related to each test. Each instance information may be assigned instance identification information. In an embodiment, instance information may include the execution of test code and input received from the test object. The test object may include user terminal 102. The test object may be an object corresponding to a device that inputs to the test code during test execution or is capable of receiving result data from the test code. Electronic device 101 may map and store test object information in instance information. Electronic device 101 may map test instances and user information (S740). Electronic device 101 executes test code, thereby mapping the user information requesting the test to the generated test instance. Electronic device 101 may input the test instance and the mapped user information as learning data into the learning model.

[0108] In the flowcharts of this invention, the steps of the method or algorithm are described sequentially. However, in addition to being performed sequentially, the steps can also be performed in any combination order by means of this invention. The descriptions related to the sequence diagrams or flowcharts of this invention do not preclude changes or modifications to the method or algorithm, and do not imply that any step is necessary or preferred. In one embodiment, at least some steps may be performed in parallel, repeatedly, or heuristically. In another embodiment, at least some steps may be omitted, or other steps may be added.

[0109] Various embodiments of the present invention can be implemented in the form of software in a machine-readable storage medium. The software can be software used to implement the various embodiments described in the present invention. Programmers in the art to which this invention pertains can deduce the software based on the various embodiments described in the present invention. For example, the software can be a program that includes machine-readable commands (e.g., instructions, program code, or code segments). The machine, as a device that performs actions according to commands called from the storage medium, can be, for example, a computer. In one embodiment, the machine can be a computing device of the various embodiments described in the present invention. In one embodiment, the processor of the machine executes the called command, thereby enabling the components of the machine to perform functions corresponding to the command. The storage medium can refer to all kinds of recording media capable of being read by a machine and storing data. Storage media can include, for example, ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. In one embodiment, the storage medium can also be implemented in the form of a computer system distributed across a network. In this case, the software can be distributed and stored in computer systems or similar locations for execution. In another embodiment, the storage medium can be a non-transitory storage medium. A non-transitory storage medium refers to a tangible medium that actually exists without regard to semi-permanent or temporary stored data, excluding transient signals.

[0110] The technical concept of the present invention has been described above based on various embodiments. However, the technical concept of the present invention includes various substitutions, variations, and modifications that can be implemented within the scope of common knowledge in the technical field to which the present invention pertains. Furthermore, it should be understood that such substitutions, variations, and modifications may be included within the scope of the appended patent applications. [Simplified Explanation of the Diagram]

[0036] Figure 1 shows an environment in which an electronic device according to an embodiment of the present invention can be applied. Figure 2 is a block diagram of an electronic device according to an embodiment of the present invention. Figure 3 is a flowchart illustrating the operation of a method according to an embodiment of the present invention. Figure 4 is a diagram illustrating a method for providing test-related information using an electronic device according to an embodiment of the present invention. Figure 5 is a diagram illustrating the process of generating code information using a learning model learned in a manner that generates code information according to an embodiment of the present invention. Figures 6a, 6b, 6c and 6d are diagrams illustrating test-related information corresponding to target code information and the target code information according to an embodiment of the present invention. Figure 7 is a flowchart illustrating the operation of a method for executing test code according to an embodiment of the present invention.

Claims

1. A method for providing test code information, implemented via an electronic device, comprising the steps of: identifying target code information that is the target of a unit test; generating first code information, the first code information including test function information corresponding to the identified target code information; identifying specification information corresponding to the target code, the specification information including information related to the test type; and generating second code information based on the specification information, including one or more code information corresponding to the specification information.

2. The method of request item 1, wherein the step of generating the first code information mentioned above includes the following steps: analyzing the target code, identifying analysis information related to the target code; and generating the first code mentioned above based on the analysis information.

3. The method of request item 1, wherein the first code above includes one or more code information for initializing the input parameters included in the target code above.

4. The method of request item 1, wherein the steps for generating the first code information mentioned above are as follows: The first code information mentioned above is generated based on at least a portion of the category, interface, package and test directory information corresponding to the target code mentioned above.

5. The method of Request Item 1, wherein the step of confirming the above-mentioned specified information includes the following steps: confirming information related to the user requesting the above-mentioned unit test; providing a directory related to one or more test types based on the information related to the above-mentioned user; and confirming the specified information corresponding to the selected test type based on the selection input of the above-mentioned user corresponding to the above-mentioned directory.

6. The method of Request 1, wherein the step of confirming the above-specified information includes the following steps: analyzing the above-specified target code to confirm the analysis information related to the above-specified target code; and based on the above-specified analysis information, providing a directory related to one or more test types to the user terminal; and in response to receiving a selection input corresponding to the above-specified directory from the above-specified user terminal, confirming the above-specified information.

7. As in Request 1, wherein the aforementioned specified information includes at least a portion of the information on the functions and variables corresponding to the aforementioned test type.

8. The method of request item 1, wherein the above-mentioned information includes at least a portion of the description of the purpose and implementation method corresponding to the above-mentioned test type.

9. The method of Request 1, wherein the above test types include at least a portion of A / B testing, feature flags, feature controls, and test recorders.

10. The method of request item 1, wherein the step of generating the second code above includes the following steps: generating the second code above based on the output value of the artificial intelligence model with the above-specified information as input.

11. The method of claim 10, wherein the aforementioned artificial intelligence model includes a related model constructed by: using a machine learning algorithm to model the relationship between an input dataset and an output dataset, the input dataset including one or more preceding code information, and the output dataset including an input pattern of subsequent code information corresponding to the aforementioned preceding code information.

12. The method of claim 10, wherein the aforementioned artificial intelligence model includes a generative artificial intelligence model.

13. The method of request item 1 further includes the following steps: providing sample code information corresponding to the information specified above.

14. The method of request item 13, wherein the step of providing the above sample code includes the following steps: providing the above sample code information in response to user input corresponding to the above-specified information.

15. The method of request item 1 further includes the following steps: In response to a request to provide guidelines, providing guidelines information.

16. The method of request item 15, wherein the steps of providing the above guidance information include the following steps: confirming information related to the user requesting the above unit test; and providing the above guidance information based on the information related to the user.

17. The method of request item 1 further includes the following steps: performing tests corresponding to the target code information based on the first code and the second code; generating test instances corresponding to the tests; and mapping and storing the test instances corresponding to the tests and information related to the user requesting the unit tests.

18. The method of request item 1 includes the following steps: receiving the added input information of the second code information mentioned above; and modifying the second code information based on the added input information mentioned above.

19. An electronic device comprising: One or more processors; one or more memory units storing commands to be executed by the one or more processors; the electronic device is configured such that, when the commands are executed by the one or more processors, the one or more processors perform the method of any one of claims 1 to 18.

20. A non-transitory computer-readable recording medium that records commands, when executed by one or more processors, to cause the one or more processors to perform actions, wherein the commands are configured to cause the one or more processors to perform any one of claims 1 to 18.

Citation Information

Patent Citations

  • Code testing method, device and system

    CN103377125A

  • Multi-device online test method and device, computer equipment and storage medium

    CN109918289A

  • Software test method and device

    TW201734791A

  • Instance managing method and electronic device for the same

    TW202420082A