Skip to content

Require explicit data input in IQBCalculator and remove implicit fallback sample #166

@sanskar0627

Description

@sanskar0627

IQBCalculator.calculate_iqb_score currently accepts data=None and silently falls back to an internal sample dataset. This hides
missing-input errors and allows scores to be generated from placeholder data without the caller realizing it. The code already flags this as technical debt via a TODO to remove the default sample.


Problem

  • Calling calculate_iqb_score() without real measurement data still returns a score
  • Integration bugs can pass unnoticed
  • Results may be generated from fake/default values
  • The method contract is misleading: data appears optional, but meaningful scoring requires real input

Expected Behavior

  • calculate_iqb_score requires explicit input data
  • No internal fallback sample is used
  • Callers and tests must pass real sample fixtures

Proposed Change

  • Make data a required parameter in the method signature
  • Remove the internal sample dictionary fallback
  • Update all affected tests that currently call the method without data
  • Leave print_details behavior unchanged (out of scope)

Why This Matters

  • Enforces explicit API usage
  • Prevents accidental scoring with placeholder data
  • Surfaces integration errors early
  • Improves correctness and reliability

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions