Shuangyu Lyu;Chuan Luo;Ruizhi Shi;Wei Wu;Chanjuan Liu;Chunming Hu
{"title":"Towards Effective Sampling of SMT Solutions","authors":"Shuangyu Lyu;Chuan Luo;Ruizhi Shi;Wei Wu;Chanjuan Liu;Chunming Hu","doi":"10.1109/TSE.2026.3702537","DOIUrl":null,"url":null,"abstract":"This work focuses on effectively generating diverse solutions for satisfiability modulo theories (SMT) formulas, targeting the theories of bit-vectors, arrays, and uninterpreted functions, which is a critical task in software and hardware testing. Generating diverse SMT solutions helps uncover faults and detect safety violations during verification and testing. This gives rise to the SMT sampling problem, whose goal is to construct a diverse solution set that achieves comprehensive coverage of the constraint space. While high coverage is crucial for exploring system behaviors, the number of generated solutions should also be kept small in software engineering scenarios. Since each SMT solution typically corresponds to a test case or test input, generating fewer solutions for the same coverage directly reduces testing time and resource consumption, thereby improving testing efficiency. In this work, we introduce <italic>PanSampler</i>, a novel SMT sampler that achieves high coverage with a small number of solutions. <italic>PanSampler</i> incorporates a new diversity-aware SMT algorithm and a post-sampling optimization strategy, which together enhance its practical performance. It iteratively samples solutions, evaluates candidates, and employs local search to refine solutions, ensuring high coverage with a small number of samples. Extensive experiments on practical benchmarks demonstrate that <italic>PanSampler</i> exhibits a significantly stronger capability to reach high target coverage, while requiring fewer solutions than state-of-the-art samplers to achieve the same coverage level. Furthermore, our empirical evaluation on practical subjects, which are collected from real-world software systems, shows that <italic>PanSampler</i> achieves stronger fault detection capability. Moreover, when reaching the same fault detection effectiveness as the competitors, <italic>PanSampler</i> greatly reduces the number of required solutions, thereby improving testing efficiency. Our evaluations also validate the effectiveness of <italic>PanSampler</i>’s core components. <italic>PanSampler</i> represents a significant advancement in SMT sampling for software engineering, contributing to the cost reduction of software testing and hardware verification.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"52 9","pages":"2670-2687"},"PeriodicalIF":6.0000,"publicationDate":"2026-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=11557498","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/11557498/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/6/10 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
This work focuses on effectively generating diverse solutions for satisfiability modulo theories (SMT) formulas, targeting the theories of bit-vectors, arrays, and uninterpreted functions, which is a critical task in software and hardware testing. Generating diverse SMT solutions helps uncover faults and detect safety violations during verification and testing. This gives rise to the SMT sampling problem, whose goal is to construct a diverse solution set that achieves comprehensive coverage of the constraint space. While high coverage is crucial for exploring system behaviors, the number of generated solutions should also be kept small in software engineering scenarios. Since each SMT solution typically corresponds to a test case or test input, generating fewer solutions for the same coverage directly reduces testing time and resource consumption, thereby improving testing efficiency. In this work, we introduce PanSampler, a novel SMT sampler that achieves high coverage with a small number of solutions. PanSampler incorporates a new diversity-aware SMT algorithm and a post-sampling optimization strategy, which together enhance its practical performance. It iteratively samples solutions, evaluates candidates, and employs local search to refine solutions, ensuring high coverage with a small number of samples. Extensive experiments on practical benchmarks demonstrate that PanSampler exhibits a significantly stronger capability to reach high target coverage, while requiring fewer solutions than state-of-the-art samplers to achieve the same coverage level. Furthermore, our empirical evaluation on practical subjects, which are collected from real-world software systems, shows that PanSampler achieves stronger fault detection capability. Moreover, when reaching the same fault detection effectiveness as the competitors, PanSampler greatly reduces the number of required solutions, thereby improving testing efficiency. Our evaluations also validate the effectiveness of PanSampler’s core components. PanSampler represents a significant advancement in SMT sampling for software engineering, contributing to the cost reduction of software testing and hardware verification.
期刊介绍:
IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include:
a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models.
b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects.
c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards.
d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues.
e) System issues: Hardware-software trade-offs.
f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.