test : add unit tests for _business_criticality_factor in risk_scoring

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

Chưa có ai nhận issue này.

  • #2266 của @tmdeveloper007 — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
security, testing

Hướng nghiên cứu

Read backend/secuscan/risk_scoring.py and inspect CRITICALITY_MAP and _business_criticality_factor, then review nearby tests under testing/backend/unit/. Add testing/backend/unit/test_risk_scoring_criticality_factor.py for known mappings, defaults, and case-insensitive input. Run the new unit test file and confirm each listed behavior passes. The issue names tmdeveloper007 as handling the task and links a closed pull request, so check the current status before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary of What Needs to be Done:
Write unit tests for _business_criticality_factor in backend/secuscan/risk_scoring.py. This private function maps business criticality strings to multiplier floats used in contextual risk scoring. It is currently only exercised indirectly through compute_risk_score but has no dedicated tests for its mapping behavior.

Changes that Need to be Made:
Create a new file: testing/backend/unit/test_risk_scoring_criticality_factor.py

Import _business_criticality_factor from backend.secuscan.risk_scoring and test:

  • Known criticality levels return correct multipliers
  • None input returns 1.0 (default)
  • Unknown criticality returns 1.0 (default)
  • Empty string returns 1.0 (default)
  • Case insensitivity of input

Impact that it would Provide:
Direct tests catch regressions if CRITICALITY_MAP is modified. Tests the default fallback behavior which is critical for stability when encountering unexpected criticality values in production data.

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.