RealDiff 是一款用于拉取请求的运行时行为差异检测工具,旨在发现普通源代码审查可能遗漏的运行时行为变更 1。该工具支持 .NET、Java、Node.js、Go、Rust 和 Python 六种语言 1。其核心机制是通过构建两个 Git 修订版并观察测试执行情况来进行检测,在此过程中学习三次基础运行的噪声基线,从而报告每个调用树中首次发生的行为变化 1。
该工具能够展示一个看似无害的重构如何改变未编辑文件中的行为 1。例如,在展示的示例中,List.Sort 不稳定而 OrderBy 稳定,导致定价引擎返回值从 CLEARANCE_40 变为 SEASONAL_40 1。在部署与集成方面,RealDiff 提供 Docker 镜像和多种安装方式,包括 NuGet 工具包,并支持 GitHub Actions 和 Azure Pipelines 集成 1。同时,该工具默认启用数据脱敏功能,保护密码和令牌等敏感信息 1。在 v0.4.0 版本中,其在 FluentValidation 规模案例中,缓存命中后分析速度提升 84.1% 1。
RealDiff is a tool designed to detect runtime behavior differences in pull requests across six programming languages: .NET, Java, Node.js, Go, Rust, and Python 1. The system operates by building two Git revisions and observing their test executions to identify runtime behavioral changes that might be missed during standard source code reviews 1. RealDiff learns a noise baseline from three initial runs and reports the first behavioral change that occurs within each call tree 1.
An example demonstrates how a seemingly harmless refactoring can alter the behavior of an unedited file 1. In this case, the unstable List.Sort and the stable OrderBy caused a pricing engine to return SEASONAL_40 instead of CLEARANCE_40 1.
RealDiff offers a Docker image and multiple installation methods, including a NuGet tool package, and supports GitHub Actions and Azure Pipelines integration 1. The tool enables data masking by default to protect sensitive information such as passwords and tokens 1. In version v0.4.0, analysis speed increased by 84.1% after cache hits in a FluentValidation scale case 1.
评论
还没有评论,欢迎留下第一条。