Machine translation-based bug localization technique for bridging lexical gap.
Abstract
syntax tree (AST) nodes parsed from corresponding buggy files. During testing, some out-of-vocabulary words never appear in older bug reports and their corresponding buggy files, and this is known to decrease the accuracy of most translation models [2]. In addition to older bug reports and corresponding buggy files, API documents and project-specific documents are included in the training set to enrich the vocabulary and detect some comprehensive information. The API annotations and corresponding API sequences from API documents in Java SE 7 are extracted as noted in the literature [3]. The source code is parsed into AST nodes that include field declarations and type bindings of all classes and methods. In addition, the method-level code summaries are extracted as corresponding annotations. The project-specific documents are also included in addition to the API documents that are generally invoked by all projects. Paired with annotations of classes, methods, and fields, the source code is parsed into AST nodes of declarations, method invocations, and class instance creations. 3.2.2. Decoder RNN The Decoder is another RNN that is trained to generate the target sentence sequentially based on the context vectors obtained from the encoder RNN. The first word y0 is set as < START > , and the initial hidden state hd0 is calculated by hd0 = tanh(Wd he1), where Wd is the weight that can be learned during training and he1 is computed by Eq. (1). The Decoder then computes the hidden state hd1 using hd0, y0, and the context vector v1 by Eq. (2), followed by prediction of the first word InputStream.new. The hidden state hdt at time t is computed by: hdt = LSTM (hd (t − 1) , yt − 1 , vt ) (2) The conditional probability of yt given the previous predicted words and context vector is defined as: 3.2. Attention-based RNN encoder-decoder with LSTM cells p (yt yt − 1 , yt − 2 , …, y1 , vt ) = g (hdt , yt − 1 , vt ) To learn how to translate natural languages into code tokens, we build an attention-based RNN Encoder-Decoder model with LSTM cells. The workflow is shown in Fig. 1, which illustrates an example of translating the natural language term audio file player into a sequence of c