Task #3558
closedndnpeek: add unit testing
100%
Description
Add unit testing for ndnpeek
program.
Refactor this programs as necessary.
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.
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.
Updated by Zhuo Li over 8 years ago
- Start date set to 04/12/2016
- % Done changed from 0 to 30
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
Updated by Zhuo Li over 8 years ago
- Status changed from New to In Progress
- % Done changed from 30 to 90
Updated by Zhuo Li over 8 years ago
- Status changed from In Progress to Code review
- % Done changed from 90 to 100
Updated by Junxiao Shi about 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
Updated by Junxiao Shi about 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.
Updated by Junxiao Shi about 8 years ago
- Related to Task #3740: ndnpoke: add unit testing added
Updated by Junxiao Shi about 8 years ago
The first four items in note-8 also need to be tested both with and without "payload only" option.
Updated by Davide Pesavento about 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.
Updated by Zhuo Li about 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.
Updated by Junxiao Shi about 8 years ago
UnitTestTimeFixture
and DummyClientFace
are needed for those tests.
The closest examples I can think about are:
- ndn-cxx TestFace/ExpressInterestData
- ndn-cxx Util/TestNotificationSubscriber/Timeout
All those are significantly more complicated than what you'll need to write.
Updated by Davide Pesavento about 8 years ago
- Status changed from Code review to Closed