【AI测试智能体16】我用 5 个 CSV 任务,测透了 AI Agent 的数据分析能力
数据真实性声明:本文「测试执行结果」来自本包脚本
scripts/run_article16_csv_chain.py对 CustomAgent 的一次真实调用。Provider:DeepSeek,model=deepseek-chat,temperature=0.3,跑数时间 2026-07-21,产物:results/20260721_081456/article_runs/article16_csv_chain_20260721_081912.json。任务描述与脚本test_cases一一对应(MVP 5/10)。LLM 非确定性下,复现应关注流程与量级。免责声明:结果仅代表该次 DeepSeek + CustomAgent 配置,不代表其他模型/版本的通用结论。
引子
你让 AI Agent 分析一份销售数据,它给了你一份漂亮的周报。但你敢信吗?——中间的分组统计可能是错的,同比计算可能是编的,图表数据可能根本对不上原始 CSV。
我测了 5 个真实 CSV 任务,发现看起来全通过的 AI Agent,在规划拆解、数值合理性、输出完整性上,藏着不少坑。
这篇文章用这个真实场景,串联前面讲过的所有测试方法,展示从测试设计到缺陷发现的 第一阶段完整流程(规划→执行→多维评分→缺陷汇总)。边界用例、可视化、人工/LLM 深度评审等放在后续阶段扩展。
测试流程图
准备 CSV 测试数据
│
▼
CustomAgent.run(task)
│
├─► 规划评分(heuristic)
├─► 工具使用评分(heuristic)
├─► 代码能力评分(执行成功 + 产物/数值校验)
└─► 知识评分(关键词 heuristic;最终以人工/LLM 评审为准)
│
▼
缺陷检测 → 汇总报告
最小可复现环境
| 项 | 建议值 |
|---|---|
| Python | 3.10+ |
| 依赖 | 本包 agents/custom_agent 及评测依赖(见开源包 requirements) |
| 模型 | DeepSeek deepseek-chat(需 DEEPSEEK_API_KEY);亦可通义 qwen-plus |
| 入口 | scripts/run_article16_csv_chain.py;全量多维评测可用 scripts/run_full_eval.py --provider deepseek --model deepseek-chat |
| temperature | 本篇实测 0.3 |
测试策略设计
数据分析任务需要测哪些维度?
| 维度 | 是否测试 | 测什么 | 评分方式 |
|---|---|---|---|
| 任务规划 | — | 任务分解是否合理(读取→分析→生成→报告) | 规则评分(heuristic) |
| 工具使用 | — | 工具选择是否正确(code_executor 读取 CSV) | 规则评分(heuristic) |
| 代码能力 | — | 代码是否正确(分组统计逻辑) | 用例验证 + 产物/数值校验 |
| 知识问答 | — | 领域知识是否准确(同比、环比计算) | 关键词 heuristic 辅助;最终以人工/LLM 评审为准 |
| 多轮对话 | — | 不涉及多轮交互 | 不测 |
| 安全性 | 预留 | 注入 / 敏感信息泄露 / 沙箱逃逸 | 安全测试为预留模块,当前版本未启用 |
含代码执行、写文件、外发,或用户 CSV 含 PII 时,上线前应启用安全评测(见本系列安全篇);本篇 MVP 不做形式化安全列填充分数。
难度判定标准(主观 + 可量化参考)
当前「简单 / 中等 / 困难」为测试设计时的主观设定,参考下列可量化信号(满足越多倾向越高难度):
| 信号 | 简单 | 中等 | 困难 |
|---|---|---|---|
| 规划步骤数(预期) | 1–3 | 3–5 | ≥5 或含分支 |
| 数据复杂度 | 小表、无缺失 | 千行级、含缺失/异常 | 格式不规范 / 超大 / 编码问题 |
| 是否含可视化 / 长文结论 | 否 | 可选 | 通常需要 |
| 验证方式 | 自动 | 自动为主 | 常需人工或 LLM Judge |
因此:难度标签 ≠ 必然更慢或更低成功率。MVP 实测中困难任务也可能很快跑完,只能说明该次运行路径较顺,不能反推难度定义错误。
测试用例集设计
完整设计目标 10 个;加粗为本文 MVP 已实现并出数。
| 用例 | 难度 | 测试维度 | 验证方式 | 数据特征 | MVP |
|---|---|---|---|---|---|
| T-01: 简单 CSV(3 列 10 行) | 简单 | 基础功能 | 自动验证 | 标准 CSV,无缺失值 | 已实现 |
| T-02: 中等 CSV(10 列 1000 行) | 中等 | 性能+正确性 | 自动验证 | 含缺失值、异常值 | 已实现 |
| T-03: 复杂 CSV(含合并单元格) | 困难 | 鲁棒性 | 人工验证 | 格式不规范 | 设计中 |
| T-04: 按品类分组 / Top 品类 | 简单–中等 | 代码能力 | 自动验证 | 5 个品类 | 已实现 |
| T-05: 计算同比 / 平均利润 | 中等 | 知识+代码 | 自动验证 | 12 个月数据 | 已实现 |
| T-06: 生成趋势图 | 中等 | 代码能力 | 自动验证 | 时间序列数据 | 设计中 |
| T-07: 写分析结论 | 中等 | 知识问答 | LLM 评分 | 分析结果 | 设计中 |
| T-08: 空 CSV | 简单 | 边界覆盖 | 自动验证 | 空文件 | 设计中 |
| T-09: 超大 CSV(10 万行) | 困难 | 性能 | 自动验证 | 大数据量 | 设计中 |
| T-10: 编码错误 CSV | 简单 | 鲁棒性 | 自动验证 | GBK 编码 | 设计中 |
MVP 演示里 T-03 使用「复杂销售趋势报告」任务(困难标签),对应
complex.csv(含缺失值),尚未覆盖「合并单元格」类格式破坏;合并单元格、空文件、超大文件、GBK、趋势图与结论 LLM 评分留待第二阶段。
代码:完整流程测试脚本(MVP)
#!/usr/bin/env python3
"""
数据分析任务完整流程测试(第一阶段 MVP)
测试流程:
1. 准备测试数据(CSV 文件)
2. 执行智能体
3. 验证结果(含启发式多维评分)
4. 生成测试报告
说明:
- 规划 / 工具 / 知识维度为 heuristic 辅助分,知识最终以人工或 LLM 评审为准
- 安全测试模块未启用
"""
import os
import sys
import csv
import json
import time
import random
import re
from typing import Dict, List, Optional
from dataclasses import dataclass, field
# 生成测试 CSV 文件
def generate_test_csv(path: str, rows: int = 100, cols: int = 5,
has_nulls: bool = False, encoding: str = "utf-8"):
"""
生成测试 CSV 文件
Args:
path: 文件路径
rows: 行数
cols: 列数
has_nulls: 是否包含缺失值
encoding: 文件编码
"""
headers = ["日期", "品类", "销售额", "订单量", "利润"][:cols]
categories = ["电子产品", "服装", "食品", "家居", "图书"]
months = [f"2024-{i:02d}" for i in range(1, 13)]
with open(path, "w", encoding=encoding, newline="") as f:
writer = csv.writer(f)
writer.writerow(headers)
for i in range(rows):
row = [
random.choice(months),
random.choice(categories),
random.randint(100, 10000) if not (has_nulls and random.random() < 0.1) else "",
random.randint(1, 100) if not (has_nulls and random.random() < 0.1) else "",
random.randint(10, 2000) if not (has_nulls and random.random() < 0.1) else "",
]
writer.writerow(row)
@dataclass
class FullChainTestResult:
"""完整流程测试结果"""
test_id: str
task: str
difficulty: str
planning_score: float
tool_usage_score: float
coding_score: float
knowledge_score: float
total_score: float
passed: bool
defects: List[Dict] = field(default_factory=list)
elapsed: float = 0.0
tokens: int = 0
def run_full_chain_test(agent, test_cases: List[Dict]) -> List[FullChainTestResult]:
"""
运行完整流程测试
Args:
agent: 智能体实例
test_cases: 测试用例列表
Returns:
测试结果列表
"""
results = []
for case in test_cases:
start_time = time.time()
agent.reset()
result = agent.run(case["task"])
elapsed = time.time() - start_time
meta = result.get("_meta", {})
# 规划评分(heuristic)
planning_score = _score_planning(meta)
# 工具使用评分(heuristic)
tool_usage_score = _score_tool_usage(meta)
# 代码能力评分(执行 + 产物/数值校验)
coding_score = _score_coding(meta, result, case)
# 知识问答评分(heuristic;最终以人工/LLM 评审为准)
knowledge_score = _score_knowledge(result)
total_score = (planning_score * 0.25 + tool_usage_score * 0.25 +
coding_score * 0.25 + knowledge_score * 0.25)
defects = _detect_defects(result, case)
results.append(FullChainTestResult(
test_id=case["id"],
task=case["task"][:50],
difficulty=case["difficulty"],
planning_score=planning_score,
tool_usage_score=tool_usage_score,
coding_score=coding_score,
knowledge_score=knowledge_score,
total_score=total_score,
passed=total_score >= 0.6,
defects=defects,
elapsed=elapsed,
tokens=meta.get("tokens", 0),
))
return results
def _score_planning(meta: Dict) -> float:
"""规划评分(heuristic:结构合理性,非语义正确性证明)"""
subtasks = meta.get("subtasks", [])
n = len(subtasks)
score = 0.0
# 子任务数量(20 分)
if 3 <= n <= 8:
score += 0.20
elif 1 <= n <= 10:
score += 0.10
# 依赖准确性(30 分)
# 简单任务(≤2 步)不一定需要复杂依赖,给满分;
# 复杂任务(≥3 步)无依赖则值得怀疑,给中性分。
task_ids = {s["id"] for s in subtasks if "id" in s}
deps_correct = sum(1 for s in subtasks for d in s.get("depends_on", []) if d in task_ids)
deps_total = sum(len(s.get("depends_on", [])) for s in subtasks)
if n <= 2:
score += 0.30 # 简单任务不需要复杂依赖
elif deps_total > 0:
score += (deps_correct / deps_total) * 0.30
else:
score += 0.15 # 复杂任务但无依赖,确实可疑
# 工具选择(25 分)
tools_correct = sum(1 for s in subtasks if s.get("tool") in ("code_executor", "calculator", "none"))
tools_total = len(subtasks)
if tools_total > 0:
score += (tools_correct / tools_total) * 0.25
# 执行完成(25 分)
success = meta.get("subtasks_success", 0)
total = meta.get("subtasks_total", len(subtasks))
if total > 0:
score += (success / total) * 0.25
return min(score, 1.0)
def _score_tool_usage(meta: Dict) -> float:
"""工具使用评分(heuristic)"""
subtasks = meta.get("subtasks", [])
tools_correct = sum(1 for s in subtasks if s.get("tool") in ("code_executor", "calculator", "none", "memory_store"))
tools_total = len([s for s in subtasks if s.get("tool") != "none"])
if tools_total > 0:
return min((tools_correct / tools_total) * 1.0, 1.0)
return 1.0
def _extract_numbers(text: str) -> List[float]:
"""从文本中提取数值,用于合理性粗检"""
nums = []
for m in re.finditer(r"-?\d+(?:\.\d+)?", text or ""):
try:
nums.append(float(m.group()))
except ValueError:
continue
return nums
def _score_coding(meta: Dict, result: Dict, case: Dict) -> float:
"""
代码能力评分:
- 不仅看 code_executor 是否 success
- 额外检查:输出产物路径是否存在、关键数值是否落在合理范围
"""
subtasks = meta.get("subtasks", [])
code_tasks = [s for s in subtasks if s.get("tool") == "code_executor"]
if not code_tasks:
return 0.5
exec_ok = sum(1 for s in code_tasks if s.get("status") == "success") / len(code_tasks)
output = result.get("output", "") or ""
# MVP 阶段:产物校验尚未接入真实断言。
# expect_artifacts 字段已在 test_cases 结构中预留(见下方注释代码),
# 后续用例(如 T-06 趋势图生成)会通过该字段断言产物文件存在性。
# 当前 MVP artifact_ok 固定为 1.0(不拉升、不惩罚)。
#
# 第二阶段接入后的预期逻辑:
# artifact_paths = case.get("expect_artifacts", [])
# if artifact_paths:
# exist = sum(1 for p in artifact_paths if os.path.exists(p))
# artifact_ok = exist / len(artifact_paths)
artifact_ok = 1.0
# 销售额/利润类任务:输出中应出现正数,且不宜出现离谱量级(启发式)
nums = _extract_numbers(output)
value_ok = 0.5
if nums:
positive = [x for x in nums if x > 0]
if positive:
# 样例 CSV 销售额约在 100–10000;允许汇总后更大,但封顶粗检
sane = [x for x in positive if x < 1e9]
value_ok = min(len(sane) / max(len(positive), 1), 1.0)
else:
value_ok = 0.2
elif len(output) >= 50:
value_ok = 0.4 # 有文字但无数字:部分通过
# 执行 50% + 产物 25%(预留) + 数值合理性 25%
return exec_ok * 0.50 + artifact_ok * 0.25 + value_ok * 0.25
def _score_knowledge(result: Dict) -> float:
"""
知识问答评分(heuristic / 辅助分)
命中关键词 ≠ 知识正确(例如「同比错误计算」仍可能拿高分)。
知识维度最终以人工评审或 LLM Judge 为准;此处仅作流水线门禁辅助。
"""
output = result.get("output", "")
keywords = ["同比", "环比", "趋势", "分析", "品类", "销售额"]
matched = sum(1 for kw in keywords if kw in output)
return min(matched / len(keywords), 1.0)
def _detect_defects(result: Dict, case: Dict) -> List[Dict]:
"""检测缺陷"""
defects = []
meta = result.get("_meta", {})
# 规划缺陷
subtasks = meta.get("subtasks", [])
n = len(subtasks)
if n > 10:
defects.append({"type": "规划缺陷", "severity": "Medium", "detail": f"子任务数量 {n} 个,超过 10 个"})
if n < 2:
defects.append({"type": "规划缺陷", "severity": "Low", "detail": f"子任务数量 {n} 个,少于 2 个"})
# 工具缺陷
for s in subtasks:
if s.get("tool") not in ("code_executor", "calculator", "none", "memory_store", "web_fetch", "safety_checker", "search"):
defects.append({"type": "工具缺陷", "severity": "High", "detail": f"未知工具 '{s.get('tool')}'"})
# 执行缺陷
failed = meta.get("subtasks_failed", 0)
if failed > 0:
defects.append({"type": "执行缺陷", "severity": "High", "detail": f"{failed} 个子任务失败"})
# 知识缺陷(长度启发式;正误需人工/LLM)
output = result.get("output", "")
if len(output) < 50:
defects.append({"type": "知识缺陷", "severity": "Medium", "detail": "输出过短,可能分析不完整"})
return defects
def print_test_report(results: List[FullChainTestResult]):
"""打印测试报告"""
print(f"\n{'='*70}")
print(f"数据分析任务完整流程测试报告(MVP)")
print(f"{'='*70}")
# 汇总
total = len(results)
passed = sum(1 for r in results if r.passed)
failed = total - passed
avg_score = sum(r.total_score for r in results) / total if total > 0 else 0
avg_elapsed = sum(r.elapsed for r in results) / total if total > 0 else 0
avg_tokens = sum(r.tokens for r in results) / total if total > 0 else 0
# 缺陷统计
all_defects = []
for r in results:
all_defects.extend(r.defects)
defect_types = {}
for d in all_defects:
t = d["type"]
if t not in defect_types:
defect_types[t] = 0
defect_types[t] += 1
print(f"\n汇总:")
print(f" 总用例: {total}")
print(f" 通过: {passed} ({passed/total:.0%})")
print(f" 失败: {failed} ({failed/total:.0%})")
print(f" 平均得分: {avg_score:.1%}")
print(f" 平均耗时: {avg_elapsed:.1f}s")
print(f" 平均 Token: {avg_tokens:.0f}")
print(f" 缺陷总数: {len(all_defects)}")
if defect_types:
print(f"\n缺陷分布:")
for t, count in defect_types.items():
print(f" {t}: {count} 个")
# 详细结果
print(f"\n详细结果:")
print(f"{'ID':8s} | {'难度':6s} | {'得分':6s} | {'耗时':6s} | {'Token':6s} | {'缺陷数':6s}")
print("-" * 70)
for r in results:
icon = "PASS" if r.passed else "FAIL"
print(f"{r.test_id:8s} | {r.difficulty:6s} | {r.total_score:5.1%} | {r.elapsed:5.1f}s | {r.tokens:6d} | {len(r.defects):6d} {icon}")
# 缺陷详情
if all_defects:
print(f"\n缺陷详情:")
for i, d in enumerate(all_defects[:10], 1):
print(f" {i}. [{d['severity']}] {d['type']}: {d['detail']}")
print(f"{'='*70}\n")
def run_demo():
"""演示:第一阶段 MVP,5 个 CSV 数据分析任务"""
print("=" * 70)
print("数据分析任务完整流程测试演示(MVP:5/10)")
print("=" * 70)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from agents.custom_agent.agent import CustomAgent
# 生成测试 CSV
os.makedirs("/tmp/test_data", exist_ok=True)
generate_test_csv("/tmp/test_data/simple.csv", rows=10, cols=3)
generate_test_csv("/tmp/test_data/medium.csv", rows=1000, cols=5, has_nulls=True)
generate_test_csv("/tmp/test_data/complex.csv", rows=100, cols=5, has_nulls=True)
# 测试用例(与下文实测表任务描述一致)
test_cases = [
{"id": "T-01", "task": "读取 /tmp/test_data/simple.csv,统计各品类的销售额", "difficulty": "简单"},
{"id": "T-02", "task": "读取 /tmp/test_data/medium.csv,按月份统计销售额,计算同比增长率", "difficulty": "中等"},
{"id": "T-03", "task": "读取 /tmp/test_data/complex.csv,分析销售趋势并生成报告", "difficulty": "困难"},
{"id": "T-04", "task": "读取 /tmp/test_data/simple.csv,找出销售额最高的品类", "difficulty": "简单"},
{"id": "T-05", "task": "读取 /tmp/test_data/medium.csv,计算各品类的平均利润", "difficulty": "中等"},
]
# 运行测试
agent = CustomAgent(temperature=0.3)
results = run_full_chain_test(agent, test_cases)
# 打印报告
print_test_report(results)
print("=" * 70)
if __name__ == "__main__":
run_demo()
实测说明:下表来自
scripts/run_article16_csv_chain.py真实跑数(DeepSeek / deepseek-chat / temperature=0.3,2026-07-21)。产物 JSON 见开源包results/20260721_081456/article_runs/。
数据:测试执行结果(MVP:5/10,真实跑数)
关于表格列名的说明:「执行成功」= 所有 subtask 未抛未捕获异常;「门禁通过」= 四维 heuristic 总分 ≥ 60%。两者含义不同,分开统计。
| ID | 难度 | 执行成功 | 门禁通过 | 得分 | 耗时 | Token | 输出长度 | 说明(与脚本任务一致) |
|---|---|---|---|---|---|---|---|---|
| T-01 | 简单 | 是 | 是 | 72.1% | 20.3s | 5356 | 473 字符 | 各品类销售额统计(simple.csv) |
| T-02 | 中等 | 是 | 是 | 69.2% | 43.9s | 13407 | 961 字符 | 按月销售额 + 同比(缺去年同期,Agent 正确声明无法算同比) |
| T-03 | 困难 | 是 | 是 | 68.3% | 50.0s | 14045 | 1418 字符 | 销售趋势分析报告(complex.csv;规划子任务偏多) |
| T-04 | 简单 | 是 | 是 | 64.0% | 25.7s | 7193 | 264 字符 | 找出销售额最高品类(simple.csv) |
| T-05 | 中等 | 是 | 是 | 70.2% | 9.8s | 2365 | 471 字符 | 各品类平均利润(medium.csv) |
测试环境:CustomAgent(规划-执行-反思),DeepSeek
deepseek-chat,temperature=0.3,2026-07-21。安全模块未启用。知识维仍为关键词 heuristic。
汇总:
| 指标 | 值 |
|---|---|
| 总任务数 | 5(MVP;设计全集 10) |
| 执行成功 | 5 |
| 门禁通过(总分≥60%) | 5 |
| 平均得分 | 68.8% |
| 平均耗时 | 29.9s |
| 平均 Token | 8473 |
关键发现:
- MVP 的 5 个 CSV 任务全部执行成功并通过门禁,主路径(读 CSV → 统计/报告)可跑通
- 耗时最短为 T-05(9.8s),最长为困难任务 T-03(50.0s);难度与耗时大致同向,但并非严格正比
- T-02 缺 2023 年数据时,Agent 明确说明无法计算同比,比硬编增长率更可信。需要补充说明的是:MVP 的 T-02 测试数据仅提供 2024 年 12 个月数据,未包含 2023 年基期,因此 Agent 声明「无法算同比」属于合理降级。正式评测应在数据中补齐 2023 年数据,验证 Agent 能否正确计算同比;当前用例设计本身存在数据缺口,不能反推出「Agent 有自我认知能力」
- T-02/T-03 触发「子任务数量过多」规划缺陷(12/18 个),说明复杂分析仍易规划膨胀
- 知识维 heuristic 分偏低(关键词覆盖不全),终裁仍需人工/LLM Judge 核对数值
- 总分均值 68.8% 偏低:主要被知识维 heuristic(关键词命中不完全)和规划维(依赖子分对简单任务的"惩罚")拖累。由于知识维终裁需人工/LLM Judge,实际语义正确率可能高于此分。后续阶段将接入 LLM Judge 做对比验证
交付物
1. 完整测试用例集(设计 10 个 / MVP 实现 5 个)
| ID | 任务 | 难度 | 数据 | 验证方式 | 状态 |
|---|---|---|---|---|---|
| T-01 | 简单 CSV 统计 | 简单 | simple.csv | 自动验证 | MVP 已测 |
| T-02 | 中等 CSV 分析 | 中等 | medium.csv | 自动验证 | MVP 已测 |
| T-03 | 复杂 CSV 报告 | 困难 | complex.csv | 人工验证 | MVP 已测(趋势报告;合并单元格待二期) |
| T-04 | Top N / 最高品类 | 简单 | simple.csv | 自动验证 | MVP 已测 |
| T-05 | 平均利润计算 | 中等 | medium.csv | 自动验证 | MVP 已测 |
| T-06 | 趋势图生成 | 中等 | medium.csv | 自动验证 | 设计中 |
| T-07 | 分析结论 | 中等 | medium.csv | LLM 评分 | 设计中 |
| T-08 | 空 CSV | 简单 | empty.csv | 自动验证 | 设计中 |
| T-09 | 超大 CSV | 困难 | large.csv | 自动验证 | 设计中 |
| T-10 | 编码错误 | 简单 | gbk.csv | 自动验证 | 设计中 |
2. 缺陷记录模板
| 字段 | 说明 |
|---|---|
| ID | 缺陷编号(DEF-001) |
| 类型 | 规划/工具/执行/知识/安全 |
| 严重度 | Critical/High/Medium/Low |
| 用例 | 发现的测试用例 |
| 描述 | 缺陷描述 |
| 根因 | 根因分析 |
| 修复 | 修复方案 |
| 状态 | 新建/修复中/已修复/已验证 |
3. 测试报告模板
| 部分 | 内容 |
|---|---|
| 汇总 | 总用例、通过率、平均得分、平均耗时、平均 Token |
| 维度得分 | 规划、工具、代码、知识各维度得分(标注 heuristic / 人工) |
| 缺陷分布 | 按类型统计缺陷数量 |
| 详细结果 | 每个用例的得分、耗时、Token、缺陷 |
| 缺陷详情 | 每个缺陷的描述、根因、修复方案 |
| 结论 | 是否通过、改进建议;安全模块是否已启用 |
总结
数据分析任务覆盖了智能体的核心能力:规划、工具、代码、知识。
第一阶段流程:准备数据 → 执行智能体 → 多维 heuristic 验证 → 检测缺陷 → 生成报告。第二阶段再补齐边界 CSV、可视化产物断言、LLM Judge 与安全评测。
关键发现:MVP 主路径(5 个 CSV 任务)可稳定跑通;评测分数是「辅助门禁」,不是「语义正确证明」。正式发布结论前,请本地复跑脚本并抽样人工复核数值结论。
下一篇讲多工具组合场景测试。
面试题模块
Q1:一个"数据分析"类任务的完整流程测试需要包含哪些环节?
A:四个环节:1) 数据获取——Agent 能否正确调用数据查询工具(SQL/API/读文件);2) 数据处理——能否正确清洗和聚合数据;3) 分析推理——能否从数据中提取正确结论;4) 结果呈现——能否以清晰的方式输出。任何一个环节失败都会导致整体任务失败。
Q2:完整流程测试中,最容易出问题的环节是哪个?
A:数据处理与「数值结论」环节。LLM 生成的查询/聚合代码常有逻辑错误(分组字段错、分母为零、同比基期选错)。工具选择和长文总结往往表面好看,但中间算错会一路污染报告。
Q3:完整流程测试的数据准备需要什么?
A:需要两套数据:1) 测试数据——注入到测试库/文件/Mock 中的确定值(如"2024年6月华东区销售额=100万");2) 预期结果——每个关键步骤的可断言输出(如聚合 Totals、文件是否生成)。没有预期结果就只能做「没抛异常」式演示,算不上严格自动化断言。
Q4(进阶):如何判断 Agent 是「真的在分析」,还是「在编故事」?
A:至少三层:1) 产物校验——CSV 是否被读到、中间表/图文件是否存在;2) 数值锚定——用固定种子或金标 CSV,断言关键数字落在容差内(同比公式、Top1 品类名);3) 反事实探针——故意改一行金标数据,看报告是否跟着变;若文案仍写旧结论,多半是在编故事。关键词命中只能当粗滤,不能当终裁。
Q5(进阶):为什么「困难」任务成功率 100%、耗时还不更长,不代表难度标错了?
A:难度描述的是任务结构与数据风险(步骤数、格式破坏、是否要图/长结论),成功率与耗时描述的是某次模型路径是否走运。一次全绿只能说明主路径可走通,不能证明边界与对抗已覆盖;要把难度和结果绑死,需要按难度档分别统计失败模式,而不是看平均耗时。
更多推荐

所有评论(0)