Skip to content

pdd bug generates structural tests (param existence checks) instead of behavioral tests #507

@Serhan-Asad

Description

@Serhan-Asad

Description

When running pdd bug on issue #486 (--quiet flag not suppressing output), the generated tests checked whether functions accept a quiet parameter (assert "quiet" in sig.parameters) instead of testing whether quiet mode actually suppresses output.

This allowed a fix to pass all tests by simply adding quiet=False parameters to function signatures — without implementing any suppression logic.

Steps to Reproduce

  1. Run pdd bug https://github.com/promptdriven/pdd/issues/486
  2. Observe generated tests in tests/test_quiet_mode.py

Expected Behavior

Generated tests should verify behavior, e.g.:

def test_preprocess_suppresses_panels_when_quiet(self):
    with patch("pdd.preprocess.console") as mock_console:
        preprocess("Hello world", quiet=True)
        for c in mock_console.print.call_args_list:
            assert "Starting prompt preprocessing" not in str(c)

Actual Behavior

Generated tests only verify structure, e.g.:

def test_preprocess_suppresses_panels_when_quiet(self):
    import inspect
    sig = inspect.signature(preprocess)
    assert "quiet" in sig.parameters  # passes without real implementation

Impact

  • Round 1 fix passed all tests but pdd --quiet generate still emitted INFO logs, Rich panels, cloud fallback messages
  • Required manual test rewrite (Round 2) to get a working fix
  • 5 of 7 generated tests were structural, not behavioral

Root Cause (hypothesis)

The test plan (Step 6) described correct behavioral tests, but test code generation (Step 7) simplified them to signature checks — possibly because generating mock-based behavioral tests requires more context about the function's internal output mechanisms.

Environment

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