Project

General

Profile

Task #3558

ndnpeek: add unit testing

Added by Junxiao Shi over 4 years ago. Updated almost 4 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

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

Actions
#1

Updated by Teng Liang over 4 years ago

  • Assignee set to Teng Liang
#2

Updated by Junxiao Shi over 4 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.

#3

Updated by Davide Pesavento over 4 years ago

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

#4

Updated by Zhuo Li about 4 years ago

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

Updated by Zhuo Li about 4 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

#6

Updated by Zhuo Li about 4 years ago

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

Updated by Zhuo Li about 4 years ago

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

Updated by Junxiao Shi almost 4 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
#9

Updated by Junxiao Shi almost 4 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.

#10

Updated by Junxiao Shi almost 4 years ago

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

Updated by Davide Pesavento almost 4 years ago

I agree with note-8

#12

Updated by Junxiao Shi almost 4 years ago

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

#13

Updated by Davide Pesavento almost 4 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.

#14

Updated by Zhuo Li almost 4 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.

#15

Updated by Junxiao Shi almost 4 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.

#16

Updated by Davide Pesavento almost 4 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF