一句话:提出 Chrysalis,一个 Python 轻量级蜕变测试框架,通过日志记录变换历史并支持重放以定位缺陷。
蜕变测试通过输入变换与不变式检验程序行为,但失败后难以复现具体触发路径。Chrysalis 是一个面向 Python 的轻量级、可扩展日志与重放框架,允许开发者定义自定义输入变换及其关联不变式,并组织结构化蜕变测试活动。其核心创新是记录输入上变换历史的轻量日志机制,该紧凑表示既能识别测试失败,也能重放导致缺陷的精确变换序列,从而辅助调试。作者通过两个案例研究展示有效性:审计机器学习模型的公平性,以及评估大语言模型的鲁棒性。框架已开源并提供演示视频。
Metamorphic testing (MT) is a powerful technique for software testing. We introduce Chrysalis, a lightweight, extensible logging and replay-based metamorphic testing framework in Python. Chrysalis allows developers to define custom input transformations and their associated invariants, then execute structured metamorphic testing campaigns. Its key innovation is a lightweight logging mechanism that records the full history of transformations applied to an input. This compact representation enables developers to not only identify test failures but also to replay the exact sequence of transformations leading to a bug, facilitating debugging. We demonstrate Chrysalis’s effectiveness through two case studies: auditing a machine learning model for fairness and assessing the robustness of large language models.A screencast demonstrating Chrysalis is available at: https://youtu.be/xJG4qghxlIs, and the source code is available at: https://github.com/Chrysalis-Test/Chrysalis.
DOI 原文 ·
@inproceedings{paperbot9401,
title = {Chrysalis: A Lightweight Logging and Replay Framework for Metamorphic Testing in Python},
author = {Jai Parera and Nathan Huey and Ben Limpanukorn and Miryung Kim},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00371}
}