Skip to content

Mutation testing: untested public accessor survivors #598

Description

@leynos

Context

From the first complete full mutation-testing run (ADR-007 shared workflow, run 29074771985, 2026-07-10, main @ 94a5d44). A cluster of public accessors and trait methods is never asserted directly, so each can be replaced with a constant.

Surviving mutants

  • src/app/builder/protocol.rs:89replace WireframeApp::protocol -> Option<Arc<dyn WireframeProtocol>> with None
  • src/app/builder/protocol.rs:131replace WireframeApp::message_assembler -> Option<&Arc<dyn MessageAssembler>> with None
  • src/codec.rs:284replace <impl FrameCodec for LengthDelimitedFrameCodec>::max_frame_length -> usize with 0 / 1
  • src/middleware.rs:56replace ServiceRequest::frame -> &[u8] with Vec::leak(...) (three variants)
  • src/serializer.rs:147replace should_deserialize_after_parse -> bool with true
  • src/extractor/request.rs:144replace MessageRequest::take_body_stream -> Option<RequestBodyStream> with None

Analysis

protocol() has zero callers (protocol_hooks() reads the field directly); message_assembler() is covered only by a doctest and BDD steps outside the mutation run's test scope. The only max_frame_length assertion resolves to the inherent method at codec.rs:125, which shadows the trait impl. ServiceRequest::frame has zero callers (services use into_inner or frame_mut). should_deserialize_after_parse is consumed at inbound_handler.rs:80 but never asserted. take_body_stream's only caller, StreamingBody::from_message_request, is itself untested — tests construct StreamingBody::new directly.

Suggested tests / deletions

  1. with_protocol(...) then assert protocol().is_some(); assert a bare builder returns None. Likewise a plain unit test for message_assembler().
  2. Assert max_frame_length via trait dispatch (UFCS or a generic function bound on FrameCodec) equals the configured length.
  3. Assert ServiceRequest::new(vec![1, 2, 3], None).frame() == &[1, 2, 3] — or delete the unused accessor.
  4. Assert !BincodeSerializer::default().should_deserialize_after_parse().
  5. set_body_stream on a MessageRequest, then assert the first take_body_stream() returns Some and the second None (or drive StreamingBody::from_message_request).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmediumCould be disruptive, but might not happentesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions