[ { "id": "TC-045", "type": "positive", "input": { "method": "API", "params": { "part": "snippet,statistics,contentDetails", "chart": "mostPopular", "maxResults": 50, "regionCode": "US" } }, "expected": { "videos": [ { "video_id": "string", "title": "string", "channel_id": "string", "channel_title": "string", "published_at": "ISO8601", "view_count": "number", "category_id": "string", "description": "string", "thumbnail_url": "string", "tags": "array", "like_count": "number", "comment_count": "number", "duration": "ISO8601", "source_url": "string", "crawl_time": "ISO8601" } ] }, "dimensions": { "功能完整性": 98, "API规范使用": 95, "数据完整性与准确性": 95, "代码质量与可维护性": 92, "错误处理与降级策略": 88, "扩展性与配置灵活性": 90, "性能与效率": 88 }, "note": "完整实现:9个必填+4个可选字段全部覆盖", "total_score": 93 }, { "id": "TC-046", "type": "positive", "input": { "method": "API+yt-dlp+Invidious", "fallback_chain": [ "api", "ytdlp", "invidious" ], "api_fail": true, "ytdlp_fail": true }, "expected": { "videos": [ { "video_id": "string", "title": "string" } ], "source": "invidious", "fallback_level": 3 }, "dimensions": { "功能完整性": 88, "API规范使用": 85, "数据完整性与准确性": 85, "代码质量与可维护性": 92, "错误处理与降级策略": 98, "扩展性与配置灵活性": 88, "性能与效率": 82 }, "note": "三级降级链完全生效:API失败→yt-dlp失败→Invidious成功", "total_score": 89 }, { "id": "TC-047", "type": "positive", "input": { "method": "API", "batch_all_categories": [ "10", "20", "24", "28" ], "region": "US" }, "expected": { "results": { "10": "array", "20": "array", "24": "array", "28": "array" }, "total_videos": 200 }, "dimensions": { "功能完整性": 95, "API规范使用": 92, "数据完整性与准确性": 90, "代码质量与可维护性": 90, "错误处理与降级策略": 85, "扩展性与配置灵活性": 95, "性能与效率": 88 }, "note": "批量请求全部4个目标分类,扩展性极佳", "total_score": 91 }, { "id": "TC-048", "type": "positive", "input": { "method": "API", "output_format": "csv", "csv_delimiter": ",", "include_headers": true }, "expected": { "csv": "video_id,title,view_count,...\\nxxx,..." }, "dimensions": { "功能完整性": 92, "API规范使用": 90, "数据完整性与准确性": 90, "代码质量与可维护性": 88, "错误处理与降级策略": 80, "扩展性与配置灵活性": 95, "性能与效率": 85 }, "note": "CSV输出格式正确,包含表头", "total_score": 89 }, { "id": "TC-049", "type": "positive", "input": { "method": "API", "enrichment": { "return_youtube_dislike": true }, "videoId": "xxx" }, "expected": { "videos": [ { "video_id": "string", "like_count": 12345, "dislike_count": 678, "rating": 4.5 } ] }, "dimensions": { "功能完整性": 90, "API规范使用": 88, "数据完整性与准确性": 92, "代码质量与可维护性": 88, "错误处理与降级策略": 82, "扩展性与配置灵活性": 88, "性能与效率": 82 }, "note": "Return YouTube Dislike数据增强成功", "total_score": 88 }, { "id": "TC-050", "type": "negative", "input": { "method": "API", "url_concat_wrong": "https://youtube.com/v/{id}" }, "expected": { "videos": [ { "source_url": "https://youtube.com/v/xxx", "valid": false } ] }, "dimensions": { "功能完整性": 70, "API规范使用": 65, "数据完整性与准确性": 45, "代码质量与可维护性": 50, "错误处理与降级策略": 55, "扩展性与配置灵活性": 55, "性能与效率": 55 }, "note": "错误:source_url拼接错误,应为https://www.youtube.com/watch?v=", "total_score": 57 }, { "id": "TC-051", "type": "negative", "input": { "method": "API", "no_timeout": true, "network_hang": true }, "expected": { "error": "infinite_wait", "crash": true }, "dimensions": { "功能完整性": 45, "API规范使用": 45, "数据完整性与准确性": 45, "代码质量与可维护性": 25, "错误处理与降级策略": 35, "扩展性与配置灵活性": 45, "性能与效率": 35 }, "note": "错误:HTTP请求无超时设置,网络异常时阻塞无限期", "total_score": 40 }, { "id": "TC-052", "type": "negative", "input": { "method": "selenium", "headless_no_stealth": true }, "expected": { "error": "bot_detected", "captcha_triggered": true }, "dimensions": { "功能完整性": 45, "API规范使用": 0, "数据完整性与准确性": 55, "代码质量与可维护性": 35, "错误处理与降级策略": 20, "扩展性与配置灵活性": 45, "性能与效率": 25 }, "note": "错误:Selenium无stealth模式,被Bot检测触发验证码", "total_score": 34 }, { "id": "TC-053", "type": "negative", "input": { "method": "API", "publishedAt_format": "raw_string", "no_iso_parse": true }, "expected": { "videos": [ { "published_at": "2024-01-15T10:00:00Z", "parsed": false } ] }, "dimensions": { "功能完整性": 70, "API规范使用": 65, "数据完整性与准确性": 55, "代码质量与可维护性": 55, "错误处理与降级策略": 50, "扩展性与配置灵活性": 55, "性能与效率": 55 }, "note": "错误:published_at和crawl_time未统一为ISO8601格式", "total_score": 59 }, { "id": "TC-054", "type": "negative", "input": { "method": "API", "maxResults": 100 }, "expected": { "error": "400", "valid_range": "1-50" }, "dimensions": { "功能完整性": 45, "API规范使用": 35, "数据完整性与准确性": 45, "代码质量与可维护性": 45, "错误处理与降级策略": 45, "扩展性与配置灵活性": 45, "性能与效率": 45 }, "note": "错误:maxResults=100超出API限制(最大50)", "total_score": 44 }, { "id": "TC-055", "type": "boundary", "input": { "method": "API", "maxResults": 1, "regionCode": "KR", "videoCategoryId": "20" }, "expected": { "videos_count": 1, "videos": [ { "video_id": "string", "title": "string" } ] }, "dimensions": { "功能完整性": 88, "API规范使用": 90, "数据完整性与准确性": 88, "代码质量与可维护性": 85, "错误处理与降级策略": 78, "扩展性与配置灵活性": 88, "性能与效率": 80 }, "note": "边界:最小结果集maxResults=1+地区分类参数", "total_score": 86 }, { "id": "TC-056", "type": "boundary", "input": { "method": "API", "status_429": true, "retry_after": 5 }, "expected": { "videos": [ { "video_id": "string" } ], "retry_count": 1, "source": "api", "backoff_seconds": 5 }, "dimensions": { "功能完整性": 82, "API规范使用": 82, "数据完整性与准确性": 82, "代码质量与可维护性": 90, "错误处理与降级策略": 94, "扩展性与配置灵活性": 72, "性能与效率": 78 }, "note": "边界:429限流触发一次退避后成功恢复", "total_score": 84 }, { "id": "TC-057", "type": "boundary", "input": { "method": "API", "status_503": true, "service_unavailable": true }, "expected": { "videos": [ { "video_id": "string" } ], "retry_count": 2, "source": "api" }, "dimensions": { "功能完整性": 82, "API规范使用": 82, "数据完整性与准确性": 82, "代码质量与可维护性": 90, "错误处理与降级策略": 92, "扩展性与配置灵活性": 72, "性能与效率": 78 }, "note": "边界:503服务不可用触发两次指数退避后成功", "total_score": 84 }, { "id": "TC-058", "type": "boundary", "input": { "method": "yt-dlp", "blocked": true }, "expected": { "videos": [ { "video_id": "string", "title": "string" } ], "source": "invidious", "fallback_level": 2 }, "dimensions": { "功能完整性": 82, "API规范使用": 0, "数据完整性与准确性": 82, "代码质量与可维护性": 88, "错误处理与降级策略": 94, "扩展性与配置灵活性": 78, "性能与效率": 75 }, "note": "边界:yt-dlp被屏蔽后降级到Invidious成功", "total_score": 72 }, { "id": "TC-059", "type": "boundary", "input": { "method": "API", "partial_statistics": true, "viewCount_missing": true }, "expected": { "videos": [ { "video_id": "string", "title": "string", "view_count": null, "like_count": 1234 } ] }, "dimensions": { "功能完整性": 72, "API规范使用": 78, "数据完整性与准确性": 70, "代码质量与可维护性": 82, "错误处理与降级策略": 72, "扩展性与配置灵活性": 65, "性能与效率": 65 }, "note": "边界:API返回部分statistics缺失时的兜底处理", "total_score": 73 } ]