Skip to content

test : add unit tests for _fingerprint_score in finding_intelligence #1727

Description

@tmdeveloper007

Summary of What Needs to be Done:
backend/secuscan/finding_intelligence.py contains the _fingerprint_score function which computes a deduplication fingerprint from a finding. The existing test files (test_finding_intelligence.py, test_finding_intelligence_asset_ref.py, test_finding_intelligence_dedupe.py, etc.) do not cover _fingerprint_score. This function is used for deduplication of findings.

Changes that Need to be Made:
Add tests to an appropriate existing test file (or new test_finding_intelligence_fingerprint.py) covering:

  • Returns a tuple of (float score, str reason)
  • Score is deterministic for same finding inputs
  • Score changes when severity changes
  • Score changes when asset_ref changes
  • Score changes when target changes
  • Empty/None finding fields are handled gracefully
  • Different sources produce different scores

Impact that it would Provide:

  • Coverage: adds tests for an untested deduplication helper
  • Reliability: prevents fingerprint score computation regressions
  • Complements existing dedupe tests (test_finding_intelligence_dedupe.py)

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

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions