Project

General

Profile

Actions

Task #3558

closed

ndnpeek: add unit testing

Added by Junxiao Shi over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
04/12/2016
Due date:
% Done:

100%

Estimated time:
4.00 h

Description

Add unit testing for ndnpeek program.
Refactor this programs as necessary.


Related issues 1 (0 open1 closed)

Related to ndn-tools - Task #3740: ndnpoke: add unit testingClosedEric Newberry

Actions
Actions #1

Updated by Teng Liang over 8 years ago

  • Assignee set to Teng Liang
Actions #2

Updated by Junxiao Shi over 8 years ago

  • Assignee changed from Teng Liang to Zhuo Li

Beichuan decides to reassign this to @Zhuo.

I do not know how to proceed with this task, but the structure of ndnping and ndnpingserver programs is a good reference.
@Davide suggested to convert this tool to be unit-testable so he may have better ideas.

Actions #3

Updated by Davide Pesavento over 8 years ago

chunks has a pretty decent unit test suite. In particular, pipeline-interests.t.cpp might be of interest.

Actions #4

Updated by Zhuo Li over 8 years ago

  • Start date set to 04/12/2016
  • % Done changed from 0 to 30
Actions #5

Updated by Zhuo Li over 8 years ago

Davide Pesavento wrote:

chunks has a pretty decent unit test suite. In particular, pipeline-interests.t.cpp might be of interest.

I don't quite understand what we should test. Would you be more specific? @Davide

Actions #6

Updated by Zhuo Li over 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 30 to 90
Actions #7

Updated by Zhuo Li over 8 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 90 to 100
Actions #8

Updated by Junxiao Shi over 8 years ago

I suggest having at least these test cases:

  • express an Interest, and receive a Data
  • express an Interest, and receive a Nack with reason code
  • express an Interest, and receive a Nack without reason code
  • express an Interest with default InterestLifetime and not specifying timeout, and receive nothing
  • express an Interest with specified InterestLifetime and a timeout less than InterestLifetime, and receive nothing
  • express an Interest with specified InterestLifetime and a timeout greater than InterestLifetime, and receive nothing
Actions #9

Updated by Junxiao Shi over 8 years ago

  • Subject changed from peek/poke: add unit testing to ndnpeek: add unit testing
  • Description updated (diff)

I've split ndnpoke to another issue #3740 to be completed separately.

Actions #10

Updated by Junxiao Shi over 8 years ago

  • Related to Task #3740: ndnpoke: add unit testing added
Actions #11

Updated by Davide Pesavento over 8 years ago

I agree with note-8

Actions #12

Updated by Junxiao Shi over 8 years ago

The first four items in note-8 also need to be tested both with and without "payload only" option.

Actions #13

Updated by Davide Pesavento over 8 years ago

Junxiao Shi wrote:

The first four items in note-8 also need to be tested both with and without "payload only" option.

I don't think we need to test all possible combinations, or we'd have an exponential number of test cases. It's true that we need to test the "payload only" option, but I think limiting it to the first two cases (Data and Nack with reason) will be enough.

Of course the above list represents the minimal set of test cases. If the assignee wants to add more, that's even better.

Actions #14

Updated by Zhuo Li over 8 years ago

Junxiao Shi wrote:

I suggest having at least these test cases:

  • express an Interest, and receive a Data
  • express an Interest, and receive a Nack with reason code
  • express an Interest, and receive a Nack without reason code
  • express an Interest with default InterestLifetime and not specifying timeout, and receive nothing
  • express an Interest with specified InterestLifetime and a timeout less than InterestLifetime, and receive nothing
  • express an Interest with specified InterestLifetime and a timeout greater than InterestLifetime, and receive nothing

Can you give me some examples of these test? Do I have to use the UnitTestTimeFixture? Please give me some advices.

Actions #15

Updated by Junxiao Shi over 8 years ago

UnitTestTimeFixture and DummyClientFace are needed for those tests.

The closest examples I can think about are:

All those are significantly more complicated than what you'll need to write.

Actions #16

Updated by Davide Pesavento about 8 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF