# 测试覆盖率

## 总览

| 指标          | 值                         |
| ----------- | ------------------------- |
| Forge tests | **905 passed / 0 failed** |
| Lines       | 90.00%                    |
| Statements  | 88.23%                    |
| Branches    | 75.75%                    |
| Functions   | 92.22%                    |

## 分子系统

| 合约                     | branch coverage    |
| ---------------------- | ------------------ |
| Groth16PoBVerifier     | 100.00%            |
| EcdsaInferenceVerifier | 100.00%            |
| TeeProfileRegistry     | 100.00%            |
| PolicyRegistry         | 94.12%             |
| BehaviorSpecRegistry   | 93.33%             |
| PoBRegistry            | 88.46%             |
| OracleHub              | 88.46%             |
| StakeManager           | 84.62%             |
| ChallengeManager       | 82.76%             |
| ModelRegistry          | 83.33%             |
| TeeInferenceVerifier   | 80.00%             |
| ZkmlInferenceVerifier  | 75.00%             |
| PoDRegistry            | 74.29%             |
| ZkmlCircuitRegistry    | 64.71%             |
| OracleHubLocal         | 58.54% (待补 5 test) |

## 18 个未覆盖 branch arm 定位

详见 [Coverage Gap Analysis](https://github.com/leeleeEcho/babyDriver_Layer2/blob/main/docs/audit/coverage-gap-analysis-2026-05-07.md)。

主要缺口：

* OracleHubLocal: removeSymbol revert + setConfig 三 require × 上下界 (9 arms)
* L1BridgeContract.emergencyWithdraw: ETH/ERC20 双路径 (4 arms)
* L2BridgeContract Merkle 奇数 leaf 提升 (2 arms)
* FastWithdrawalPool ERC20 deposit 分支 (2 arms)
* ZkmlCircuitRegistry.reactivate AlreadyActive revert (1 arm)

## 跨语言 byte-pin

12 个 keccak literal 跨 Rust / Sol / TS 三栈一致性检查 — 任何一栈改 encoding 编译期 fail。

## Cargo test

baby-modules workspace 全绿（具体数量见 cargo test 输出，post commit `f57c7da`）。

## SDK test

* sdk/: 9 files / 83 tests pass (vitest 4.1.5)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yellowpaper.axblade.io/consolidated-resources/test-coverage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
