18 August 2021 in IEEE Transactions on Software Engineering
Code clones are duplicate code fragments that share (nearly) similar syntax or semantics. Code clone detection plays an important role in software maintenance, code refactoring, and reuse. A substantial amount of research has been conducted in the past to detect clones. A majority of these approaches use lexical and syntactic information to detect clones. However, only a few of them target semantic clones. Recently, motivated by the success of deep learning models in other fields, including natural language processing and computer vision, researchers have attempted to adopt deep learning techniques to detect code clones. These approaches use lexical information (tokens) and(or) syntactic structures like abstract syntax trees (ASTs) to detect code clones. However, they do not make sufficient use of the available structural and semantic information, hence limiting their capabilities. This paper addresses the problem of semantic code clone detection using program dependency graphs and geometric neural networks, leveraging the structured syntactic and semantic information. We have developed a prototype tool HOLMES, based on our novel approach and empirically evaluated it on popular code clone benchmarks. Our results show that \tool performs considerably better than the other state-of-the-art tool, TBCCD. We also assessed HOLMES on unseen projects and performed cross dataset experiments to evaluate the generalizability of HOLMES. Our results affirm that HOLMES outperforms TBCCD since most of the pairs that HOLMES detected were either undetected or suboptimally reported by TBCCD.
20 May 2025 in ACM Transactions on Cyber-Physical Systems
Data-driven models for state estimation using measurements obtained over a wireless network are essential to cyber-physical systems. Learning a data-driven model for an estimator using real wireless network deployments is, however, impractical as it would require data that captures varied wireless network conditions and their impact on estimation. We propose and evaluate a simulation to real-world transfer of a data-driven model for state estimation. Specifically, we train an estimator model using only data generated by a low-fidelity simulation of networks. Our choice of network simulation is a first-come-first-served single server queue, which is a network model with the two parameters of arrival rate of measurement packets into the queue and packet service rates. We employ domain randomization to bridge the gap between simulation and the real-world, appropriately randomizing the network model parameters during training. The efficacy of the resulting estimator model is demonstrated by testing it over two deployments of real wireless networks. In one, the estimator model estimates vehicles’ positions and speeds using data from vehicular trajectories received by it over a shared WiFi network, with up to seventy sources sending the measurements. In the other, GPS coordinates are communicated by public transit buses over city-wide cellular networks. The estimator uses the received measurements to estimate locations of the buses.