Skip to content

test : add unit tests for build_scan_diff in finding_intelligence #1728

Description

@tmdeveloper007

Summary of What Needs to be Done:
backend/secuscan/finding_intelligence.py contains the build_scan_diff function which computes a diff between current and previous scan findings. The existing test files do not cover this function. It identifies newly added findings, removed findings (present in previous but not current), and unchanged findings.

Changes that Need to be Made:
Add tests to an appropriate existing test file covering:

  • build_scan_diff returns correct added, removed, unchanged sets for two finding lists
  • Empty current and previous lists returns empty diff
  • Findings identified by their signature (issue_signature)
  • Only findings with the same signature are matched between lists
  • Added findings are those in current but not previous
  • Removed findings are those in previous but not current
  • Unchanged findings appear in both lists with same signature

Impact that it would Provide:

  • Coverage: adds tests for a function that has no test coverage
  • Reliability: build_scan_diff is used for reporting scan deltas to users
  • Complements existing finding intelligence tests

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions