test : add edge case tests for _build_prompt in ai_summary

Đang mở
#2,326 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

@tmdeveloper007 đang làm issue này rồi.

Từ ngày 3/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Summary of What Needs to be Done:
The _build_prompt function in backend/secuscan/ai_summary.py is tested in test_ai_summary.py but lacks coverage for edge cases like all-info findings, duplicate categories, missing titles, and alternative field names.

Changes that Need to be Made:

  • Add a new test file: testing/backend/unit/test_ai_summary_build_prompt_edge_cases.py
  • Test with only info/low severity findings (no critical/high in top findings)
  • Test with all five severity levels present
  • Test with duplicate categories (counted correctly)
  • Test with findings that have unrecognized/missing category
  • Test with empty title and None title fields
  • Test with mixed-case severity strings (normalized)
  • Test with 'name' field instead of 'title'
  • Test with 'check' field instead of 'title'

Impact that it would Provide:

  • Reliability: Prompt building handles unusual finding shapes without crashing
  • Maintainability: Ensures LLM prompts are consistent across all finding formats
  • Testing coverage: Complements existing ai_summary tests with edge cases

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

Ngôn ngữ chính
Python
Star
36
Fork
234
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của utksh1/SecuScan

Tất cả issue của utksh1/SecuScan

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.