test : add unit tests for _business_criticality_factor in risk_scoring

Abierto
#2,261 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

  • #2266 de @tmdeveloper007 — cerrado sin fusionar

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
security, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
36
Forks
234
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de utksh1/SecuScan

Todos los issues de utksh1/SecuScan

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.