The present invention relates to an autocomplete technology that automatically complements a character string to be input in software development.
Software development, particularly coding in a low-level language close to a machine language, is very difficult, and enormous operations and language proficiency are required.
Therefore, a software development method called mix and match is used in which a code is created in a high-level language and then the code is converted into a code in a low-level language. A code of a low-level language may be referred to as a production code.
In the mix and match method, the entire code having portions of a code of a high-level language and portions of a code of a low-level language can be executed. The entire code can be executed and efficient development can be performed.
As described above, in the mix-and-match method, after a code of a high-level language is developed, the code is converted into a code of a low-level language. However, in order to achieve conversion into an appropriate code, considerable time is required, and there is a possibility that many code syntax bugs are included. For example, in a case where an element of an array starts at index 1 in Matlab, conversion to .NET/C needs to start at index 0, and such conversion can include a mistake.
There is a case where a code of a high-level language already exists and only syntax conversion to a low-level language is outsourced. However, even if a technology of auto-completing a character string of a code being created is applied with an AI tool having affinity for the syntax, productivity improvement is considered to remain at about 25% (Non-Patent Literature 1).
The present invention has been made in view of the above points, and an object thereof is to provide a technology of improving productivity of operations of converting a code of a high-level language into a code of a low-level language.
According to the disclosed technology, an autocomplete apparatus is provided that includes:
According to the disclosed technology, it is possible to improve productivity of operations of converting a code of a high-level language into a code of a low-level language.
Hereinafter, an embodiment of the present invention (present embodiment) will be described with reference to the drawings. The embodiment to be described below is merely an example, and an embodiment to which the present invention is applied is not limited to the following embodiment. In the following description, unless otherwise specified, “code” and “program” are used synonymously. That is, “code” in the following description may be replaced with “program”.
In the present embodiment, in the development of the code using the mix and match method, the autocomplete apparatus as described later estimates the “intention” of a programmer when converting a code of a high-level language into a code of a low-level language, and suggests the code of a low-level language corresponding to the code of the high-level language. The speed and quality of code creation can be improved by the estimation processing.
More specifically, the autocomplete apparatus learns specifications of a high-level language using a syntax of a code of a high-level language or the like, and learns coding of a low-level language by the programmer. When a programmer performs a new conversion operation, the autocomplete apparatus generates and displays a suggestion of a code of a low-level language based on a code of a high-level language. The programmer determines whether to use the suggestion, and the determination is fed back to learning. The unit of the suggestion is not limited to a specific unit, and may be a suggestion of a character string of a part of a certain line or a suggestion for conversion of the entire code snippet.
The autocomplete unit 110 suggests a low-level language code corresponding to a high-level language code to be converted, using a machine learning method. The method of the machine learning is not limited to a specific method, and a neural network such as DNN may be used, for example. An agent that is trained by the machine learning method to output a suggestion of a low-level language code may be referred to as a “model”. That is, the autocomplete unit 110 may be referred to as a model.
The display unit 120 displays a screen serving as an interface with the user. The screen includes suggestions and the like by the autocomplete unit 110. The input unit 130 receives an input from a user. The input is, for example, an input indicating whether to adopt the suggestion by the autocomplete unit 110.
The learning unit 140 causes the autocomplete unit 110 to perform learning. For example, in a case where the autocomplete unit 110 has a model of a neural network, the learning unit 140 performs learning of the model (parameter adjustment and the like) using a method such as an error back propagation method.
The storage unit 150 stores, for example, parameters of the autocomplete unit 110 (model), a code of a high-level language to be converted, a result of whether a suggestion input via the input unit 130 is adopted, and the like.
The autocomplete apparatus 100 may be physically configured by one device (computer) or may be configured by a plurality of devices connected to a network. For example, the autocomplete apparatus 100 may include a terminal including the input unit 130 and the display unit 120, and a server including the autocomplete unit 110, the learning unit 140, and the storage unit 150. The server may be a virtual machine on a cloud.
Next, an operation example of the autocomplete apparatus 100 will be described along the procedure of the flowchart illustrated in
In S101, as preliminary preparation, the learning unit 140 causes the autocomplete unit 110 to learn a code of a high-level language and a code of a low-level language. For example, specification of syntax of a high-level language and specification of syntax of a low-level language are input via the input unit 130, and the learning unit 140 performs learning so that the autocomplete unit 110 understands the syntax of the high-level language and the syntax of the low-level language.
A learning method is not limited to a specific method. For example, a code of a high-level language and a code of a low-level language corresponding to the code of the high-level language may be input, and the autocomplete unit 110 may perform learning so as to output a code of a correct low-level language for the code of the high-level language that has been input.
The autocomplete apparatus 100 may learn coding of the low-level language performed by a specific programmer. For example, the autocomplete apparatus 100 may learn in a manner that, by displaying a code of a high-level language on the display unit 120 and repeatedly inputting by a programmer a code of a low-level language corresponding to the code of the high-level language via the input unit 130, the autocomplete unit 110 can output the code of a low-level language corresponding to the code of the high-level language, the code of a low-level language being coded by the programmer.
The unit of the repetition described above is not limited to a specific unit. For example, learning may be performed by repeatedly displaying a module including a plurality of lines of code of a high-level language and creating and inputting a module of a low-level language corresponding to the module, or learning may be performed by repeatedly displaying a single-line code of a high-level language and creating and inputting a code of a low-level language corresponding to the code.
The learning described above can be achieved, for example, by the learning unit 140 adjusting parameters of the autocomplete unit 110 (model) such that the autocomplete unit 110 (model) outputs a code of a correct low-level language.
The learning described above may be performed in a plurality of types of low-level languages for one high-level language. The autocomplete unit 110 that has learned in a plurality of types of low-level languages for one high-level language can identify the type of the low-level language from a part of the low-level language code input from the programmer and can suggest a code of a correct type of low-level language in actual conversion operation.
An operation of converting a code of a certain high-level language into a code of a low-level language is started. For example, it is assumed that a code of a high-level language to be converted is stored in the storage unit 150. The autocomplete unit 110 reads the code of the high-level language to be converted from the storage unit 150, and displays the code of the high-level language to be converted via the display unit 120. The unit to be displayed is not limited to a specific unit. As an example, a module including a plurality of lines is displayed.
The programmer performing the operation starts inputting the code of the low-level language corresponding to the code of the high-level language displayed on the display unit 120. The code of the low-level language input by the programmer is displayed on the display unit 120 and is input to the autocomplete unit 110.
For example, the autocomplete unit 110 identifies, based on a start portion of the line of the code input by the programmer, which line of the high-level language to be converted the line corresponds to, and outputs (suggests) the line of the low-level language corresponding to the identified line via the display unit 120. That is, in this case, the autocomplete unit 110 outputs the suggestion at the timing when the programmer starts inputting the line of the low-level language code.
In the example described above, an example of making a suggestion in units of lines is illustrated, but the unit of making a suggestion is not limited to lines. The unit for making a suggestion may be a character string (for example, functions, arguments of functions, and the like) of a portion in a line or a code (also referred to as a module) of a group of a plurality of lines.
The autocomplete unit 110 may not make a suggestion in a case where an unlearned code in a high-level language is a conversion target.
The programmer who has seen the suggestion by the autocomplete unit 110 determines whether to adopt (accept) the suggestion, and inputs the determined result from the input unit 130. The determined result is passed from the input unit 130 to the learning unit 140 and the autocomplete unit 110.
For example, when the determined result is “suggestion is adopted”, the autocomplete unit 110 decides the suggestion as a code of a low-level language corresponding to a code of a high-level language. When the determined result is “suggestion is not adopted”, the autocomplete unit 110 displays another suggestion. Alternatively, if there is no other suggestion, a display is made to prompt the programmer to create the code without any suggestion.
The result of whether the suggestion is adopted determined by the programmer is also input to the learning unit 140. The learning unit 140 learns the autocomplete unit 110 based on a result of whether the suggestion is adopted for the suggestion. Specifically, for example, in a case where a suggestion for a certain high-level language code is not adopted, the learning unit 140 adjusts the parameters of the autocomplete unit 110 so as to lower the probability and priority of making the suggestion for the high-level language code. For example, in a case where a suggestion for a certain high-level language code is adopted, the learning unit 140 adjusts the parameters of the autocomplete unit 110 so as to perform the suggestion with high probability for the high-level language code.
The autocomplete apparatus 100 can be implemented, for example, by causing a computer to execute a program. This computer may be a physical computer, or may be a virtual machine on a cloud.
That is, a program corresponding to processing performed by the autocomplete apparatus 100 is executed by use of hardware resources such as a CPU and a memory built in a computer, so that the autocomplete apparatus 100 can be implemented. The above program can be stored and distributed by being recorded in a computer-readable recording medium (portable memory or the like). The above program can also be provided through a network such as the Internet or an electronic mail.
The program for implementing processing in the computer is provided through a recording medium 1001 such as a CD-ROM or a memory card, for example. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed from the recording medium 1001 into the auxiliary storage device 1002 via the drive device 1000. However, the program is not necessarily installed from the recording medium 1001, and may be downloaded from another computer via a network. The auxiliary storage device 1002 stores the installed program, and also stores necessary files, data, and the like.
In a case where an instruction to start the program is made, the memory device 1003 reads the program from the auxiliary storage device 1002, and stores the program therein. The CPU 1004 implements a function related to the autocomplete apparatus 100 in accordance with the program stored in the memory device 1003. The interface device 1005 is used as an interface for connection to a network, various external devices, and the like. The display device 1006 displays a graphical user interface (GUI) or the like according to the program. The input device 1007 includes a keyboard and a mouse, buttons, a touch panel, or the like, and is used to input various operation instructions. The output device 1008 outputs a calculation result.
As described above, according to the technology according to the present embodiment, the code of the high-level language and the code of the low-level language after conversion corresponding to the code of the high-level language are learned, and when the programmer converts the high-level language into the low-level language, the code of the low-level language is suggested based on the learning, and the adoption/rejection of the suggestion result by the programmer is reflected in the learning. Therefore, productivity by autocomplete can be further enhanced.
Since the coding for a specific programmer can be learned, it is also possible to adapt a code suggestion to a specific programmer.
The present specification discloses at least the autocomplete apparatus, the autocomplete method, and the program described in the following clauses.
An autocomplete apparatus including:
The autocomplete apparatus according to clause 1,
The autocomplete apparatus according to clause 2,
The autocomplete apparatus according to any one of clauses 1 to 3, in which
An autocomplete method performed by a device including an autocomplete unit, the autocomplete method including:
A program for causing a computer to function as each unit in the autocomplete apparatus according to any one of clauses 1 to 4.
Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and changes can be made within the scope of the gist of the present invention described in the claims.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2021/021566 | 6/7/2021 | WO |