Inference and Test Generation Using Program Invariants in Chemical Reaction Networks
Michael C. Gerten, Alexis L. Marsh, James I. Lathrop, Myra B. Cohen, Andrew S. Miner, Titus H. Klinge
Abstract
Chemical reaction networks (CRNs) are an emerging distributed computational paradigm where programs are encoded as a set of abstract chemical reactions. CRNs can be compiled into DNA strands which perform the computations in vitro, creating a foundation for intelligent nanodevices. Recent research proposed a software testing framework for stochastic CRN programs in simulation, however, it relies on existing program specifications. In practice, specifications are often lacking and when they do exist, transforming them into test cases is time-intensive and can be error prone. In this work, we propose an inference technique called ChemFlow which extracts 3 types of invariants from an existing CRN model. The extracted invariants can then be used for test generation or model validation against program implementations. We applied ChemFlow to 13 CRN programs ranging from toy examples to real biological models with hundreds of reactions. We find that the invariants provide strong fault detection and often exhibit less flakiness than specification derived tests. In the biological models we showed invariants to developers and they confirmed that some of these point to parts of the model that are biologically incorrect or incomplete suggesting we may be able to use ChemFlow to improve model quality. CCS CONCEPTS • Software and its engineering → Software testing and debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on2
- Deep Molecular Programming: A Natural Implementation of Binary-Weight ReLU Neural NetworksMarko Vasic, Cameron T. Chalk, Sarfraz Khurshid, David SoloveichikICML 2020 · 17 citations
- ChemTest: An Automated Software Testing Framework for an Emerging ParadigmMichael C. Gerten, James I. Lathrop, Myra B. Cohen, Titus H. KlingeASE 2020 · 5 citations
Related papers
- Reduction of Probabilistic Chemical Reaction NetworksMauricio Montes, Grégoire Sergeant-PerthuisICML 2026
- RNAFlow: RNA Structure & Sequence Design via Inverse Folding-Based Flow MatchingDivya Nori, Wengong JinICML 2024 · 23 citations
- Reward-Guided Iterative Refinement in Diffusion Models at Test-Time with Applications to Protein and DNA DesignMasatoshi Uehara, Xingyu Su, Yulai Zhao, Xiner Li et al.ICML 2025
- Traceback: A Fault Localization Technique for Molecular ProgramsMichael C. Gerten, James I. Lathrop, Myra B. CohenISSTA 2024
- Riemannian MeanFlowDongyeop Woo, Marta Skreta, Seonghyun Park, Kirill Neklyudov et al.ICML 2026 · 1 citation
