Project

General

Profile

Actions

Task #3305

closed

UnixStreamTransport: test suite improvement

Added by Junxiao Shi about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Faces
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Improve UnixStreamTransport test suite with new test cases:

  • send
  • receive normal
  • receive malformed
  • close from transport
  • close from peer socket

Related issues 3 (0 open3 closed)

Related to NFD - Task #3306: TcpTransport: test suite improvementClosedEric Newberry

Actions
Blocked by NFD - Feature #3165: UnixStreamTransportClosedYukai Tu

Actions
Blocks NFD - Task #3172: Refactor Face: completionClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi about 9 years ago

Actions #2

Updated by Junxiao Shi about 9 years ago

  • Blocks Task #3172: Refactor Face: completion added
Actions #3

Updated by Davide Pesavento about 9 years ago

Junxiao Shi wrote:

  • send
  • receive normal
  • receive malformed

The send and receive paths of TcpTransport and UnixStreamTransport are completely identical (they're implemented in StreamTransport), so there's no point in duplicating these tests for both transports. As a minimum, the checks should be abstracted into a common implementation.

  • check counters after send and receive

Unless the subclass extends the counters with transport-specific ones (not the case here), incrementing counters is the responsibility of the base class Transport. Testing all subclasses makes no sense.

  • close from transport
  • close from peer socket

Same comment as send/receive.

Actions #4

Updated by Junxiao Shi about 9 years ago

  • Related to Task #3306: TcpTransport: test suite improvement added
Actions #5

Updated by Junxiao Shi about 9 years ago

The send and receive paths of TcpTransport and UnixStreamTransport are completely identical (they're implemented in StreamTransport), so there's no point in duplicating these tests for both transports. As a minimum, the checks should be abstracted into a common implementation.

It's necessary to test both TcpTransport and UnixStreamTransport, because the usage of a StreamTransport class template is an implementation choice.

Yes, they can be tested with a test suite template.

Unless the subclass extends the counters with transport-specific ones (not the case here), incrementing counters is the responsibility of the base class Transport. Testing all subclasses makes no sense.

It's necessary to test all transports, because having the Transport base class incrementing counters is an implementation choice.

Actions #6

Updated by Davide Pesavento about 9 years ago

Junxiao Shi wrote:

It's necessary to test all transports, because having the Transport base class incrementing counters is an implementation choice.

This is not how (our) unit testing works. Are you suggesting we should do black-box testing everywhere? Then also the fact that a Face is a Transport + a LinkService, and many other assumptions, are implementation choices.

Actions #7

Updated by Junxiao Shi about 9 years ago

  • Description updated (diff)
Actions #8

Updated by Junxiao Shi about 9 years ago

  • Assignee set to Eric Newberry
Actions #9

Updated by Eric Newberry about 9 years ago

  • Status changed from New to In Progress
Actions #10

Updated by Eric Newberry about 9 years ago

  • Status changed from In Progress to Code review
Actions #11

Updated by Junxiao Shi about 9 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF