Code review is an essential activity for ensuring the quality and maintainability of software projects. However, it is a time-consuming and often error-prone task that can significantly impact the development process. Recently, ChatGPT, a cutting-edge language model, has demonstrated impressive performance in various natural language processing tasks, suggesting its potential to automate code review processes. However, it is still unclear how well ChatGPT performs in code review tasks. To fill this gap, in this paper, we conduct the first empirical study to understand the capabilities of ChatGPT in code review tasks, specifically focusing on automated code refinement based on given code reviews. To conduct the study, we select the existing benchmark CodeReview and construct a new code review dataset with high quality. We use CodeReviewer, a state-of-the-art code review tool, as a baseline for comparison with ChatGPT. Our results show that ChatGPT outperforms CodeReviewer in code refinement tasks. Specifically, our results show that ChatGPT achieves higher EM and BLEU scores of 22.78 and 76.44 respectively, while the state-of-the-art method achieves only 15.50 and 62.88 on a high-quality code review dataset. We further identify the root causes for ChatGPT's underperformance and propose several strategies to mitigate these challenges. Our study provides insights into the potential of ChatGPT in automating the code review process, and highlights the potential research directions.
14 July 2020 in IEEE Transactions on Wireless Communications
With the rising demand for the digital world and the emergence of new application scenarios, 5G wireless networks have become the key enabler of a new era. As one of the promising technologies, group-oriented device-to-device (D2D) communications are expected to improve spectral efficiency and reduce latency. However, to negotiate a group session key securely and effectively has become an urgent problem. In this paper, we propose an authentication and key agreement protocol, which merges the advantages of certificateless public key cryptography (CL-PKC) and elliptic curve cryptography (ECC), to guarantee secure and anonymous D2D group communications in 5G cellular networks. The security evaluation by using the Burrows-Abadi-Needham logic (BAN Logic) and the Automated Validation of Internet Security Protocols and Applications (AVISPA) shows that the security goal can be achieved. Furthermore, based on extensive simulation experiments, we evaluate the performance of the proposed solution in terms of computational costs, communication costs, and energy costs. The results demonstrate that the proposal is lightweight and efficient.
16 September 2016 in IEEE Transactions on Smart Grid
We present a novel defending strategy, adaptive Markov strategy (AMS), to protect a smart-grid system from being attacked by unknown attackers with unpredictable and dynamic behaviors. One significant merit of deploying AMS to defend the system is that it is theoretically guaranteed to converge to a best response strategy against any stationary attacker, and converge to a Nash equilibrium (NE) in case of self-play (the attacker is intelligent enough to use AMS to attack). The effectiveness of AMS is evaluated by considering the class of the data integrity attacks in which an attacker manages to inject false voltage information into the intelligent voltage controller in a substation. This kind of attack may cause load shedding and potentially a blackout. We perform extensive simulations using a number of IEEE standard test cases of different scales (different number of buses). Our simulation results indicate that AMS enables the system to experience much lower amount of load shedding compared with an NE strategy.
3 April 2023 in Science China Information Sciences