Lune

ICSE2025顶会

Automated Test Generation For Smart Contracts via On-Chain Test Case Augmentation and Migration

Jiashuo Zhang, Jiachi Chen, John Grundy, Jianbo Gao, Yanlin Wang, Ting Chen, Zhi Guan, Zhong Chen

摘要

Pre-deployment testing has become essential to ensure the functional correctness of smart contracts. However, since smart contracts are stateful programs integrating many different functionalities, manually writing test cases to cover all potential usages requires significant effort from developers, leading to insufficient testing and increasing risks in practice. Although several testing techniques for smart contracts have been proposed, they primarily focus on detecting common low-level vulnerabilities such as re-entrancy, rather than generating expressive and function-relevant test cases that can reduce manual testing efforts. To bridge the gap, we propose SOLMIGRATOR, an automated technique designed to generate expressive and representative test cases for smart contracts. To our knowledge, SOLMIGRATOR is the first migration-based test generation technique for smart contracts, which extracts test cases from real-world usages of on-chain contracts and migrates them to test newly developed smart contracts with similar functionalities. Given a target smart contract to be tested and an on-chain similar source smart contract, SOLMIGRATOR first transforms the on-chain usage of the source contract into off-chain executable test cases based on on-chain transaction replay and dependency analysis. It then employs fine-grained static analysis to migrate the augmented test cases from the source to the target smart contract. We built a prototype of SOLMIGRATOR and have evaluated it on real-world smart contracts within the two most popular categories, ERC20 and ERC721. Our evaluation results demonstrate that SOLMIGRATOR effectively extracts test cases from existing on-chain smart contracts and accurately migrates them across different smart contracts, achieving an average precision of 96.3% and accuracy of 93.6%. Furthermore, the results indicate that these migrated test cases effectively cover common key functionalities of the target smart contracts. This provides promising evidence that real-world usages of existing smart contracts can be transformed into effective test cases for other newly developed smart contracts.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Demystifying Exploitable Bugs in Smart Contracts 引用了 sFuzz: an efficient adaptive fuzzer for solidity smart contracts
  • Demystifying Exploitable Bugs in Smart Contracts 引用了 SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses
  • SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses 引用了 sFuzz: an efficient adaptive fuzzer for solidity smart contracts
  • ItyFuzz: Snapshot-Based Fuzzer for Smart Contract 引用了 SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. SolContractEval: A Benchmark for Evaluating Contract-Level Solidity Code GenerationZhifan Ye, Jiachi Chen, Zhenzhe Shao, Lingfeng Bao 等ASE 2025

它引用的 Paper12

  1. sFuzz: an efficient adaptive fuzzer for solidity smart contractsTai D. Nguyen, Long H. Pham, Jun Sun, Yun Lin 等ICSE 2020 · 260 次引用
  2. SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow AnalysesJaeseung Choi, Doyeon Kim, Soomin Kim, Gustavo Grieco 等ASE 2021 · 164 次引用
  3. TokenScope: Automatically Detecting Inconsistent Behaviors of Cryptocurrency Tokens in EthereumTing Chen, Yufei Zhang, Zihao Li, Xiapu Luo 等CCS 2019 · 140 次引用
  4. Demystifying Exploitable Bugs in Smart ContractsZhuo Zhang, Brian Zhang, Wen Xu, Zhiqiang LinICSE 2023 · 80 次引用
  5. ItyFuzz: Snapshot-Based Fuzzer for Smart ContractChaofan Shou, Shangyin Tan, Koushik SenISSTA 2023 · 76 次引用

相关 Paper

  1. Learning from the Past: Real-World Exploit Migration for Smart Contract PoC GenerationKairan Sun, Zhengzi Xu, Kaixuan Li, Lyuye Zhang 等ASE 2025 · 3 次引用
  2. DepFuzz: Efficient Smart Contract Fuzzing with Function Dependence GuidanceChenyang Ma, Wei Song, Jeff HuangOOPSLA 2025 · 3 次引用
  3. SmarTrim: Symbolic Execution for Smart Contracts Powered by Redundant Transaction-Sequence PruningHyegeun Song, Jiseong Han, Sunbeom SoFSE 2026 · 1 次引用
  4. SmartShot: Hunt Hidden Vulnerabilities in Smart Contracts using Mutable SnapshotsRuichao Liang, Jing Chen, Ruochen Cao, Kun He 等FSE 2025 · 2 次引用
  5. Targeted greybox fuzzing with static lookahead analysisValentin Wüstholz, Maria ChristakisICSE 2020 · 14 次引用
黄昏的海面,两侧是细线勾勒的悬崖