40
Views
1
CrossRef citations to date
0
Altmetric
Computers and Computing

Improving Coverage and Vulnerability Detection in Smart Contract Testing Using Self-Adaptive Learning GA

&
Pages 1593-1606 | Published online: 19 Dec 2023
 

Abstract

In the domain of software testing, the generation of test cases is a critical process for detecting system errors and bugs. However, automated test case generation for smart contracts often encounters challenges related to automation, vulnerability diversity, and coverage. This paper presents a novel method, the self-adaptive learning Genetic Algorithm (self-adaptive learning GA), designed to address these issues. Our research methodology incorporates several construction models, namely the Control Dependence Graph (CDG), Control Flow Graph (CFG), and Application Binary Interface (ABI). Initially, the ABI model provides essential information for generating and executing test cases. The CFG model subsequently visualizes potential execution paths through the functions of smart contracts. Ultimately, the CDG model identifies potential vulnerabilities in smart contracts. Using these models, our method enhances automatic test case generation in smart contracts by improving coverage and reducing execution time. We selected a variety of smart contracts from the Decentralized Finance (DeFi) ecosystem for data collection and comparative analysis. The experimental results show superior performance rates, with an average code coverage rate of 98.1%, a total of 3500 vulnerabilities detected, a vulnerability detection rate of 98.7%, a false positive rate of 1.3%, a recall of 98.2%, precision of 98.8%, a path uniqueness rate of 96.4%, false negative rate of 3.5%, an execution time of 25 s, and test case generation time of 16 s. In conclusion, our proposed approach demonstrates a significant improvement over existing methods for test case generation by providing a promising solution for the robustness of smart contracts and security enhancement in the DeFi ecosystem.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Notes on contributors

R. Sujeetha

R Sujeetha received BE degree in CSE from VLB Janakiammal Engineering & Technology, Coimbatore affiliated to Anna University Chennai, TN, India in 2007. ME degree in software engineering from PSG College of Technology, Coimbatore affiliated to Anna University, Coimbatore, Tamil Nadu in 2010. She also worked as an assistant professor in SRM Institute of Science and Technology, Ramapuram Campus, Where she is pursuing PhD degree. Her research interests include software testing, smart contracts in blockchain and machine learning in software engineering.

K. Akila

K Akila completed her PhD in Anna University Chennai in 2020 and is currently working as an assistant professor in Department of Computer Science and engineering, SRM Institute of Science and Technology, Vadapalani Campus. She received her bachelor’s degree in computer science and engineering from Arunai Engg College, University of Madras in 2003 and Master’s degree in computer science and engineering from Sathyabama University, 2005. She has over 17 years of teaching experience and published papers in the peer reviewed reputed journals. Her areas of interest are image processing machine learning. Email: [email protected]

Log in via your institution

Log in to Taylor & Francis Online

PDF download + Online access

  • 48 hours access to article PDF & online version
  • Article PDF can be downloaded
  • Article PDF can be printed
USD 61.00 Add to cart

Issue Purchase

  • 30 days online access to complete issue
  • Article PDFs can be downloaded
  • Article PDFs can be printed
USD 100.00 Add to cart

* Local tax will be added as applicable

Related Research

People also read lists articles that other readers of this article have read.

Recommended articles lists articles that we recommend and is powered by our AI driven recommendation engine.

Cited by lists all citing articles based on Crossref citations.
Articles with the Crossref icon will open in a new tab.