# Automatic Bug Triaging via Deep Reinforcement Learning
## 4 Bug Triaging via Deep Reinforcement (BT-RL) Model
### DMSF Model  
As shown in Figure 2(a), RNN structures, which are used for different neural network units, can extract features at different levels. The input primarily includes bug reports containing a specific description of the bug, i.e., the bug id, subproject, and component, and fixed time, which indicates the specific time point. These characteristics are important issues in bug triaging and are widely used in experiments. Since the RNN can be used for embedding in the pooling module to extract the text features of the bug reports, a one-way recurrent network was used to extract the features of developer participation at a specific moment and implement the multi-semantic fusion of high-level abstract features. The model architecture of feature extraction is more suitable for obtaining the information of multisource data. In the following process, the advantages of feature extraction are primarily elaborated based on the following three aspects:  
High-level feature extraction of text: First, this process uses word or one-hot embedding to convert the text information of bug reports into vectors of equal length. Second, the bidirectional RNN is used to extract text features. It not only obtains a feature vector that reduces the dimension, but also can be fused easily with other features. Third, the maximum feature pooling method is used to reduce the dimensionality of the feature vector and filter out the larger values in the feature vector. Finally, feature fusion is performed on the feature vectors to produce the high-level multi-semantic features of the current bug repair tasks. High-level feature extraction of developer engagement: The bug repair records of developers in the same subproject and components are arranged from far to near to form the developer activity sequence feature, which is the input into the one-way RNN for extracting high-level features of developer participation. Moreover, the output of the last node of the RNN is used as the final high-level feature of developer participation. Multi-semantic fusion of high-level features: For various high-level features of bug triaging, the appropriate form of fusion for the following activity should be used. Typical high-level feature fusion methods include concatenation, element-to-element addition, and element-to-element multiplication; nevertheless, the method to be used is yet to be determined. After these steps, we can obtain a candidate list of developers who can fix the bug. Specifically, we used score to represent the matching degree of a developer \(d\) in developer set \(A\) to fix the bug, and the score can be expressed as:  
\[Score(tf,af,d)=W_{d}(tf\odot af)+b_{d}, \tag{1}\]  
where \(tf\) is the high-level feature of a text, \(af\) is the high-level feature of developer participation, \(\odot\) is the fusion method between features, \(W_{d}\) is the weight vector of a developer \(d\), and \(b_{d}\) is the bias value. Among them, the levels of developer participation differ during bug report processing. We collected a sequence of bug reports from developers with the same subproject and component information as current bug reports in the historical bug fix record, with the maximum number of bug reports collected being 25. If there are more than 25 bug reports, the most recent 25 are selected. Among them, the repair interval for bug reports is six months before the current point in time. Subsequently, we obtained the probability of assigning bug triaging tasks to developer \(d\), and the probability was normalized by the high-level features after fusion using the Softmax layer. \[P(y=d|tf,af)=\frac{\exp(Score(tf,af,d))}{\sum_{d^{\prime}}\exp(Score(tf,af,d^{ \prime}))}, \tag{2}\]  
Loss represents the mean squared error between the predicted and target values. When the error is more than minor, it means that the model's predicted value is closer to the target value. Therefore, our goal is to minimize the loss during model training.