Methods, systems, articles of manufacture, and apparatus for code review assistance for dynamic type languages
By analyzing code function calls through neural networks, the system generates review recommendations and automatically identifies and corrects type errors in dynamically typed languages. This solves the problem of time-consuming and inefficient code review in dynamically typed languages, improving the efficiency and quality of code review.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INTEL CORP
- Filing Date
- 2020-03-20
- Publication Date
- 2026-04-24
AI Technical Summary
Code review methods for dynamically typed languages are time-consuming and inefficient, requiring a large amount of manual, sequential code error fixing, and are inefficient in finding and fixing type errors in the code.
By using neural networks to analyze code function calls, review recommendations are generated. Machine learning models are used to compare the predicted data structure with the actual data structure to automatically identify and correct type errors.
It improved the efficiency of code review, reduced the number of iterative and sequential reviews, and improved code quality and development efficiency.
Smart Images

Figure CN121919087A_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to code review techniques, and more specifically to methods, systems, artifacts, and devices for assisting in code review of dynamically typed languages. Background Technology
[0002] Statically typed languages (such as C, C++, Java, Fortran, etc.) check variable types (such as floating-point, integer, string, etc.) at compile time. Dynamically typed languages (such as Python, JavaScript, Ruby, Perl, etc.) do not require compilation and do not need to check variable types used in these languages at runtime. Therefore, errors in scripts written using dynamically typed languages are often discovered during runtime.
[0003] Code review ensures software quality by allowing multiple programmers to examine and edit the source code. Source code is typically uploaded to online repositories such as... Once the source code has been uploaded, reviewers can find and correct errors within it. A thorough and iterative code review process helps ensure software quality. Attached Figure Description
[0004] Figure 1 This is a diagram of a code review system constructed based on the teachings of this disclosure.
[0005] Figure 2 yes Figure 1 A block diagram of the machine programming engine.
[0006] Figure 3 yes Figure 2 A block diagram of the parameter type vector (PTV) determiner.
[0007] Figures 4-6 This indicates that it can be executed to achieve [the desired result]. Figures 1-2 A flowchart of machine-readable instructions for a machine programming engine.
[0008] Figure 7 It is constructed for execution Figures 4-6 Instructions in the middle to achieve Figure 1 and / or Figure 2 A block diagram of an example processing platform for a machine programming engine.
[0009] These figures are not drawn to scale. Instead, the thickness of layers or regions may be enlarged in the figures. Generally, the same reference numerals will be used throughout the figures(s) and the accompanying written description to refer to the same or similar components.
[0010] When identifying multiple elements or components, this document uses descriptors such as “first,” “second,” “third,” etc. Unless otherwise specified or understood based on their context of use, such descriptors are not intended to assign any meaning of priority or chronological order, but are merely labels to refer to multiple elements or components separately for ease of understanding of the disclosed examples. In some examples, the descriptor “first” may be used to refer to an element in a detailed description, while different descriptors such as “second” or “third” may be used in the claims to refer to the same element. In such cases, it should be understood that such descriptors are used only for ease of referencing multiple elements or components. Detailed Implementation
[0011] In the following detailed description, reference is made to the accompanying drawings, which form part of this specification, illustrating specific examples that can be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to implement the subject matter, and it should be understood that other embodiments may be utilized and logical, mechanical, electrical, and other changes may be made without departing from the scope of the subject matter of this disclosure. Therefore, the following detailed description is provided to describe exemplary implementations and is not intended to limit the scope of the subject matter described herein. Certain features from different aspects described below may be combined to form newer aspects of the subject matter discussed below.
[0012] When describing the elements of the various embodiments of this disclosure, the articles “a,” “the,” and “said” are intended to mean the presence of one or more of these elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that additional elements may be present in addition to the listed elements.
[0013] Artificial intelligence (AI), including machine learning (ML), deep learning (DL), and / or other artificial machine-driven logic, enables machines (such as computers, logic circuits, etc.) to use models to process input data in order to generate outputs based on patterns and / or associations previously learned by the model through a training process. For example, data can be used to train a model to recognize patterns and / or associations, and such patterns and / or associations can be followed when processing input data, such that (multiple) other inputs result in (multiple) outputs consistent with the recognized patterns and / or associations.
[0014] Throughout the specification and claims, the following terms shall have the meaning explicitly associated herein unless the context clearly specifies otherwise. The term "neural network" refers to a computing system or other processor system that learns to perform a task by analyzing pre-classified training examples. A neural network comprises multiple densely connected processing nodes inspired by the human brain. In some examples, for instance, the nodes of a neural network may be organized into layers in which data moves in a forward direction (e.g., data in the first layer moves to the second layer, data in the second layer moves to the third layer, etc.) to drive one or more outputs based on one or more inputs via the correlations (e.g., connections) represented by the nodes and their interconnections. Deep learning and / or machine learning can be implemented via neural networks to process incoming data to generate outputs and benefit from feedback to improve its processing. A "recurrent neural network" or "RNN" is a neural network in which nodes or units include loops to allow information to persist over time. Thus, an RNN can utilize reasoning about previous events to inform subsequent processing. In an RNN, memory or other internal state is used to process the input sequence(s) in an element-wise process, where the output of each element depends on the outputs of previous and / or other elements (e.g., a directed graph driving the sequence).
[0015] There are many different types of machine learning models and / or machine learning architectures. The examples presented in this paper use a Long Short-Term Memory (LSTM) network. However, other types of machine learning models can be used additionally or alternatively, such as, for example, Support Vector Machines (SVMs), different types of RNNs, Convolutional Neural Networks (CNNs), etc. LSTM networks are RNNs designed to handle long-term dependencies. Typically, LSTM networks are organized into units and gates that interact to optimize the network's output. External information from the current element (e.g., information from previous elements) is stored in the gated units. These gates publish information based on their weights, which are adjusted and optimized during the training phase of the AI. In an LSTM network (or its simplified variant, a variable-gated recurrent unit network), nodes or units in the network have storage devices and associated storage states under the control of the neural network to aid in establishing correlations and processing input data. An encoder-decoder LSTM is a type of LSTM consisting of two RNN models (an encoder model and a decoder model). Typically, the encoder model reads the input and encodes it into a fixed-length vector. The decoder model maps fixed-length vectors to variable-length outputs. A common application of encoder-decoder LSTM networks is text translation.
[0016] Different types of training can be performed based on the type of machine learning model and / or the expected output. For example, supervised training uses inputs and corresponding expected (e.g., labeled) outputs to select parameters for a machine learning model (e.g., by iteratively selecting combinations of parameters) to reduce model error. Unsupervised learning refers to inferring the expected output (e.g., classification, expected output value, etc.) of a machine learning model from unlabeled input data using a neural network. Additionally or alternatively, unsupervised training (e.g., for deep learning, subsets of machine learning, etc.) involves inferring patterns from inputs to select parameters for a machine learning model (e.g., without the benefit of expected (e.g., labeled) outputs). Some examples disclosed in this paper include models trained via supervised training. However, any other type of training / learning can be used.
[0017] Dynamically typed languages are rapidly gaining popularity. Traditional code review methods for dynamically typed languages often require a significant time investment. For example, because code errors are discovered at runtime, errors in the code are typically found sequentially. That is, each error in the code is encountered one at a time. In such examples, if the code contains two or more errors (e.g., error 1, error 2, etc.), error 1 will cause the code to crash and require the programmer to fix it. After fixing error 1, error 2 will cause the code to crash and require a similar fix from the programmer. Thus, each error in a dynamically typed language must be found and fixed individually before the next error is discovered. Therefore, reviewing code corresponding to dynamically typed languages can be time-consuming and inefficient.
[0018] The examples disclosed in this paper overcome the aforementioned obstacles by analyzing source code and using a modified neural network to process function calls in the code, generating review recommendations based on this analysis, thereby improving code review techniques. The examples disclosed in this paper reduce the amount of iterative and sequential review required for developing software code using dynamically typed languages by simultaneously generating review recommendations for new code. In some of the examples disclosed in this paper, neural networks (e.g., encoder-decoder LSTM, etc.) are used to determine and analyze the inputs to function calls in code segments. In some of the examples disclosed in this paper, the neural network is generated and trained using previously checked and error-free code retrieved from a repository. In some of the examples disclosed in this paper, the neural network can generate a predicted data structure corresponding to the inputs of the function calls. In such examples disclosed in this paper, the predicted data structure can be compared with the actual data structure associated with the function call. In such examples, the difference between the predicted data structure and the actual data structure can be compared to determine whether there are errors associated with the function call.
[0019] Figure 1This is a diagram of a code review system 100 constructed in accordance with the teachings of this disclosure. The example code review system 100 includes example new code 102, example repository 104, example code review platform 106, example machine programming engine 108, example model storage device 110, example data collector 112, example public vulnerability and disclosure (CVE) feed 114, example training database 116, and example model generator 118.
[0020] The sample new code interface 101 acquires, retrieves, and / or otherwise receives sample new code 102 drafted by one or more programmers associated with the code review system 100. For example, one or more programmers associated with the code review system 100 may manually input new code 102 into the new code interface 101. Figure 1 In the illustrated examples, new code 102 is written in a dynamically typed language (e.g., Python, JavaScript, Ruby, Perl, Matlab, etc.). In some examples, new code 102 includes one or more function calls, each of which includes one or more inputs. In some examples, the function inputs are specific data types (e.g., integers, floating-point numbers, complex numbers, strings, booleans, maps, sets, etc.). In some examples, errors in the function inputs can be fatal. As used herein, the term "fatal" refers to a condition that causes new code 102 obtained by new code interface 101 to stop execution (e.g., exit, etc.) and, in some examples, output (e.g., print, etc.) an error message. In some examples, new code 102 obtained by new code interface 101 may include one or more function calls that include input with an incorrectly assigned data type (e.g., type error). As used herein, the term "type error" refers to an error that occurs when a function is applied to input of an inappropriate type. In some examples, type errors can be fatal. Additionally or alternatively, a type error may cause the new code 102 obtained by the new code interface 101 to be unable to execute its intended function.
[0021] Example repository 104 is a file archiving and hosting service where new code 102, obtained from the new code interface 101, is transferred to be stored. In some examples, repository 104 is an online hosting service (e.g., (etc.). In other examples, repository 104 is a physical location connected to code review platform 106, which can be accessed via a physical connection, intranet, etc. In some examples, repository 104 allows for revision control, bug tracking, and other code review-related functionalities.
[0022] Example code review platform 106 is a code review tool that allows multiple developers to work on new code 102 simultaneously (e.g., and (etc.). In some examples, the code review platform 106 assists in the review of new code 102 by checking coding type, naming conventions, and error review. In some examples, the code review platform 106 is a tool incorporated into the repository 104 and / or the new code interface 101. In other examples, the code review platform 106, the new code interface 101, and the repository 104 can be stand-alone software.
[0023] Example machine programming engine 108 analyzes new code 102 to determine if there are any potential errors (e.g., type errors, etc.) that need to be corrected. In some examples, machine programming engine 108 analyzes each function call of new code 102. For example, machine programming engine 108 may determine the parameter type vector (PTV) for each function call based on the input of the function call. As used herein, the term "parameter type vector" and the abbreviation "PTV" refer to a data structure (e.g., a vector, etc.) that indicates the parameter types (e.g., integers, floating-point numbers, etc.) of the function's input. In such examples, machine programming engine 108 may compare the determined PTV with a predicted PTV generated by a machine learning model trained on the set of code being reviewed. In some examples, if the difference between the determined PTV and the predicted PTV (e.g., Euclidean distance, etc.) meets an error threshold, machine programming engine 108 may generate an error warning associated with the analyzed function calls of new code 102. The example machine programming engine 108 can also identify structural problems (e.g., code / logic separation of functional blocks, etc.), suggest design patterns (e.g., implementing singletons, etc.), detect system-wide errors (e.g., race conditions, deadlocks, etc.), detect security issues (e.g., via models trained using CVE feed 114, etc.), and / or recommend language features. In some examples, the machine programming engine 108 is integrated into a code review platform 106 and / or a repository 104. In other examples, the machine programming engine 108 is hosted on a web and / or local computer.
[0024] Example model storage device 110 stores the location of (multiple) current models utilized by machine programming engine 108. In some examples, model storage device 110 is an online location (e.g., a dropdown list, etc.). In other examples, model storage device 110 may be implemented by a physical storage device (e.g., a hard drive, etc.). Figure 1In the illustrated example, model generator 118 transfers multiple models stored in model storage device 110 to model storage device 110. In some examples, when an updated model is received from or otherwise retrieved from model storage device 110, previous iterations of that model are deleted. In other examples, after an updated model has been received, the previous model is stored in model storage device 110.
[0025] Example data collector 112 retrieves model generator data from repository 104 and / or CVE feed 114 for use by model generator 118. For example, data collector 112 can use the interpolation feed to query repository 104 for fully reviewed code (e.g., code without known bugs, etc.). In other examples, data collector 112 may pull fully reviewed code from repository 104 (e.g., on a periodic, non-periodic, or predetermined basis, etc.). In some examples, data collector 112 may also query CVE feed 114 for periodic updates on public vulnerabilities and disclosures regarding new code 102. In some examples, data collector 112 may tag code blocks, functions, and / or classes for use by model generator 118. For example, data collector 112 may tag collected code based on its functions (e.g., using metadata from repository 104, usage analysis, etc.). In some examples, data collector 112 may determine the time and / or space complexity of the collected code. In some examples, data collector 112 can use batch analysis.
[0026] CVE Summary 114 is a data summary that includes a list of publicly known vulnerabilities and disclosures in the code. In some examples, CVE Summary 114 is provided by the relevant entity (e.g., MITRE). This is generated by a publicly available CVE system operated by government agencies, etc. In such examples, the CVE summary 114 consists of a unique identifier used to publicly identify known vulnerabilities in software. In some examples, the CVE summary 114 is continuously updated as new vulnerabilities are discovered. In some examples, the data collector 112 stores the collected data in an example training database 116. In some examples, the data collector 112 can modify and normalize the data to be stored in the example training database 116.
[0027] Example model generator 118 uses data collected by data collector 112 to train a machine learning model. For example, example model generator 118 trains a machine learning model based on data contained in training database 116 (e.g., as described in further detail below). Figure 2(e.g., PTV estimator model 210). In such examples, model generator 118 may divide the data in training database 116 into training data (e.g., data used to shape the machine learning model, etc.) and validation data (e.g., data used to test the machine learning model). In some examples, model generator 118 uses hyperparameters (e.g., learning rate, number of layers to be used in the machine learning model, etc.) to generate the model. In some examples, model generator 118 may generate new machine learning models (e.g., retraining an existing model, etc.). Model generator 118 may retrain the model in response to additional training data becoming available in training database 116, in response to a threshold amount of time elapsed since the previous model was generated, etc.
[0028] In operation, the developer of new code 102 pushes (e.g., commits, etc.) the new code 102 from the new code interface 101 to the repository 104 via example first message 122. In other examples, the code review platform 106 and / or the machine programming engine 108 can detect when the new code 102 is ready for review and query the new code interface 101 to obtain the new code 102. When example first message 122 is transmitted by the new code interface 101, example code review request 120 is transmitted from the new code interface 101 to the code review platform 106. In some examples, code review request 120 is generated by the new code interface 101 in response to first message 122. In other examples, the developer manually creates code review request 120. Upon receiving new code 102, the code review platform 106 generates review request 124 and transmits review request 124 to the machine programming engine 108. Then, machine programming engine 108 transmits sample request 126 from repository 104 for the submitted code and associated metadata (e.g., information identifying the new code 102). Machine programming engine 108 then performs sample analysis 130 using sample model 132 transmitted from model storage device 110. In some examples, analysis 130 determines which function calls of the new code 102 should be flagged for review. The following is combined with... Figures 4-6 This provides a more detailed description of the example implementation in Example Analysis 130.
[0029] To train model 132 used by machine programming engine 108, data collector 112 collects sample-reviewed code 134 from repository 104. In other examples, the sample-reviewed code 134 may come from any other suitable source (e.g., a different repository, from the programmer's local machine, etc.). Figure 1In the illustrated example, data collector 112 can also collect data from CVE feed 114. In some examples, data collector 112 can preprocess (e.g., normalize, clean, transform, enrich, etc.) the reviewed code 134 to facilitate model training. In other examples, model generator 118 can preprocess the reviewed code 134. Figure 1 In the illustrated example, data collector 112 may send preprocessed code 136 to training database 116. After a period of time (e.g., periodically, non-periodically, pre-planned, after a threshold time period, after exceeding the error rate of the current model, etc.), example model generator 118 sends query 138 to training database 116 to obtain model generation data 140. In some examples, model generation data 140 is divided into training data and validation data for use during example model generation 142. Once example model generation 142 is complete, example model 132 is sent to model storage device 110 until machine programming engine 108 requests model 132. In some examples, model 132 can be pushed to machine programming engine 108 as soon as model generator 118 generates model 132.
[0030] Figure 2 yes Figure 1 Block diagram of the machine programming engine 108. Figure 2 The example machine programming engine 108 includes an example code review interface 202, an example repository interface 204, an example function identifier 206, an example PTV determiner 208, an example PTV estimator model 210, an example error comparator 212, an example recommendation generator 214, and an example recommendation aggregator 216. Figure 2 In the illustrated example, the example code review interface 202 is the first transmission device. Figure 2 In the illustrated example, example storage interface 204 is a second transmitting device. Figure 2 In the illustrated example, example function identifier 206 is an identifier device. Figure 2 In the illustrated example, example PTV determiner 208 is a PTV determining device. Figure 2 In the illustrated example, example PTV estimator model 210 is a PTV estimation device. Figure 2 In the illustrated example, the example error comparator 212 is an error comparison device. Figure 2 In the illustrated example, example recommendation generator 214 is a recommendation generation device. Figure 2In the illustrated example, example recommendation aggregator 216 is a recommendation aggregation device. As used herein, example first sending device, example second sending device, example identification device, example PTV determination device, example PTV estimation device, error comparison device, recommendation generation device, and recommendation aggregation device are hardware.
[0031] Example code review interface 202 is an interface that facilitates communication between code review platform 106 and machine programming engine 108. For example, code review interface 202 packages and transmits code review recommendations (e.g., recommendation 128, recommendations generated by recommendation generator 214 and recommendation aggregator 216, etc.). In some examples, code review interface 202 may receive review requests (e.g., review request 124, etc.). In some examples, code review interface 202 converts received requests into a format readable by machine programming engine 108. In some examples, code review interface 202 may be implemented via hardware (e.g., modem, direct connection, etc.) and / or software (e.g., application programming interface, etc.).
[0032] Example repository interface 204 is an interface that facilitates communication between machine programming engine 108 and repository 104. For example, repository interface 204 packages and transmits a request for submitted new code 102 and associated metadata. In some examples, repository interface 204 receives submitted new code 102 and associated metadata. In some examples, repository interface 204 translates the received request into a format readable by machine programming engine 108. In some examples, repository interface 204 can be implemented via hardware (e.g., modem, direct connection, etc.) and / or software (e.g., application programming interface, etc.).
[0033] Example function identifier 206 analyzes the new code 102 and identifies the function calls it contains. For example, function identifier 206 identifies the function type, input parameters, output, arguments, etc., associated with each function in the new code 102. In some examples, function identifier 206 creates a data structure (e.g., a vector, matrix, etc.) containing data associated with each identified function and its associated parameters. In some examples, function identifier 206 preprocesses each identified function in the new code 102. For example, function identifier 206 may normalize, vectorize, etc., each function identified in a manner suitable for ensuring that the PTV estimator model 210 can handle the identified function calls.
[0034] Example PTV determiner 208 analyzes the identified functions to determine the parameter type vector (PTV) associated with each function identified by function identifier 206. For example, PTV determiner 208 generates the vector based on the input parameter(s) types of each function in new code 102. In some examples, the PTV determined by PTV determiner 208 employs conventional mathematical operations and / or lookup tables (e.g., not determined by machine learning, etc.). In some examples, the PTV determined by PTV determiner 208 is a one-hot encoded vector. Combined Figure 2 The example implementation of PTV determiner 208 is described in further detail.
[0035] The example PTV estimator model 210 is a machine learning algorithm and / or neural network that analyzes each function identified by function identifier 206. As described above, artificial intelligence (AI), including machine learning (ML), deep learning (DL), and / or other artificial machine-driven logic, enables the example PTV estimator model 210 to analyze each function identified by function identifier 206 to estimate PTV. For example, the PTV estimator model 210 could be an encoder-decoder LSTM model trained and validated using reviewed code from repository 104. In other examples, the PTV estimator model 210 could be any other suitable type of machine learning network (e.g., RNN, gated recurrent unit (GRU), deep convolutional network (DCN), echo state network (ESN), deep residual network (DRN), etc.). In some examples, the PTV estimator model 210 is periodically updated using difference feeds from repository 104 and / or any other suitable data source (e.g., CVE feed 114, etc.). In some examples, PTV estimator model 210 may be multiple models used based on the software type of the new code 102. For example, PTV estimator model 210 may include a model associated with a first type of code (e.g., operating system software, etc.) and a model associated with a second type of code (e.g., game software, etc.). In such examples, PTV estimator model 210 may be based on metadata received from storage 104 via storage interface 204.
[0036] Example error comparator 212 compares the PTV determined by PTV determiner 208 with the PTV estimated by PTV estimator model 210 to determine the difference between them. For example, error comparator 212 determines the reconstruction error based on the comparison. For example, error comparator 212 can determine the Euclidean distance between the PTV determined by PTV determiner 208 and the PTV estimated by PTV estimator model 210. In other examples, error comparator 212 can use any other suitable technique to compare the PTV determined by PTV determiner 208 and the PTV estimated by PTV estimator model 210 (e.g., cosine distance, etc.). Additionally or alternatively, error comparator 212 can compare any other suitable property of the determined PTV and the estimated PTV (e.g., values of a particular dimension, etc.).
[0037] Example recommendation generator 214 generates censorship recommendations based on the reconstruction error determined by error comparator 212. For example, recommendation generator 214 may determine whether the function needs to generate censorship recommendations based on whether the reconstruction error does not meet a reconstruction threshold. In some examples, the reconstruction threshold may be determined based on the reconstruction error determined during the training of PTV estimator model 210. In other examples, the operator of machine learning engine 108 has tuning parameters for controlling the frequency at which code censorship recommendations occur. In some examples, recommendation generator 214 does not generate recommendations if the reconstruction error does not meet the threshold.
[0038] Example recommendation aggregator 216 receives generated recommendations(s) from recommendation generator 214. In some examples, example recommendation aggregator 216 waits for PTV determiner 208, PTV estimator model 210, and / or error comparator 212 to analyze each function of new code 102. In such examples, recommendation aggregator 216 transmits a list of functions requiring review to code review platform 106 via code review interface 202. In other examples, recommendation aggregator 216 transmits recommendations(s) to code review interface(s) while generating recommendations.
[0039] although Figure 2 The implementation is shown in the figure. Figure 1 The example method of the machine programming engine 108, but Figure 4 One or more of the elements, processes, and / or devices shown may be combined, split, rearranged, omitted, eliminated, and / or implemented in any way. Furthermore, Figure 1 and / or Figure 2The example code review interface 202, example repository interface 204, example function identifier 206, example PTV determiner 208, example PTV estimator model 210, example error comparator 212, example recommendation generator 214, and example recommendation aggregator 216 and / or more generally, example machine programming engine 108 can be implemented by hardware, software, firmware, and / or any combination of hardware, software, and / or firmware. Therefore, for example, Figure 1 and / or Figure 2 The example code review interface 202, example repository interface 204, example function identifier 206, example PTV determiner 208, example PTV estimator model 210, example error comparator 212, example recommendation generator 214, and example recommendation aggregator 216 and / or more generally, any one of the example machine programming engine 108 can be implemented by one or more analog or digital circuits, logic circuits, (multiple) programmable processors, (multiple) programmable controllers, (multiple) graphics processing units (GPUs), (multiple) digital signal processors (DSPs), (multiple) application-specific integrated circuits (ASICs), (multiple) programmable logic devices (PLDs), and / or (multiple) field-programmable logic devices (FPLDs). When reading any of the device or system claims of this patent to cover pure software and / or firmware implementations, at least one of the example code review interface 202, example library interface 204, example function identifier 206, example PTV determiner 208, example PTV estimator model 210, example error comparator 212, example recommendation generator 214, and example recommendation aggregator 216 is thus expressly defined as including non-transitory computer-readable storage devices or disks (such as memory, digital versatile discs (DVDs), compact discs (CDs), Blu-ray discs, etc.) containing software and / or firmware. Furthermore, as Figure 1 The example machine programming engine 108 shown may include additions to or replacements of Figure 1 and Figure 2 The illustrated objects may include one or more elements, processes, and / or devices, and / or may include more than one of any or all of the illustrated elements, processes, and / or devices. As used herein, the phrase “communication” includes its various variations, encompassing direct communication and / or indirect communication via one or more intermediate components, and does not require direct physical (e.g., wired) communication and / or continuous communication, but additionally includes selective communication performed at periodic intervals, predetermined intervals, non-periodic intervals, and / or one-off events.
[0040] Figure 3 yes Figure 2A block diagram of the example PTV determiner 208 is provided. The example PTV determiner 208 includes an example literal parameter type estimator 302, an example variable type static analyzer 304, an example one-hot encoder 306, and an example cascader 308. Figure 3 In the illustrated example, the example text parameter type estimator 302 is a text parameter type estimation device. Figure 3 In the illustrated example, the example variable type static analyzer 304 is a static variable analysis device. Figure 3 In the illustrated example, the example one-hot encoder 306 is an encoding device. Figure 3 In the illustrated example, example serializer 308 is a serialization device. As used herein, example text parameter type estimation device, example static variable analysis device, example encoding device, and example serialization device are hardware.
[0041] Figure 2 The example literal parameter type estimator 302 performs literal type detection and embedding on each input of the function of the new code 102. For example, the literal parameter type estimator 302 can analyze each input of each function of the new code 102 to detect whether the new input of the function is a literal type object and identify the literal type of the input. As used herein, a "literal type" object is a common object with a fixed value in the programming language of the new code 102. For example, literal object types can include strings, integers, floating-point numbers, booleans, Unicode, etc. In some examples, the literal parameter type estimator 302 outputs a data structure (e.g., scalar, vector, etc.) representing the identified literal type. In some examples, if the input is not a literal type object (e.g., an empty token, etc.), the literal parameter type estimator 302 outputs a data structure.
[0042] Example variable type static analyzer 304 analyzes function calls to determine the primitive data types of the input. For example, variable type static analyzer 304 can analyze log files (e.g., the results of previous function calls, etc.) to determine whether the input object is associated with a primitive data type. As used herein, a "primitive type" object is a basic building block object that includes characters, integers, floating-point numbers, booleans, references, etc. For example, if the log file of new code 102 indicates that the input object of the function call was assigned "integer" four times and "character" once, example variable type static analyzer 304 determines that the first object is an integer. In other examples, variable type static analyzer 304 may use any other method to determine the type of the input variable. In some examples, variable type static analyzer 304 outputs a data structure (e.g., a scalar, vector, etc.) representing the identified primitive type.
[0043] The example one-hot encoder 306 receives the outputs of the text parameter type estimator 302 and the variable type static analyzer 304, and converts the outputs into vectors. In some examples, the vectors generated by the one-hot encoder 306 are binary sparse vectors, where one dimension (e.g., an index, etc.) has a value of "1", while each of the other dimensions has a value of "0". In some examples, each dimension of the vector represents a different possible data type. For example, if the example variable type static analyzer 304 can identify 10 different data types, then each vector generated by the one-hot encoder 306 will be 10-dimensional, with each dimension corresponding to a specific data type.
[0044] Example cassette 308 concatenates the outputs of variable type static analyzer 304 and literal parameter type estimator 302 into a PTV (e.g., "stacked", appended to, etc.). In some examples, to save memory, cassette 308 scalarizes each output of one-hot encoder 306 into a scalar value representing a potential index of "1" in the associated sparse vector. In such examples, the PTV can be scalar values. Additionally or alternatively, cassette 308 can create any suitable data structure.
[0045] Although Figure 3 Implementation shown Figure 2 Example PTV determiner 208 example method, but Figure 3 One or more of the elements, processes, and / or devices shown may be combined, split, rearranged, omitted, eliminated, and / or implemented in any way. Furthermore, Figure 2 and / or Figure 3The example text parameter type estimator 302, example variable type static analyzer 304, example one-hot encoder 306, example serializer 308, and / or more generally, example PTV determiner 208 can be implemented by hardware, software, firmware, and / or any combination of hardware, software, and / or firmware. Therefore, for example, any one of the example text parameter type estimator 302, example variable type static analyzer 304, example one-hot encoder 306, example serializer 308, and / or more generally, example PTV determiner 208 can be implemented by one or more analog or digital circuits, logic circuits, (multiple) programmable processors, (multiple) programmable controllers, (multiple) graphics processing units (GPUs), (multiple) digital signal processors (DSPs), (multiple) application-specific integrated circuits (ASICs), (multiple) programmable logic devices (PLDs), and / or (multiple) field-programmable logic devices (FPLDs). When any of the device or system claims of this patent is read to cover purely software and / or firmware implementations, at least one of the example text parameter type estimator 302, example variable type static analyzer 304, example one-hot encoder 306, and example serializer 308 is thus explicitly defined as including non-transitory computer-readable storage devices or storage disks (such as memory, digital versatile discs (DVDs), compact discs (CDs), Blu-ray discs, etc.) containing software and / or firmware. Furthermore, Figure 2 and Figure 3 Example PTV determiner 208 may include an attachment to or replacement of Figure 3 The objects illustrated herein may include one or more elements, processes, and / or devices, and / or may include more than one of any or all of the illustrated elements, processes, and / or devices. As used herein, the phrase “communication” includes its various variations, encompassing direct communication and / or indirect communication via one or more intermediate components, and does not require direct physical (e.g., wired) communication and / or continuous communication, but additionally includes selective communication performed at periodic intervals, predetermined intervals, non-periodic intervals, and / or one-off events.
[0046] exist Figures 4-6 The diagram shows the representation used for implementation. Figure 1 and Figure 3 The machine programming engine 108 provides example hardware logic, machine-readable instructions, hardware-implemented state machines, and / or any combination thereof flowcharts. Machine-readable instructions can be one or more executable programs or portions of executable programs that are executed by a computer processor, such as those combined with... Figure 7The processor 712 is shown in the example processor platform 700 discussed below. Programs can be embodied in software stored on non-transitory computer-readable storage media such as CD-ROMs, floppy disks, hard drives, DVDs, Blu-ray discs, or memory associated with the processor 712; however, the entire program(s) and / or portions thereof may alternatively be executed by devices other than the processor 712, and / or embodied in firmware or dedicated hardware. Furthermore, although references... Figures 4-6 The flowcharts illustrated herein describe (multiple) example programs, but many other methods for implementing the example machine programming engine 108 may be used alternatively. For example, the execution order of the boxes may be changed, and / or some of the boxes described may be changed, eliminated, or combined. Additionally or alternatively, any or all boxes may be implemented by one or more hardware circuits (e.g., discrete and / or integrated analog and / or digital circuits, FPGAs, ASICs, comparators, operational amplifiers, logic circuits, etc.) configured to perform the corresponding operations without executing software or firmware.
[0047] The machine-readable instructions described herein can be stored in one or more of the following formats: compressed format, encrypted format, fragmented format, encapsulated format, etc. The machine-readable instructions described herein can be stored as data (e.g., portions of instructions, code, code representations, etc.) that can be used to create, manufacture, and / or produce machine-executable instructions. For example, machine-readable instructions can be segmented and stored on one or more storage devices and / or computing devices (e.g., servers). Machine-readable instructions may require one or more of the following to be installed, modified, adapted, updated, combined, supplemented, configured, decrypted, decompressed, unpacked, distributed, and redistributed, so that they are directly readable and / or executable by computing devices and / or other machines. For example, machine-readable instructions can be stored in multiple parts that are individually compressed, encrypted, and stored on separate computing devices, wherein these parts, when decrypted, decompressed, and combined, form a set of executable instructions that implement the program as described herein. In another example, machine-readable instructions can be stored in a computer-readable state, but require the addition of libraries (e.g., dynamic link libraries (DLLs)), software development kits (SDKs), application programming interfaces (APIs), etc., to execute the instructions on a specific computing device or other device. In another example, it may be necessary to configure the machine-readable instructions (e.g., storage settings, data input, recorded network addresses, etc.) before they can be executed in whole or in part. Therefore, the disclosed machine-readable instructions and / or corresponding programs are intended to include such machine-readable instructions and / or programs, regardless of their specific format or state at storage or otherwise in a static or transmissible state.
[0048] As mentioned above, executable instructions (e.g., computer and / or machine-readable instructions) stored on non-transitory computer and / or machine-readable media can be used to implement... Figures 4-6 Example processes, non-transitory computer-readable media such as hard disk drives, flash memory, read-only memory, compact disks, digital multifunction disks, caches, random access memory, and / or any other storage device or disk in which information is stored for any duration (e.g., extended time periods, permanent, brief cases, for temporary buffering, and / or for caching information). As used herein, the term non-transitory computer-readable media is expressly defined to include any type of computer-readable storage device and / or disk, excluding propagated signals and transmission media.
[0049] "Comprising" and "including" (and all their forms and tenses) are used herein as open-ended terms. Therefore, whenever a claim uses any form of "comprising" or "including" (e.g., including, comprising, including, containing, having, etc.) in the preamble or within any kind of claim statement, it is to be understood that additional elements, items, etc., may be present without exceeding the scope of the corresponding claim or statement. As used herein, the phrase "at least" is as open-ended as the terms "comprising" and "including" when used as a transitional term, for example, in conjunction with a claim. When the term "and / or" is used, for example, in the form of A, B, and / or C, it refers to any combination or subset of A, B, C, such as (1) A alone, (2) B alone, (3) C alone, (4) A and B, (5) A and C, (6) B and C, and (7) A and B and C. As used herein in the context of describing structures, components, items, objects, and / or things, the phrase "at least one of A and B" is intended to mean an implementation including (1) at least one A, (2) at least one B, and (3) at least one A and at least one B. Similarly, as used herein in the context of describing structures, components, items, objects, and / or things, the phrase "at least one of A or B" is intended to mean an implementation including (1) at least one A, (2) at least one B, and (3) at least one A and at least one B. As used herein in the context of describing the processing or execution of processes, instructions, actions, activities, and / or steps, the phrase "at least one of A and B" is intended to mean an implementation including (1) at least one A, (2) at least one B, and (3) at least one A and at least one B. Similarly, as used herein in the context of describing the processing or execution of processes, instructions, actions, activities, and / or steps, the phrase "at least one of A or B" is intended to mean an implementation including (1) at least one A, (2) at least one B, and (3) at least one A and at least one B.
[0050] Figure 4 The process 400 includes box 402. At box 402, the example code review interface 202 receives a request for code analysis from the code review platform 106. For example, when new code 102 is submitted to repository 104, the code review platform 106 may automatically generate a code review request (e.g., review request 124, etc.). In some examples, the request received from the code review interface 202 may include desired information about the new code 102 in repository 104 (e.g., location). In some examples, the received request includes information about the analysis of the new code 102 (e.g., tolerances for constructing thresholds, the model to be used, etc.).
[0051] At box 404, repository interface 204 requests the submitted code and metadata from repository 104. For example, repository interface 204 may transmit a request for code (e.g., request 126, etc.) to repository 104 based on review request 124. In some examples, repository interface 204 may further request metadata associated with new code 102. In other examples, repository interface 204 may obtain new code 102 via any other means (e.g., directly entered by the developer, from code review platform 106, etc.).
[0052] At box 406, machine programming engine 108 performs code review analysis. For example, machine programming engine 108 can determine which functions of new code 102 should be flagged for review. The following section combines... Figure 5 The execution of box 406 is described in more detail.
[0053] At box 408, recommendation aggregator 216 determines whether code analysis has generated at least one recommendation. For example, recommendation aggregator 216 may determine whether recommendation generator 214 generated a recommendation during the execution of box 406. If recommendation aggregator 216 determines that a recommendation was generated, process 400 proceeds to box 410. If recommendation generator 214 determines that no recommendation was generated, process 400 proceeds to box 412.
[0054] At box 410, code review interface 202 transmits the generated recommendations to code review platform 106. For example, code review interface 202 transmits an annotated version of the code containing the functions to be reviewed to code review platform 106. In some examples, code review platform 106 transmits a list of functions to be reviewed. In other examples, code review interface 202's recommendations may be transmitted to code review platform 106 in any other suitable manner. Process 400 ends. At box 412, code review interface 202 transmits an indication that no recommendations were generated during code analysis to code review platform 106.
[0055] Figure 5 The process 500 includes box 502. At box 502, function identifier 206 identifies function calls in the new code 102. For example, the function identifier can parse the new code 102 to determine the function calls it contains. In some examples, function identifier 206 can identify other parameters (e.g., input objects, etc.) associated with the function in the new code 102.
[0056] At box 504, function identifier 206 selects a function call. For example, function identifier 206 can select a function call identified during the execution of box 502. In some examples, during the first execution of box 504, function identifier 206 selects the first function of new code 102 and iterates over it as the machine programming engine analyzes new code 102 (e.g., analyzes the second function during the second execution, the third function during the third execution, etc.). In such examples, the order selected by function identifier 206 enables the use of a sequence-dependent PTV estimator model 210 (e.g., a general RNN, LSTM, etc.). In other examples, function identifier 206 can select functions in any suitable order (e.g., random, reverse order, etc.).
[0057] At box 506, PTV determiner 208 determines the PTV of the selected function. For example, PTV determiner 208 can analyze the input of the selected function to determine the PTV of that function. Figure 6 The execution of box 506 is described in more detail.
[0058] At box 508, PTV estimator model 210 analyzes the function to predict its PTV. For example, PTV estimator model 210 uses a neural network (e.g., a general RNN, LSTM, etc.) to analyze the function to generate a PTV. In some examples, PTV estimator model 210 is trained via blocks of reviewed source code (e.g., from repository 104). In such examples, the function of the reviewed source code serves as the training input to PTV estimator model 210, and the corresponding PTV is used as the training output. In some examples, the corresponding PTV of the reviewed source code can be determined via PTV determiner 208. In some examples, the PTV of the function of new code 102 can be predicted via the topology of PTV estimator model 210.
[0059] At box 510, error comparator 212 determines the reconstruction error of the selected function based on the predicted PTV and the determined PTV. For example, error comparator 212 may calculate the Euclidean distance between the predicted PTV (e.g., determined by PTV estimator model 210 at box 508, etc.) and PTV determiner 208 (e.g., determined by PTV determiner 208 at box 506, etc.). In other examples, error comparator 212 may use any other suitable method to determine the reconstruction error.
[0060] At box 512, recommendation generator 214 determines whether the reconstruction error meets a recommendation threshold. In some examples, the recommendation threshold is empirically determined during the training of PTV estimator model 210. In some examples, the recommendation threshold can be set when the request is sent to machine programming engine 108. In other examples, the recommendation threshold can be determined by any other suitable means. If recommendation generator 214 determines that the reconstruction error meets the recommendation threshold, process 500 proceeds to box 512. If recommendation generator 214 determines that the reconstruction error does not meet the recommendation threshold, process 500 proceeds to box 514.
[0061] At box 514, recommendation generator 214 generates recommendations for reviewing the selected function call. For example, recommendation generator 214 may tag the function call for review. In some examples, recommendation generator 214 may generate specific suggestions for review. In some examples, recommendation generator 214 may add the function call to the function call list for review.
[0062] At box 516, function identifier 206 determines whether another function call should be analyzed. For example, function identifier 206 may determine whether there is a function call in new code 102 that has not yet been analyzed. In other examples, function identifier 206 may use any other suitable method to determine whether another function call should be analyzed. If the other function call should be analyzed, process 500 returns to box 504. If the other function call is not analyzed, process 500 ends.
[0063] Figure 6 The process 600 includes box 602. At box 602, a literal parameter type estimator 302 identifies the literal data type of the input to the function call. For example, the literal parameter type estimator 302 may identify the literal type(s) associated with each function call (e.g., string, floating-point number, integer, etc.). In some examples, the literal parameter type estimator 302 may determine the literal type parameters of the function call's input by analyzing the new code 102. In other examples, the literal parameter type estimator 302 may determine the literal data type via any other suitable means (e.g., prompting the developer to enter the information manually, metadata, etc.).
[0064] At box 604, the one-hot encoder 306 one-hot encodes the text data type into a first vector. For example, the one-hot encoder 306 can generate a data structure (e.g., a sparse binary vector, etc.) where one dimension (e.g., an index, etc.) has a value of "1" and each of the other dimensions has a value of "0". In such an example, each dimension of the data structure represents a different possible text data type for a function call. For example, if the function input has ten possible text data types, the one-hot encoder 306 creates a data structure with ten dimensions, where each dimension corresponds to one of the specific text data types.
[0065] At box 606, the variable type static analyzer 304 uses log file-based static analysis to identify the primitive data types of a function call. For example, the variable type static analyzer 304 can analyze the function's log file to determine what data types(s) are assigned to the function's input. For instance, if the function input is assigned four strings and one integer, the variable type static analyzer 304 identifies...
[0066] At box 608, the one-hot encoder 306 one-hot encodes the primitive metadata type into a second vector. For example, the one-hot encoder 306 can generate a data structure (e.g., a sparse binary vector, etc.) where one dimension (e.g., an index, etc.) has a value of "1" and each of the other dimensions has a value of "0". In such an example, each dimension of the data structure represents a different possible primitive metadata type(s) of the function call. For example, if the function input has ten possible primitive metadata types(s), the one-hot encoder 306 creates a data structure with ten dimensions, where each dimension corresponds to one of the primitive metadata types(s) of a particular primitive metadata type(s).
[0067] At block 610, concatenator 308 generates the PTV based on the first vector and the second vector. For example, concatenator 308 may combine the data structure generated by one-hot encoder 306 during execution of block 604 and the data structure generated by one-hot encoder 306 during execution of block 608. In some examples, concatenator 308 concatenates (multiple) data structures. Process 600 ends.
[0068] Figure 7 It is constructed for execution Figures 4-6 Instructions in the middle to achieve Figures 1-3 The block diagram shows an example processor platform 700 with machine programming engine 108. Processor platform 700 can be, for example, a server, personal computer, workstation, self-learning machine (e.g., neural network), mobile device (e.g., cellular phone, smartphone, such as iPad). TMTablet devices, personal digital assistants (PDAs), internet devices, headphones or other wearable devices, or any other type of computing device.
[0069] The illustrated example processor platform 700 includes a processor 712. The illustrated example processor 712 is hardware. For example, the processor 712 can be implemented by one or more integrated circuits, logic circuits, microprocessors, GPUs, DSPs, or controllers from any desired family or manufacturer. The hardware processor can be a semiconductor-based (e.g., silicon-based) device. In this example, the processor implements an example function identifier 206, an example PTV determiner 208, an example PTV estimator model 210, an example error comparator 212, an example recommendation generator, and an example recommendation aggregator 216.
[0070] The illustrated processor 712 includes local memory 713 (e.g., cache). The illustrated processor 712 communicates via bus 718 with main memory, which includes volatile memory 714 and non-volatile memory 716. The volatile memory 714 may be synchronous dynamic random access memory (SDRAM), dynamic random access memory (DRAM), etc. Dynamic Random Access Memory Implemented by and / or any other type of random access memory device. The non-volatile memory 716 may be implemented by flash memory and / or any other desired type of memory device. Access to the main memory 714 and main memory 716 is controlled by the memory controller.
[0071] The processor platform 700 illustrated also includes interface circuitry 720. Interface circuitry 720 can be implemented using any type of interface standard, such as an Ethernet interface, Universal Serial Bus (USB), etc. Interfaces, Near Field Communication (NFC) interfaces and / or PCI Fast Interfaces.
[0072] In the illustrated example, one or more input devices 722 are connected to interface circuitry 720. The input devices 722 allow the user to input data and / or commands into processor 712. The input devices may be implemented as, for example, audio sensors, microphones, cameras (still or video), keyboards, buttons, mice, touchscreens, trackpads, trackballs, isotope mice, and / or voice recognition systems.
[0073] One or more output devices 724 are also connected to the interface circuitry 720 of the illustrated example. The output devices 724 may be implemented, for example, by display devices (e.g., light-emitting diodes (LEDs), organic light-emitting diodes (OLEDs), liquid crystal displays (LCDs), cathode ray tube displays (CRTs), in-plane switching (IPS) displays, touchscreens, etc.), haptic output devices, printers, and / or speakers. Therefore, the interface circuitry 720 of the illustrated example typically includes a graphics driver card, a graphics driver chip, and / or a graphics driver processor.
[0074] The interface circuitry 720 of the illustrated example also includes communication devices such as transmitters, receivers, transceivers, modems, residential gateways, wireless access points, and / or network interfaces to facilitate the exchange of data with external machines (e.g., any kind of computing device) via network 726. Communication may be via, for example, Ethernet connections, digital subscriber line (DSL) connections, telephone line connections, coaxial cable systems, satellite systems, line-to-line wireless systems, cellular telephone systems, etc.
[0075] The illustrated processor platform 700 also includes one or more mass storage devices 728 for storing software and / or data. Examples of such mass storage devices 728 include floppy disk drives, hard disk drives, optical disk drives, Blu-ray disc drives, redundant array of independent disks (RAID) systems, and digital multifunction disc (DVD) drives.
[0076] Figure 4-6 The machine-executable instructions 732 may be stored in a mass storage device 728, in volatile memory 714, in non-volatile memory 716, and / or on a removable non-transitory computer-readable storage medium such as a CD or DVD.
[0077] As can be understood from the foregoing, example methods, apparatuses, and artifacts for assisting in code review of dynamically typed languages have been disclosed. The disclosed methods, apparatuses, and artifacts improve the efficiency of using computing devices by reducing the amount of time associated with reviewing and correcting dynamically typed languages. Accordingly, the disclosed methods, apparatuses, and artifacts relate to one or more improvements in computer functionality.
[0078] This document discloses example methods, devices, systems, and artifacts for assisting code review in dynamically typed languages. Further examples and combinations thereof include the following: Example 1 includes a device for analyzing code segments, comprising: a function identifier for identifying a first input to a first function call included in the code segment; a parameter type vector (PTV) estimator model for estimating a first data structure based on the first input, the PTV estimator model being generated via a set of code being reviewed; a PTV determiner for generating a second data structure based on the data parameter types of the first input; an error comparator for determining a first refactoring error based on the first and second data structures; and a recommendation generator for generating a first recommendation for reviewing the first function call when the first refactoring error does not meet a recommendation threshold.
[0079] Example 2 includes the device of Example 1, wherein a function identifier is used to identify a second input to a second function call included in a code segment after a first function call; a PTV estimator model is used to estimate a third data structure based on the first and second inputs; a PTV determiner is used to compute a fourth data structure based on the data parameter types of the second input; an error comparator is used to determine a second reconstruction error based on the third and fourth data structures; and a recommendation generator is used to generate a second recommendation for reviewing the second function call when the second reconstruction error does not meet a second recommendation threshold.
[0080] Example 3 includes the device of Example 2, wherein the PTV estimator model is further used to estimate the first data structure based on the second input.
[0081] Example 4 includes the device from Example 1, where the PTV estimator model is an encoder-decoder LSTM.
[0082] Example 5 includes the device of Example 1, wherein the PTV determiner includes: a text parameter type estimator for determining a text type associated with a first input; a variable type static analyzer for determining a primitive type associated with the first input by analyzing a log file associated with a code segment; and a concatenator for generating a first data structure based on at least one of the determined text type or primitive type.
[0083] Example 6 includes the device of Example 1, wherein an error comparator is used to determine a first reconstruction error based on the Euclidean distance between a first data structure and a second data structure.
[0084] Example 7 includes the device from Example 1, where the collection of code under review is queried from an online repository and normalized.
[0085] Example 8 includes a method for analyzing a code segment, the method comprising: identifying a first input to a first function call included in the code segment by executing instructions using at least one processor; estimating a first data structure based on the first input via a neural network generated via a set of code under review by executing instructions using at least one processor; generating a second data structure based on data parameter types of the first input by executing instructions using at least one processor; determining a first reconstruction error based on the first and second data structures by executing instructions using at least one processor; and generating a first recommendation for reviewing the first function call by executing instructions using at least one processor when the first reconstruction error does not meet a recommendation threshold.
[0086] Example 9 includes the method of Example 8, further comprising: identifying a second input to a second function call included in a code segment, wherein the second function call in the code segment follows the first function call; estimating a third data structure via a neural network based on the first and second inputs; computing a fourth data structure based on the data parameter types of the second inputs; determining a second reconstruction error based on the third and fourth data structures; and generating a second recommendation for reviewing the second function call when the second reconstruction error does not meet a recommendation threshold.
[0087] Example 10 includes the method of Example 9, wherein the first data structure is further estimated based on the second input via a neural network.
[0088] Example 11 includes the method of Example 8, where the neural network is an encoder-decoder LSTM.
[0089] Example 12 includes the method of Example 8, wherein calculating the second data structure based on the data parameter type of the first input includes: determining the text type associated with the first input, determining the primitive type associated with the first input by analyzing a log file associated with the code segment, and generating the first data structure based on at least one of the determined text type or primitive type.
[0090] Example 13 includes the method of Example 8, wherein determining the first reconstruction error based on the first data structure and the second data structure includes determining the Euclidean distance between the first data structure and the second data structure.
[0091] Example 14 includes the method of Example 8, in which the collection of code under review is queried from an online repository and normalized.
[0092] Example 15 includes a non-transitory computer-readable storage medium that, when executed, enables a machine to: identify a first input to a first function call included in a code segment; estimate a first data structure based on the first input via a neural network generated from a set of reviewed code; generate a second data structure based on the data parameter types of the first input; determine a first reconstruction error based on the first and second data structures; and generate a first recommendation for reviewing the first function call if the first reconstruction error does not meet a recommendation threshold.
[0093] Example 16 includes the non-transitory computer-readable storage medium of Example 15, wherein instructions cause a machine to further: identify a second input to a second function call included in a code segment, wherein the second function call is made after the first function call in the code segment; estimate a third data structure via a neural network based on the first and second inputs; compute a fourth data structure based on the data parameter types of the second inputs; determine a second reconstruction error based on the third and fourth data structures; and generate a second recommendation for reviewing the second function call when the second reconstruction error does not meet a recommendation threshold.
[0094] Example 17 includes the non-transitory computer-readable storage medium of Example 16, wherein the first data structure is further based on the second input.
[0095] Example 18 includes the non-transitory computer-readable storage medium of Example 15, wherein the neural network is an encoder-decoder LSTM.
[0096] Example 19 includes the non-transitory computer-readable storage medium of Example 15, wherein the instructions cause a machine to compute a second data structure based on the data parameter type of a first input by: determining a text type associated with the first input, determining a primitive type associated with the first input by analyzing a log file associated with a code segment, and generating the first data structure based on at least one of the determined text type or primitive type.
[0097] Example 20 includes the non-transitory computer-readable storage medium of Example 15, wherein the first reconstruction error is on the Euclidean distance between the first data structure and the second data structure. Although certain example methods, apparatuses, and articles of manufacture have been disclosed herein, the scope of this patent is not limited thereto. Rather, this patent covers all methods, apparatuses, and articles of manufacture that fall within the scope of the claims of this patent.
Claims
1. One or more computer-readable media storing instructions, said instructions being responsive to execution by one or more processors, causing said one or more processors to at least: Select the first function call included in the code segment for analysis; The first input that identifies the first function call; The first data structure corresponding to the first function call is estimated via a neural network, wherein, The estimation of the first data structure is based on the first input of the first function call, and wherein the neural network is trained via a set of reviewed code; Determine the text type associated with the first input of the first function call; Based on the determined text type associated with the first input of the first function call, a second data structure corresponding to the first function call is generated; Based on the first data structure and the second data structure, the first reconstruction error is determined; and If the first reconstruction error does not meet the recommendation threshold, a first recommendation is generated for reviewing the first function call.
2. The one or more computer-readable media according to claim 1, wherein, When executed, the instructions cause the one or more processors to: A second input is identified in the code segment that includes a second function call, wherein the second function call follows the first function call; The third data structure is estimated based on the first and second inputs via the neural network. Calculate the fourth data structure based on the data parameter type of the second input; Based on the third data structure and the fourth data structure, the second reconstruction error is determined; as well as If the second reconstruction error does not meet the recommendation threshold, a second recommendation is generated for reviewing the second function call.
3. The one or more computer-readable media according to claim 2, wherein, The first data structure is based on the second input.
4. One or more computer-readable media according to claim 1, wherein, The neural network is an encoder-decoder long short-term memory (LSTM).
5. One or more computer-readable media according to claim 1, wherein, When the instruction is executed, it causes the one or more processors to compute the second data structure based on the data parameter type of the first input by performing the following operations: Determine the text type associated with the first input; By analyzing the log file associated with the code segment, the primitive type associated with the first input is determined; as well as The first data structure is generated based on at least one of the determined text type or primitive type.
6. The one or more computer-readable media according to claim 1, wherein, when executed, the instructions cause the one or more processors to determine the first reconstruction error based on the Euclidean distance between the first data structure and the second data structure.
7. A calculation method, comprising: Select the first function call included in the code segment for analysis; The first input that identifies the first function call; A first data structure corresponding to the first function call is estimated via a neural network, wherein the estimation of the first data structure is based on the first input of the first function call, and wherein the neural network is trained via a set of examined code; Determine the text type associated with the first input of the first function call; Based on the determined text type associated with the first input of the first function call, a second data structure corresponding to the first function call is generated; Based on the first data structure and the second data structure, the first reconstruction error is determined; and If the first reconstruction error does not meet the recommendation threshold, a first recommendation is generated for reviewing the first function call.
8. The calculation method according to claim 7 further includes: A second input is identified in the code segment that includes a second function call, wherein the second function call follows the first function call; The third data structure is estimated based on the first and second inputs via the neural network. Calculate the fourth data structure based on the data parameter type of the second input; Based on the third data structure and the fourth data structure, the second reconstruction error is determined; as well as If the second reconstruction error does not meet the recommendation threshold, a second recommendation is generated for reviewing the second function call.
9. The calculation method according to claim 8, wherein, The first data structure is based on the second input.
10. The calculation method according to claim 7, wherein, The neural network is an encoder-decoder long short-term memory (LSTM).
11. The calculation method according to claim 7, further comprising: Determine the text type associated with the first input; By analyzing the log file associated with the code segment, the primitive type associated with the first input is determined; as well as The first data structure is generated based on at least one of the determined text type or primitive type.
12. The calculation method according to claim 7, further comprising: The first reconstruction error is determined based on the Euclidean distance between the first data structure and the second data structure.
13. A computing system, comprising: The memory stores instructions; One or more processors, The instruction is responsive to being executed by the one or more processors, causing the one or more processors to perform the computation method according to any one of claims 7 to 12.
14. A computing device comprising means for performing the computing method according to any one of claims 7 to 12.
15. A computer program product comprising instructions that, in response to execution by one or more processors, cause the one or more processors to perform the computation method according to any one of claims 7 to 12.