| With the increasing scale and complexity of software systems,the possibility of software system failure is increasing.Therefore,heterogeneous defect prediction comes into being.Heterogeneous defect prediction uses heterogeneous defect databases with different metrics to construct heterogeneous defect prediction models,so that developers can build more defect prediction models from publicly available defect data sets,thus reducing the occurrence of software defects and reducing software development costs.Federated learning can solve the problem of data islands and data privacy security in the field of heterogeneous defect prediction.However,there are still some problems in applying federated learning to heterogeneous defect prediction: 1.The effect of global model aggregation caused by data heterogeneity is poor;2.Lowvalue prediction in case of similar value prediction;3.The quantity of prediction model parameters is too large and the communication efficiency is low.Based on the analysis of the above problems,this paper studies the heterogeneous defect prediction method based on federated learning.A heterogeneous defect prediction algorithm based on federated reinforcement learning is designed.First,in order to avoid low value prediction,the Dueling DQN algorithm of reinforcement learning is used for local training.By combining the value branch and the advantage branch of the output layer into one output,the estimation redundancy and low value prediction are avoided.Then,the locally trained model parameters are encrypted with Gaussian differential privacy and sent to the server.Finally,in order to solve the global model performance degradation caused by data heterogeneity,this paper uses K-means algorithm to cluster the parameters of the participants’ models,and uses the similarity knowledge of the model to aggregate.Experimental results show that this method can improve the performance of heterogeneous software defect prediction.A heterogeneous defect prediction method based on the federated sparse compression algorithm is designed.First,in order to improve the generalization performance of the model,each participant conducts local training based on the capsule neural network,and achieves better prediction performance by calculating the relative position information of the feature combination.Then the gradient parameters are encrypted based on Gaussian difference privacy to ensure data security.In order to reduce the amount of communication bits and improve the communication efficiency,sparse binary compression is applied to the encrypted model parameters,and the model training is converted from dense computing to sparse computing.The non-zero element distance is sent to the server using Golomb coding for aggregation.Finally,the server decodes the received data,performs sparse binary compression and sends it back to each participant.The experimental results show that the proposed method can effectively reduce the amount of communication bits and improve the communication efficiency under the condition of equivalent model performance. |