docs: restore detailed design documents

Restored the following documents that were removed in Black-white-box-Merge:
- docs/detailed-design/ (9 detailed design documents + append_doc.py)
- docs/development-paradigm.md (development paradigm flowchart)
- docs/test-report.md (test report)
- AGENTS.md (project instructions)
- _AI_USAGE_LOG.md (AI usage log)
- CLAUDE.md (project instructions)
- sample/ (4 example files)
This commit is contained in:
hangshuo652
2026-08-23 17:22:13 +08:00
parent 80f561a552
commit 5342220de5
19 changed files with 5859 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
# 示例数据
本目录包含 COBOL 迁移验证平台 V3 的示例数据。
## 文件说明
| 文件 | 说明 |
|------|------|
| `SIMPLE.cbl` | 最简 COBOL 程序示例 |
| `SIMPLE.cpy` | COPYBOOK 示例 |
| `SIMPLE-output.json` | 预期输出格式示例 |
## SIMPLE.cbl 说明
这是一个最简的 COBOL 程序,演示基本的 MOVE 和 DISPLAY 语句。
### 程序结构
```
IDENTIFICATION DIVISION. → 程序标识
DATA DIVISION. → 数据定义
WORKING-STORAGE SECTION. → 工作存储区
PROCEDURE DIVISION. → 过程部
```
### 数据定义
```cobol
01 BILL-RECORD.
05 BR-AMT PIC S9(7)V99 COMP-3. ()
05 BR-STATUS PIC X. ()
05 BR-DATE PIC 9(8). ()
```
### 过程逻辑
```cobol
MOVE 1500 TO BR-AMT.
MOVE 'A' TO BR-STATUS. → 赋值状态
MOVE 20260522 TO BR-DATE.
DISPLAY BR-AMT.
DISPLAY BR-STATUS.
DISPLAY BR-DATE.
STOP RUN.
```
## 输出格式
`SIMPLE-output.json` 展示了测试数据的标准 JSON 格式:
```json
{
"program": "程序名",
"version": "3.0",
"test_data": [
{
"id": 1,
"description": "测试描述",
"input": { "输入字段": "值" },
"expected_output": { "DISPLAY": ["输出值"] },
"working_storage": { "工作存储字段": "值" }
}
],
"coverage": {
"branch_coverage": "覆盖率",
"total_branches": ,
"covered_branches":
}
}
```
## 使用方法
```bash
# 使用示例 COBOL 程序运行测试
python -m cobol_testgen sample/SIMPLE.cbl sample/output/
# 查看生成的 JSON
cat sample/output/SIMPLE.json
```
## 扩展示例
更多示例请参考 `benchmark-programs/` 目录,包含 43 个真实 COBOL 程序。
+35
View File
@@ -0,0 +1,35 @@
{
"program": "SIMPLE",
"version": "3.0",
"generated_at": "2026-08-22T22:00:00",
"test_data": [
{
"id": 1,
"description": "基本赋值测试",
"input": {
"BILL-RECORD": {
"BR-AMT": "000150000",
"BR-STATUS": "A",
"BR-DATE": "20260522"
}
},
"expected_output": {
"DISPLAY": [
"000150000",
"A",
"20260522"
]
},
"working_storage": {
"BR-AMT": "000150000",
"BR-STATUS": "A",
"BR-DATE": "20260522"
}
}
],
"coverage": {
"branch_coverage": "100%",
"total_branches": 0,
"covered_branches": 0
}
}
+16
View File
@@ -0,0 +1,16 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. SIMPLE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BILL-RECORD.
05 BR-AMT PIC S9(7)V99 COMP-3.
05 BR-STATUS PIC X.
05 BR-DATE PIC 9(8).
PROCEDURE DIVISION.
MOVE 1500 TO BR-AMT.
MOVE 'A' TO BR-STATUS.
MOVE 20260522 TO BR-DATE.
DISPLAY BR-AMT
DISPLAY BR-STATUS
DISPLAY BR-DATE
STOP RUN.
+4
View File
@@ -0,0 +1,4 @@
01 BILL-RECORD.
05 BR-AMT PIC S9(7)V99 COMP-3.
05 BR-STATUS PIC X.
05 BR-DATE PIC 9(8).