diff --git a/tests/daemon/fw/access-strategy.t.cpp b/tests/daemon/fw/access-strategy.t.cpp
index d950fc2..afa73b6 100644
--- a/tests/daemon/fw/access-strategy.t.cpp
+++ b/tests/daemon/fw/access-strategy.t.cpp
@@ -32,10 +32,8 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<AccessStrategy> AccessStrategyTester;
+using AccessStrategyTester = StrategyTester<AccessStrategy>;
 NFD_REGISTER_STRATEGY(AccessStrategyTester);
 
 // This test suite tests AccessStrategy's behavior as a black box,
@@ -73,8 +71,8 @@
 
     topo.setStrategy<fw::AccessStrategy>(router);
 
-    linkA = topo.addLink("RA", time::milliseconds(10), {router, laptopA});
-    linkB = topo.addLink("RB", time::milliseconds(20), {router, laptopB});
+    linkA = topo.addLink("RA", 10_ms, {router, laptopA});
+    linkB = topo.addLink("RB", 20_ms, {router, laptopB});
   }
 
 protected:
@@ -124,10 +122,9 @@
   topo.addEchoProducer(producer->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/A",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/A", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied, and few Interests can go to wrong laptop
   BOOST_CHECK_GE(consumer->getForwarderFace().getCounters().nOutData, 97);
@@ -171,10 +168,9 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/BOTH",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/BOTH", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied, and few Interests can go to slower laptopB
   BOOST_CHECK_GE(consumer->getForwarderFace().getCounters().nOutData, 97);
@@ -218,12 +214,11 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/M",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/M", 100_ms, 100);
 
   // producer is initially on laptopA
   producerB->fail();
-  this->advanceClocks(time::milliseconds(5), time::seconds(6));
+  this->advanceClocks(5_ms, 6_s);
 
   // few Interests can go to laptopB
   BOOST_CHECK_LE(linkB->getFace(router).getCounters().nOutInterests, 5);
@@ -232,7 +227,7 @@
   producerA->fail();
   producerB->recover();
   PacketCounter::rep nInterestsToA_beforeMove = linkA->getFace(router).getCounters().nOutInterests;
-  this->advanceClocks(time::milliseconds(5), time::seconds(6));
+  this->advanceClocks(5_ms, 6_s);
 
   // few additional Interests can go to laptopA
   BOOST_CHECK_LE(linkA->getFace(router).getCounters().nOutInterests - nInterestsToA_beforeMove, 5);
@@ -274,13 +269,11 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumerAB = topo.addAppFace("cAB", laptopA);
-  topo.addIntervalConsumer(consumerAB->getClientFace(), "ndn:/laptops/B",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumerAB->getClientFace(), "ndn:/laptops/B", 100_ms, 100);
   shared_ptr<TopologyAppLink> consumerBA = topo.addAppFace("cBA", laptopB);
-  topo.addIntervalConsumer(consumerBA->getClientFace(), "ndn:/laptops/A",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumerBA->getClientFace(), "ndn:/laptops/A", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied
   BOOST_CHECK_GE(consumerAB->getForwarderFace().getCounters().nOutData, 97);
@@ -324,7 +317,7 @@
   consumer->getClientFace().expressInterest(*interest1,
                                             bind([&hasData1] { hasData1 = true; }),
                                             nullptr, nullptr);
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData1, true);
 
   // Interest 2 experiences a packet loss on initial transmission
@@ -335,7 +328,7 @@
                                             nullptr,
                                             bind([&hasTimeout2a] { hasTimeout2a = true; }));
   producerA->fail();
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(60));
+  this->advanceClocks(5_ms, 60_ms);
   BOOST_CHECK_EQUAL(hasData2a, false);
   BOOST_CHECK_EQUAL(hasTimeout2a, false);
 
@@ -346,7 +339,7 @@
                                             bind([&hasData2b] { hasData2b = true; }),
                                             nullptr, nullptr);
   producerA->recover();
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData2b, false);
 
   // Interest 2 retransmission gets through, and is answered
@@ -355,7 +348,7 @@
   consumer->getClientFace().expressInterest(*interest2c,
                                             bind([&hasData2c] { hasData2c = true; }),
                                             nullptr, nullptr);
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData2c, true);
 }
 
@@ -367,10 +360,9 @@
 
   // send Interests from laptopA to router
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", laptopA);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/net",
-                           time::milliseconds(100), 10);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/net", 100_ms, 10);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(2));
+  this->advanceClocks(5_ms, 2_s);
 
   // Interest shouldn't loop back from router
   BOOST_CHECK_EQUAL(linkA->getFace(router).getCounters().nOutInterests, 0);
diff --git a/tests/daemon/fw/ad-hoc-forwarding.t.cpp b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
index 5ef50cf..7ec07c7 100644
--- a/tests/daemon/fw/ad-hoc-forwarding.t.cpp
+++ b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
@@ -42,8 +42,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class AdHocForwardingFixture : public GlobalIoTimeFixture
 {
@@ -58,7 +56,7 @@
       topo.setStrategy<S>(node);
     }
 
-    auto wireless = topo.addLink("ABC", time::milliseconds(10), {nodeA, nodeB, nodeC},
+    auto wireless = topo.addLink("ABC", 10_ms, {nodeA, nodeB, nodeC},
                                  ndn::nfd::LINK_TYPE_AD_HOC);
     wireless->block(nodeA, nodeC);
     wireless->block(nodeC, nodeA);
@@ -103,8 +101,8 @@
   // B should relay Interest/Data between A and C.
 
   this->topo.registerPrefix(this->nodeB, *this->faceB, "/P");
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 10);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(1200));
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 10);
+  this->advanceClocks(5_ms, 1200_ms);
 
   // Consumer should receive Data, and B should be relaying.
   BOOST_CHECK_EQUAL(this->faceB->getCounters().nInInterests, 10);
@@ -127,17 +125,17 @@
   // B's first nexthop is D, but B-D link has failed, so B should relay Interest/Data between A and C.
 
   TopologyNode nodeD = this->topo.addForwarder("D");
-  shared_ptr<TopologyLink> linkBD = this->topo.addLink("BD", time::milliseconds(5), {this->nodeB, nodeD});
+  shared_ptr<TopologyLink> linkBD = this->topo.addLink("BD", 5_ms, {this->nodeB, nodeD});
   this->topo.registerPrefix(this->nodeB, linkBD->getFace(this->nodeB), "/P", 5);
   linkBD->fail();
   this->topo.registerPrefix(this->nodeB, *this->faceB, "/P", 10);
 
   // Two interval consumers are expressing Interests with same name 40ms apart,
   // so that Interests from the second interval consumer are considered retransmission.
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 50, 1);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(40));
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 50, 1);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(5400));
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 40_ms);
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 5400_ms);
 
   // Consumer should receive Data, and B should be relaying at least some Interest/Data.
   BOOST_CHECK_GE(this->faceB->getCounters().nInInterests, 50);
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index cb32efc..96284f3 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -216,7 +216,7 @@
   time::steady_clock::TimePoint before = time::steady_clock::now();
 
   entry.insertOrUpdateOutRecord(*face1, 0, *interest);
-  this->advanceClocks(time::milliseconds(1000));
+  this->advanceClocks(1_s);
 
   BOOST_CHECK_EQUAL(getLastOutgoing(entry), before);
 
diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
index a5fee3f..d08f761 100644
--- a/tests/daemon/fw/asf-measurements.t.cpp
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -50,7 +50,7 @@
   BOOST_CHECK_EQUAL(stats.getSrtt(), RttStats::RTT_NO_MEASUREMENT);
 
   // Receive Data back in 50ms
-  RttEstimator::Duration rtt(time::milliseconds(50));
+  RttEstimator::Duration rtt(50_ms);
   stats.addRttMeasurement(rtt);
 
   BOOST_CHECK_EQUAL(stats.getRtt(), rtt);
@@ -63,7 +63,7 @@
   BOOST_CHECK_EQUAL(stats.getSrtt(), rtt);
 
   // Receive Data back with a higher RTT
-  RttEstimator::Duration higherRtt(time::milliseconds(100));
+  RttEstimator::Duration higherRtt(100_ms);
   stats.addRttMeasurement(higherRtt);
 
   BOOST_CHECK_EQUAL(stats.getRtt(), higherRtt);
@@ -105,7 +105,7 @@
   pitEntry->insertOrUpdateOutRecord(*face, 0, *interest);
 
   RttEstimator::Duration rtt(50);
-  this->advanceClocks(time::milliseconds(5), rtt);
+  this->advanceClocks(5_ms, rtt);
 
   info.recordRtt(pitEntry, *face);
   info.cancelTimeoutEvent(interestName);
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index d363880..27ed2aa 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -36,7 +36,7 @@
 using namespace nfd::fw::tests;
 
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<AsfStrategy> AsfStrategyTester;
+using AsfStrategyTester = StrategyTester<AsfStrategy>;
 NFD_REGISTER_STRATEGY(AsfStrategyTester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
@@ -45,8 +45,9 @@
 class AsfGridFixture : public GlobalIoTimeFixture
 {
 protected:
-  AsfGridFixture(Name parameters = AsfStrategy::getStrategyName())
-    : parameters(parameters)
+  explicit
+  AsfGridFixture(const Name& params = AsfStrategy::getStrategyName())
+    : parameters(params)
   {
     /*
      *                  +---------+
@@ -74,10 +75,10 @@
     topo.setStrategy<AsfStrategy>(nodeC, Name("ndn:/"), parameters);
     topo.setStrategy<AsfStrategy>(nodeD, Name("ndn:/"), parameters);
 
-    linkAB = topo.addLink("AB", time::milliseconds(10), {nodeA, nodeB});
-    linkAD = topo.addLink("AD", time::milliseconds(100), {nodeA, nodeD});
-    linkBC = topo.addLink("BC", time::milliseconds(10), {nodeB, nodeC});
-    linkCD = topo.addLink("CD", time::milliseconds(100), {nodeC, nodeD});
+    linkAB = topo.addLink("AB", 10_ms, {nodeA, nodeB});
+    linkAD = topo.addLink("AD", 100_ms, {nodeA, nodeD});
+    linkBC = topo.addLink("BC", 10_ms, {nodeB, nodeC});
+    linkCD = topo.addLink("CD", 100_ms, {nodeC, nodeD});
 
     consumer = topo.addAppFace("c", nodeA);
     producer = topo.addAppFace("p", nodeC, PRODUCER_PREFIX);
@@ -91,8 +92,8 @@
   void
   runConsumer(int numInterests = 30)
   {
-    topo.addIntervalConsumer(consumer->getClientFace(), PRODUCER_PREFIX, time::seconds(1), numInterests);
-    this->advanceClocks(time::milliseconds(10), time::seconds(numInterests));
+    topo.addIntervalConsumer(consumer->getClientFace(), PRODUCER_PREFIX, 1_s, numInterests);
+    this->advanceClocks(10_ms, time::seconds(numInterests));
   }
 
 protected:
@@ -160,7 +161,7 @@
   linkAB->recover();
 
   // Advance time to ensure probing is due
-  this->advanceClocks(time::milliseconds(10), time::seconds(10));
+  this->advanceClocks(10_ms, 10_s);
 
   runConsumer();
 
@@ -229,10 +230,10 @@
     topo.setStrategy<AsfStrategy>(node);
   }
 
-  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", time::milliseconds(15), {nodeA, nodeB}),
-                           linkAC = topo.addLink("AC", time::milliseconds(14), {nodeA, nodeC}),
-                           linkBC = topo.addLink("BC", time::milliseconds(16), {nodeB, nodeC}),
-                           linkBD = topo.addLink("BD", time::milliseconds(80), {nodeB, nodeD});
+  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 15_ms, {nodeA, nodeB}),
+                           linkAC = topo.addLink("AC", 14_ms, {nodeA, nodeC}),
+                           linkBC = topo.addLink("BC", 16_ms, {nodeB, nodeC}),
+                           linkBD = topo.addLink("BD", 80_ms, {nodeB, nodeD});
 
   shared_ptr<TopologyAppLink> ping = topo.addAppFace("c", nodeA),
                         pingServer = topo.addAppFace("p", nodeD, PRODUCER_PREFIX);
@@ -257,14 +258,8 @@
 
     // Don't know when the probe will be triggered since it is random between 0-5 seconds
     // or whether it will be triggered for this interest
-    int j = 1;
-    while (linkAB->getFace(nodeA).getCounters().nOutInterests != 1) {
-      this->advanceClocks(time::milliseconds(1));
-      ++j;
-      // Probe was not scheduled with this ping interest
-      if (j > 1000) {
-        break;
-      }
+    for (int j = 1; j <= 1000 && linkAB->getFace(nodeA).getCounters().nOutInterests != 1; ++j) {
+      this->advanceClocks(1_ms);
     }
 
     // Check if probe is sent to B else send another ping
@@ -286,7 +281,7 @@
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nOutInterests, i - 1);
 
       // After 15ms, B should get the probe interest
-      this->advanceClocks(time::milliseconds(1), time::milliseconds(15));
+      this->advanceClocks(1_ms, 15_ms);
       BOOST_CHECK_EQUAL(linkAB->getFace(nodeB).getCounters().nInInterests, 1);
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nOutInterests, i);
 
@@ -298,7 +293,7 @@
       BOOST_CHECK(outRecord != pitEntry->out_end());
 
       // RTT between B and D
-      this->advanceClocks(time::milliseconds(5), time::milliseconds(160));
+      this->advanceClocks(5_ms, 160_ms);
       outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
 
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nInData, i);
@@ -308,7 +303,7 @@
       // Data is returned for the ping after 15 ms - will result in false measurement
       // 14+16-15 = 15ms
       // Since outRecord == pitEntry->out_end()
-      this->advanceClocks(time::milliseconds(1), time::milliseconds(15));
+      this->advanceClocks(1_ms, 15_ms);
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nInData, i+1);
 
       break;
@@ -352,7 +347,7 @@
   // Send 6 interests let it change to use the 10 ms link
   runConsumer(6);
 
-  shared_ptr<TopologyLink> linkAC = topo.addLink("AC", time::milliseconds(5), {nodeA, nodeD});
+  shared_ptr<TopologyLink> linkAC = topo.addLink("AC", 5_ms, {nodeA, nodeD});
   topo.registerPrefix(nodeA, linkAC->getFace(nodeA), PRODUCER_PREFIX, 1);
 
   BOOST_CHECK_EQUAL(linkAC->getFace(nodeA).getCounters().nOutInterests, 0);
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index 7a2db75..b11cdae 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,10 +32,8 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<BestRouteStrategy> BestRouteStrategyTester;
+using BestRouteStrategyTester = StrategyTester<BestRouteStrategy>;
 NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
 
 } // namespace tests
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 4101464..5776f6c 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -34,9 +34,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<BestRouteStrategy2> BestRouteStrategy2Tester;
+using BestRouteStrategy2Tester = StrategyTester<BestRouteStrategy2>;
 NFD_REGISTER_STRATEGY(BestRouteStrategy2Tester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 8e3bae3..59b5ef3 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -45,7 +45,7 @@
   Forwarder forwarder;
 
   shared_ptr<Interest> interestAB = makeInterest("/A/B");
-  interestAB->setInterestLifetime(time::seconds(4));
+  interestAB->setInterestLifetime(4_s);
   shared_ptr<Data> dataABC = makeData("/A/B/C");
 
   auto face1 = make_shared<DummyFace>();
@@ -61,7 +61,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
   face1->receiveInterest(*interestAB);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), "/A/B");
   BOOST_REQUIRE(face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
@@ -74,7 +74,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 0);
   face2->receiveData(*dataABC);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
   BOOST_CHECK_EQUAL(face1->sentData[0].getName(), "/A/B/C");
   BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
@@ -95,7 +95,7 @@
   forwarder.addFace(face3);
 
   shared_ptr<Interest> interestA = makeInterest("/A");
-  interestA->setInterestLifetime(time::seconds(4));
+  interestA->setInterestLifetime(4_s);
   shared_ptr<Data> dataA = makeData("/A");
   dataA->setTag(make_shared<lp::IncomingFaceIdTag>(face3->getId()));
 
@@ -111,7 +111,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
   face1->receiveInterest(*interestA);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
   // Interest matching ContentStore should not be forwarded
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 1);
@@ -122,7 +122,7 @@
   BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
   BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face::FACEID_CONTENT_STORE);
 
-  this->advanceClocks(time::milliseconds(100), time::milliseconds(500));
+  this->advanceClocks(100_ms, 500_ms);
   // PIT entry should not be left behind
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
@@ -171,7 +171,7 @@
   interest->setTag(make_shared<lp::NextHopFaceIdTag>(face2->getId()));
 
   face1->receiveInterest(*interest);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(face3->sentInterests.size(), 0);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentInterests.front().getName(), "/A/B");
@@ -282,7 +282,7 @@
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest2);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveInterest_count, 1);
 
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
 
   shared_ptr<Data> data1 = makeData("ndn:/A/1/a");
   strategyA.beforeSatisfyInterest_count = 0;
@@ -295,10 +295,10 @@
   BOOST_CHECK_EQUAL(strategyB.beforeSatisfyInterest_count, 1);
 
   shared_ptr<Interest> interest3 = makeInterest("ndn:/A/3");
-  interest3->setInterestLifetime(time::milliseconds(30));
+  interest3->setInterestLifetime(30_ms);
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest3);
   shared_ptr<Interest> interest4 = makeInterest("ndn:/B/4");
-  interest4->setInterestLifetime(time::milliseconds(5000));
+  interest4->setInterestLifetime(5_s);
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest4);
 }
 
@@ -329,7 +329,7 @@
 
   shared_ptr<Data> dataD = makeData("ndn:/A/B/C/D");
   forwarder.onIncomingData(FaceEndpoint(*face3, 0), *dataD);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
 
   BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentData.size(), 1);
@@ -557,12 +557,12 @@
   // receive an Interest
   shared_ptr<Interest> interest = makeInterest("ndn:/A/1");
   interest->setNonce(82101183);
-  interest->setInterestLifetime(time::milliseconds(50));
+  interest->setInterestLifetime(50_ms);
   face1->receiveInterest(*interest);
 
   // interest should be forwarded only once, as long as Nonce is in Dead Nonce List
-  BOOST_ASSERT(time::milliseconds(25) * 40 < forwarder.getDeadNonceList().getLifetime());
-  this->advanceClocks(time::milliseconds(25), 40);
+  BOOST_ASSERT(25_ms * 40 < forwarder.getDeadNonceList().getLifetime());
+  this->advanceClocks(25_ms, 40);
 
   BOOST_CHECK_EQUAL(face2->sentInterests.size(), 1);
 
@@ -581,7 +581,7 @@
 
   shared_ptr<Interest> interest = makeInterest("ndn:/hcLSAsQ9A");
   interest->setNonce(61883075);
-  interest->setInterestLifetime(time::seconds(2));
+  interest->setInterestLifetime(2_s);
 
   DeadNonceList& dnl = forwarder.getDeadNonceList();
   dnl.add(interest->getName(), interest->getNonce());
@@ -589,7 +589,7 @@
   BOOST_REQUIRE_EQUAL(pit.size(), 0);
 
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest);
-  this->advanceClocks(time::milliseconds(100), time::seconds(20));
+  this->advanceClocks(100_ms, 20_s);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
 
diff --git a/tests/daemon/fw/forwarding-hint.t.cpp b/tests/daemon/fw/forwarding-hint.t.cpp
index e37c267..7e9dbdc 100644
--- a/tests/daemon/fw/forwarding-hint.t.cpp
+++ b/tests/daemon/fw/forwarding-hint.t.cpp
@@ -77,12 +77,12 @@
     topo.getForwarder(nodeS).getNetworkRegionTable().insert("/ucla/cs/spurs");
     // NetworkRegionTable configuration is unnecessary on end hosts
 
-    linkAH = topo.addLink("AH", time::milliseconds(10), {nodeA, nodeH});
-    linkHT = topo.addLink("HT", time::milliseconds(10), {nodeH, nodeT});
-    linkTP = topo.addLink("TP", time::milliseconds(10), {nodeT, nodeP});
-    linkHC = topo.addLink("HC", time::milliseconds(10), {nodeH, nodeC});
-    linkCS = topo.addLink("CS", time::milliseconds(10), {nodeC, nodeS});
-    linkSQ = topo.addLink("SQ", time::milliseconds(10), {nodeS, nodeQ});
+    linkAH = topo.addLink("AH", 10_ms, {nodeA, nodeH});
+    linkHT = topo.addLink("HT", 10_ms, {nodeH, nodeT});
+    linkTP = topo.addLink("TP", 10_ms, {nodeT, nodeP});
+    linkHC = topo.addLink("HC", 10_ms, {nodeH, nodeC});
+    linkCS = topo.addLink("CS", 10_ms, {nodeC, nodeS});
+    linkSQ = topo.addLink("SQ", 10_ms, {nodeS, nodeQ});
     consumerA = topo.addAppFace("avenir", nodeA);
     producerP = topo.addAppFace("ndnsimP", nodeP, "/net/ndnsim");
     producerQ = topo.addAppFace("ndnsimQ", nodeQ, "/net/ndnsim");
@@ -123,7 +123,7 @@
 BOOST_AUTO_TEST_CASE(FetchTelia)
 {
   this->consumerExpressInterest(1);
-  this->advanceClocks(time::milliseconds(11), 20);
+  this->advanceClocks(11_ms, 20);
 
   // A forwards Interest according to default route, no change to forwarding hint
   BOOST_CHECK_EQUAL(linkAH->getFace(nodeA).getCounters().nOutInterests, 1);
@@ -152,7 +152,7 @@
   topo.getForwarder(nodeH).getFib().erase("/telia");
 
   this->consumerExpressInterest(1);
-  this->advanceClocks(time::milliseconds(11), 20);
+  this->advanceClocks(11_ms, 20);
 
   // A forwards Interest according to default route, no change to forwarding hint
   BOOST_CHECK_EQUAL(linkAH->getFace(nodeA).getCounters().nOutInterests, 1);
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index a6d9be6..e1c4027 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -34,9 +34,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<MulticastStrategy> MulticastStrategyTester;
+using MulticastStrategyTester = StrategyTester<MulticastStrategy>;
 NFD_REGISTER_STRATEGY(MulticastStrategyTester);
 
 class MulticastStrategyFixture : public GlobalIoTimeFixture
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index 86238af..d7172e3 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -33,9 +33,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<NccStrategy> NccStrategyTester;
+using NccStrategyTester = StrategyTester<NccStrategy>;
 NFD_REGISTER_STRATEGY(NccStrategyTester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
@@ -69,7 +67,7 @@
   // first Interest: strategy knows nothing and follows routing
   shared_ptr<Interest> interest1p = makeInterest("ndn:/0Jm1ajrW/%00");
   Interest& interest1 = *interest1p;
-  interest1.setInterestLifetime(time::milliseconds(8000));
+  interest1.setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, interest1);
@@ -81,7 +79,7 @@
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
 
   // forwards to face2 because face1 doesn't respond
-  limitedIo.run(1, time::milliseconds(500), time::milliseconds(10));
+  limitedIo.run(1, 500_ms, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
 
@@ -89,19 +87,19 @@
   shared_ptr<Data> data1p = makeData("ndn:/0Jm1ajrW/%00");
   Data& data1 = *data1p;
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), data1);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
+  this->advanceClocks(10_ms, 500_ms);
 
   // second Interest: strategy knows face2 is best
   shared_ptr<Interest> interest2p = makeInterest("ndn:/0Jm1ajrW/%00%01");
   Interest& interest2 = *interest2p;
-  interest2.setInterestLifetime(time::milliseconds(8000));
+  interest2.setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, interest2);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest2, pitEntry2);
 
   // forwards to face2 because it responds previously
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   BOOST_REQUIRE_GE(strategy.sendInterestHistory.size(), 3);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[2].outFaceId, face2->getId());
 }
@@ -126,25 +124,25 @@
 
   // first Interest: strategy follows routing and forwards to face1
   shared_ptr<Interest> interest1 = makeInterest("ndn:/nztwIvHX/%00");
-  interest1->setInterestLifetime(time::milliseconds(8000));
+  interest1->setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
 
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
 
   // face1 responds
   shared_ptr<Data> data1 = makeData("ndn:/nztwIvHX/%00");
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
+  this->advanceClocks(10_ms, 500_ms);
 
   // second Interest: bestFace is face1, nUpstreams becomes 0,
   // therefore pitEntryInfo->maxInterval cannot be calculated from deferRange and nUpstreams
   shared_ptr<Interest> interest2 = makeInterest("ndn:/nztwIvHX/%01");
-  interest2->setInterestLifetime(time::milliseconds(8000));
+  interest2->setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
@@ -152,7 +150,7 @@
 
   // FIB entry is changed before doPropagate executes
   fibEntry.addOrUpdateNextHop(*face2, 0, 20);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(1000));// should not crash
+  this->advanceClocks(10_ms, 1_s);// should not crash
 }
 
 BOOST_AUTO_TEST_CASE(Bug1961)
@@ -178,13 +176,12 @@
 
   // first Interest: strategy forwards to face1 and face2
   shared_ptr<Interest> interest1 = makeInterest("ndn:/seRMz5a6/%00");
-  interest1->setInterestLifetime(time::milliseconds(2000));
+  interest1->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
-  limitedIo.run(2 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
@@ -193,20 +190,19 @@
   shared_ptr<Data> data1 = makeData("ndn:/seRMz5a6/%00");
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
   pitEntry1->clearInRecords();
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
   // face2 also responds
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   // second Interest: bestFace should be face 1
   shared_ptr<Interest> interest2 = makeInterest("ndn:/seRMz5a6/%01");
-  interest2->setInterestLifetime(time::milliseconds(2000));
+  interest2->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
-  limitedIo.run(3 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(3 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
 
   BOOST_REQUIRE_GE(strategy.sendInterestHistory.size(), 3);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[2].outFaceId, face1->getId());
@@ -232,29 +228,27 @@
 
   // first Interest: strategy forwards to face2
   shared_ptr<Interest> interest1 = makeInterest("ndn:/M4mBXCsd");
-  interest1->setInterestLifetime(time::milliseconds(2000));
+  interest1->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
-  limitedIo.run(1 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(1 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face2->getId());
 
   // face2 responds
   shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
-  data1->setFreshnessPeriod(time::milliseconds(5));
+  data1->setFreshnessPeriod(5_ms);
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
   pitEntry1->deleteOutRecord(*face2, 0);
   pitEntry1->clearInRecords();
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   // similar Interest: strategy should still forward it
   pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
-  limitedIo.run(2 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
 }
@@ -323,10 +317,10 @@
     topo.setStrategy<NccStrategy>(node);
   }
 
-  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", time::milliseconds( 5), {nodeA, nodeB}),
-                           linkAC = topo.addLink("AC", time::milliseconds( 5), {nodeA, nodeC}),
-                           linkBD = topo.addLink("BD", time::milliseconds(15), {nodeB, nodeD}),
-                           linkCD = topo.addLink("CD", time::milliseconds(15), {nodeC, nodeD});
+  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 5_ms, {nodeA, nodeB}),
+                           linkAC = topo.addLink("AC", 5_ms, {nodeA, nodeC}),
+                           linkBD = topo.addLink("BD", 15_ms, {nodeB, nodeD}),
+                           linkCD = topo.addLink("CD", 15_ms, {nodeC, nodeD});
 
   topo.registerPrefix(nodeA, linkAB->getFace(nodeA), "ndn:/P");
   topo.registerPrefix(nodeA, linkAC->getFace(nodeA), "ndn:/P");
@@ -338,7 +332,7 @@
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("consumer", nodeA);
   topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/P",
-                           time::milliseconds(100), 300);
+                           100_ms, 300);
 
   auto getMeInfo = [&] () -> NccStrategy::MeasurementsEntryInfo* {
     Measurements& measurements = topo.getForwarder(nodeA).getMeasurements();
@@ -353,7 +347,7 @@
   bool isLastPredictionUnder = true;
   int nPredictionCrossings = 0;
   for (int i = 0; i < 10000; ++i) {
-    this->advanceClocks(time::milliseconds(5));
+    this->advanceClocks(5_ms);
     auto meInfo = getMeInfo();
     if (meInfo == nullptr) {
       continue;
@@ -369,7 +363,7 @@
       }
     }
   }
-  BOOST_REQUIRE_MESSAGE(isExplorationFinished, "exploration does not finish in 50000ms");
+  BOOST_REQUIRE_MESSAGE(isExplorationFinished, "exploration did not finish within 50s");
 
   // NccStrategy has selected one path as the best.
   // When we reduce the RTT of the other path, ideally it should be selected as the best face.
@@ -377,10 +371,10 @@
   // See https://redmine.named-data.net/issues/3411#note-4
   shared_ptr<Face> bestFace1 = getMeInfo()->bestFace.lock();
   if (bestFace1.get() == &linkAB->getFace(nodeA)) {
-    linkCD->setDelay(time::milliseconds(5));
+    linkCD->setDelay(5_ms);
   }
   else if (bestFace1.get() == &linkAC->getFace(nodeA)) {
-    linkBD->setDelay(time::milliseconds(5));
+    linkBD->setDelay(5_ms);
   }
   else {
     BOOST_FAIL("unexpected best face");
@@ -388,7 +382,7 @@
 
   bool isNewBestChosen = false;
   for (int i = 0; i < 10000; ++i) {
-    this->advanceClocks(time::milliseconds(5));
+    this->advanceClocks(5_ms);
     auto meInfo = getMeInfo();
     if (meInfo == nullptr) {
       continue;
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index a0aab02..de4c206 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -93,7 +93,7 @@
 {
   Forwarder forwarder;
   Pit& pit = forwarder.getPit();
-  RetxSuppressionExponential rs(time::milliseconds(10), 3.0, time::milliseconds(100));
+  RetxSuppressionExponential rs(10_ms, 3.0, 100_ms);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
   shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
@@ -109,12 +109,12 @@
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 10ms, until 10ms
 
-  this->advanceClocks(time::milliseconds(5)); // @ 5ms
+  this->advanceClocks(5_ms); // @ 5ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 10ms, until 10ms
 
-  this->advanceClocks(time::milliseconds(6)); // @ 11ms
+  this->advanceClocks(6_ms); // @ 11ms
   // note: what happens at *exactly* 10ms does not matter so it's untested,
   // because in reality network timing won't be exact:
   // incoming Interest is processed either before or after 10ms point
@@ -123,34 +123,34 @@
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 30ms, until 41ms
 
-  this->advanceClocks(time::milliseconds(25)); // @ 36ms
+  this->advanceClocks(25_ms); // @ 36ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 30ms, until 41ms
 
-  this->advanceClocks(time::milliseconds(6)); // @ 42ms
+  this->advanceClocks(6_ms); // @ 42ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   // strategy decides not to forward, but suppression interval is increased nevertheless
   // suppression interval is 90ms, until 101ms
 
-  this->advanceClocks(time::milliseconds(58)); // @ 100ms
+  this->advanceClocks(58_ms); // @ 100ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 90ms, until 101ms
 
-  this->advanceClocks(time::milliseconds(3)); // @ 103ms
+  this->advanceClocks(3_ms); // @ 103ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 100ms, until 203ms
 
-  this->advanceClocks(time::milliseconds(99)); // @ 202ms
+  this->advanceClocks(99_ms); // @ 202ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 100ms, until 203ms
 
-  this->advanceClocks(time::milliseconds(2)); // @ 204ms
+  this->advanceClocks(2_ms); // @ 204ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
@@ -161,7 +161,7 @@
 {
   Forwarder forwarder;
   Pit& pit = forwarder.getPit();
-  RetxSuppressionExponential rs(time::milliseconds(10), 3.0, time::milliseconds(100));
+  RetxSuppressionExponential rs(10_ms, 3.0, 100_ms);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
   shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
@@ -177,7 +177,7 @@
 
   // Simluate forwarding an interest to face2
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
-  this->advanceClocks(time::milliseconds(5)); // @ 5ms
+  this->advanceClocks(5_ms); // @ 5ms
 
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::SUPPRESS);
@@ -186,7 +186,7 @@
   pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face1) == RetxSuppressionResult::NEW);
 
-  this->advanceClocks(time::milliseconds(6)); // @ 11ms
+  this->advanceClocks(6_ms); // @ 11ms
 
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::FORWARD);
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 2708710..c9a66c2 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -42,8 +42,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 BOOST_AUTO_TEST_SUITE(Fw)
 
 template<typename S>
@@ -168,17 +166,17 @@
   fibEntry.addOrUpdateNextHop(*this->face5, 0, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/sIYw0TXWDj", 115);
-  interest1->setInterestLifetime(time::milliseconds(400));
+  interest1->setInterestLifetime(400_ms);
   shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
   pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
   pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
 
-  this->advanceClocks(time::milliseconds(300));
+  this->advanceClocks(300_ms);
   shared_ptr<Interest> interest2 = makeInterest("/sIYw0TXWDj", 223);
   pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest2);
   pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest2);
 
-  this->advanceClocks(time::milliseconds(200)); // face3 has timed out
+  this->advanceClocks(200_ms); // face3 has timed out
 
   lp::Nack nack4 = makeNack("/sIYw0TXWDj", 223, lp::NackReason::CONGESTION);
   pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
@@ -257,12 +255,12 @@
   ndn::Face& appD = topo.addAppFace("D", nodeD)->getClientFace();
 
   int nNacksA = 0, nNacksD = 0;
-  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA]{ ++nNacksA; }), nullptr);
-  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD]{ ++nNacksD; }), nullptr);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
-  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA]{ ++nNacksA; }), nullptr);
-  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD]{ ++nNacksD; }), nullptr);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(100));
+  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA] { ++nNacksA; }), nullptr);
+  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD] { ++nNacksD; }), nullptr);
+  this->advanceClocks(1_ms, 5_ms);
+  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA] { ++nNacksA; }), nullptr);
+  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD] { ++nNacksD; }), nullptr);
+  this->advanceClocks(1_ms, 100_ms);
 
   // As long as at least one Nack arrives at each client, strategy behavior is correct.
   // Whether both Interests are Nacked is a client face behavior, not strategy behavior.
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index daf3f2a..43c57d0 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -46,8 +46,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class StrategyNoRouteFixture : public GlobalIoTimeFixture
 {
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 2980834..4b83e46 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -47,8 +47,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class StrategyScopeControlFixture : public GlobalIoTimeFixture
 {
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index f2ac93d..3ddf8f6 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -34,14 +34,16 @@
 namespace fw {
 namespace tests {
 
-/** \brief extends strategy S for unit testing
+using namespace nfd::tests;
+
+/** \brief Extends strategy S for unit testing.
  *
- *  Actions invoked by S are recorded but not passed to forwarder
+ *  Actions invoked by S are recorded but not passed to forwarder.
  *
  *  StrategyTester should be registered into the strategy registry prior to use.
  *  \code
  *  // appears in or included by every .cpp MyStrategyTester is used
- *  typedef StrategyTester<MyStrategy> MyStrategyTester;
+ *  using MyStrategyTester = StrategyTester<MyStrategy>;
  *
  *  // appears in only one .cpp
  *  NFD_REGISTER_STRATEGY(MyStrategyTester);
@@ -82,9 +84,9 @@
    *  \note The actions may occur either during f() invocation or afterwards.
    *  \return whether expected number of actions have occurred
    */
+  template<typename F>
   bool
-  waitForAction(const std::function<void()>& f,
-                nfd::tests::LimitedIo& limitedIo, int nExpectedActions = 1)
+  waitForAction(F&& f, LimitedIo& limitedIo, int nExpectedActions = 1)
   {
     int nActions = 0;
 
@@ -99,8 +101,7 @@
       // A correctly implemented strategy is required to invoke reject pending Interest action if it
       // decides to not forward an Interest. If a test case is stuck in the call below, check that
       // rejectPendingInterest is invoked under proper condition.
-      return limitedIo.run(nExpectedActions - nActions, nfd::tests::LimitedIo::UNLIMITED_TIME) ==
-             nfd::tests::LimitedIo::EXCEED_OPS;
+      return limitedIo.run(nExpectedActions - nActions, LimitedIo::UNLIMITED_TIME) == LimitedIo::EXCEED_OPS;
     }
     return nActions == nExpectedActions;
   }
