diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
new file mode 100644
index 0000000..2b83004
--- /dev/null
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -0,0 +1,130 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2016,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "fw/asf-measurements.hpp"
+
+#include "tests/daemon/face/dummy-face.hpp"
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace fw {
+namespace asf {
+namespace tests {
+
+using namespace nfd::tests;
+
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_AUTO_TEST_SUITE(TestAsfMeasurements)
+
+BOOST_AUTO_TEST_SUITE(TestRttStats)
+
+BOOST_FIXTURE_TEST_CASE(Basic, BaseFixture)
+{
+  RttStats stats;
+
+  BOOST_CHECK_EQUAL(stats.getRtt(), RttStats::RTT_NO_MEASUREMENT);
+  BOOST_CHECK_EQUAL(stats.getSrtt(), RttStats::RTT_NO_MEASUREMENT);
+
+  // Receive Data back in 50ms
+  RttEstimator::Duration rtt(time::milliseconds(50));
+  stats.addRttMeasurement(rtt);
+
+  BOOST_CHECK_EQUAL(stats.getRtt(), rtt);
+  BOOST_CHECK_EQUAL(stats.getSrtt(), rtt);
+
+  // Receive Data back in 50ms
+  stats.addRttMeasurement(rtt);
+
+  BOOST_CHECK_EQUAL(stats.getRtt(), rtt);
+  BOOST_CHECK_EQUAL(stats.getSrtt(), rtt);
+
+  // Receive Data back with a higher RTT
+  RttEstimator::Duration higherRtt(time::milliseconds(100));
+  stats.addRttMeasurement(higherRtt);
+
+  BOOST_CHECK_EQUAL(stats.getRtt(), higherRtt);
+  BOOST_CHECK_GT(stats.getSrtt(), rtt);
+  BOOST_CHECK_LT(stats.getSrtt(), higherRtt);
+
+  // Simulate timeout
+  RttStats::Rtt previousSrtt = stats.getSrtt();
+
+  stats.recordTimeout();
+
+  BOOST_CHECK_EQUAL(stats.getRtt(), RttStats::RTT_TIMEOUT);
+  BOOST_CHECK_EQUAL(stats.getSrtt(), previousSrtt);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestRttStats
+
+BOOST_AUTO_TEST_SUITE(TestFaceInfo)
+
+BOOST_FIXTURE_TEST_CASE(Basic, UnitTestTimeFixture)
+{
+  FaceInfo info;
+
+  scheduler::EventId id = scheduler::schedule(time::seconds(1), []{});
+  ndn::Name interestName("/ndn/interest");
+
+  // Receive Interest and forward to next hop; should update RTO information
+  info.setTimeoutEvent(id, interestName);
+  BOOST_CHECK_EQUAL(info.isTimeoutScheduled(), true);
+
+  // If the strategy tries to schedule an RTO when one is already scheduled, throw an exception
+  BOOST_CHECK_THROW(info.setTimeoutEvent(id, interestName), FaceInfo::Error);
+
+  // Receive Data
+  shared_ptr<Interest> interest = makeInterest(interestName);
+  shared_ptr<pit::Entry> pitEntry = make_shared<pit::Entry>(*interest);
+  std::shared_ptr<DummyFace> face = make_shared<DummyFace>();
+
+  pitEntry->insertOrUpdateOutRecord(face, *interest);
+
+  RttEstimator::Duration rtt(50);
+  this->advanceClocks(time::milliseconds(5), rtt);
+
+  info.recordRtt(pitEntry, *face);
+  info.cancelTimeoutEvent(interestName);
+
+  BOOST_CHECK_EQUAL(info.getRtt(), rtt);
+  BOOST_CHECK_EQUAL(info.getSrtt(), rtt);
+
+  // Send out another Interest which times out
+  info.setTimeoutEvent(id, interestName);
+
+  info.recordTimeout(interestName);
+  BOOST_CHECK_EQUAL(info.getRtt(), RttStats::RTT_TIMEOUT);
+  BOOST_CHECK_EQUAL(info.isTimeoutScheduled(), false);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestFaceInfo
+
+BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace asf
+} // namespace fw
+} // namespace nfd
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
new file mode 100644
index 0000000..687b0e2
--- /dev/null
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -0,0 +1,190 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2016,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "fw/asf-strategy.hpp"
+
+#include "tests/test-common.hpp"
+#include "topology-tester.hpp"
+
+namespace nfd {
+namespace fw {
+namespace asf {
+namespace tests {
+
+using namespace nfd::fw::tests;
+
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestAsfStrategy, UnitTestTimeFixture)
+
+class AsfGridFixture : public UnitTestTimeFixture
+{
+protected:
+  AsfGridFixture()
+  {
+    /*
+     *                  +---------+
+     *           +----->|  nodeB  |<------+
+     *           |      +---------+       |
+     *      10ms |                        | 10ms
+     *           v                        v
+     *      +---------+              +---------+
+     *      |  nodeA  |              |  nodeC  |
+     *      +---------+              +---------+
+     *           ^                        ^
+     *     100ms |                        | 100ms
+     *           |      +---------+       |
+     *           +----->|  nodeD  |<------+
+     *                  +---------+
+     */
+
+    nodeA = topo.addForwarder("A");
+    nodeB = topo.addForwarder("B");
+    nodeC = topo.addForwarder("C");
+    nodeD = topo.addForwarder("D");
+
+    topo.setStrategy<fw::AsfStrategy>(nodeA);
+    topo.setStrategy<fw::AsfStrategy>(nodeB);
+    topo.setStrategy<fw::AsfStrategy>(nodeC);
+    topo.setStrategy<fw::AsfStrategy>(nodeD);
+
+    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});
+
+    consumer = topo.addAppFace("c", nodeA);
+    producer = topo.addAppFace("p", nodeC, PRODUCER_PREFIX);
+    topo.addEchoProducer(producer->getClientFace());
+
+    // Register producer prefix on consumer node
+    topo.registerPrefix(nodeA, linkAB->getFace(nodeA), PRODUCER_PREFIX, 10);
+    topo.registerPrefix(nodeA, linkAD->getFace(nodeA), PRODUCER_PREFIX, 5);
+  }
+
+  void
+  runConsumer()
+  {
+    topo.addIntervalConsumer(consumer->getClientFace(), PRODUCER_PREFIX, time::seconds(1), 30);
+    this->advanceClocks(time::milliseconds(1), time::seconds(30));
+  }
+
+protected:
+  TopologyTester topo;
+
+  TopologyNode nodeA;
+  TopologyNode nodeB;
+  TopologyNode nodeC;
+  TopologyNode nodeD;
+
+  shared_ptr<TopologyLink> linkAB;
+  shared_ptr<TopologyLink> linkAD;
+  shared_ptr<TopologyLink> linkBC;
+  shared_ptr<TopologyLink> linkCD;
+
+  shared_ptr<TopologyAppLink> consumer;
+  shared_ptr<TopologyAppLink> producer;
+
+  static const Name PRODUCER_PREFIX;
+};
+
+const Name AsfGridFixture::PRODUCER_PREFIX = Name("ndn:/hr/C");
+
+BOOST_FIXTURE_TEST_CASE(Basic, AsfGridFixture)
+{
+  // Both nodeB and nodeD have FIB entries to reach the producer
+  topo.registerPrefix(nodeB, linkBC->getFace(nodeB), PRODUCER_PREFIX);
+  topo.registerPrefix(nodeD, linkCD->getFace(nodeD), PRODUCER_PREFIX);
+
+  runConsumer();
+
+  // ASF should use the Face to nodeD because it has lower routing cost.
+  // After 5 seconds, a probe Interest should be sent to the Face to nodeB,
+  // and the probe should return Data quicker. ASF should then use the Face
+  // to nodeB to forward the remaining Interests.
+  BOOST_CHECK_EQUAL(consumer->getForwarderFace().getCounters().nOutData, 30);
+  BOOST_CHECK_GE(linkAB->getFace(nodeA).getCounters().nOutInterests, 24);
+  BOOST_CHECK_LE(linkAD->getFace(nodeA).getCounters().nOutInterests, 6);
+
+  // If the link from nodeA to nodeB fails, ASF should start using the Face
+  // to nodeD again.
+  linkAB->fail();
+
+  runConsumer();
+
+  // Only 59 Data because the first Interest to nodeB after the failure should timeout
+  BOOST_CHECK_EQUAL(consumer->getForwarderFace().getCounters().nOutData, 59);
+  BOOST_CHECK_LE(linkAB->getFace(nodeA).getCounters().nOutInterests, 30);
+  BOOST_CHECK_GE(linkAD->getFace(nodeA).getCounters().nOutInterests, 30);
+
+  // If the link from nodeA to nodeB recovers, ASF should probe the Face
+  // to nodeB and start using it again.
+  linkAB->recover();
+
+  // Advance time to ensure probing is due
+  this->advanceClocks(time::milliseconds(1), time::seconds(10));
+
+  runConsumer();
+
+  BOOST_CHECK_EQUAL(consumer->getForwarderFace().getCounters().nOutData, 89);
+  BOOST_CHECK_GE(linkAB->getFace(nodeA).getCounters().nOutInterests, 50);
+  BOOST_CHECK_LE(linkAD->getFace(nodeA).getCounters().nOutInterests, 40);
+
+  // If both links fail, nodeA should forward to the next hop with the lowest cost
+  linkAB->fail();
+  linkAD->fail();
+
+  runConsumer();
+
+  BOOST_CHECK_EQUAL(consumer->getForwarderFace().getCounters().nOutData, 89);
+  BOOST_CHECK_LE(linkAB->getFace(nodeA).getCounters().nOutInterests, 60);
+  BOOST_CHECK_GE(linkAD->getFace(nodeA).getCounters().nOutInterests, 60);
+}
+
+BOOST_FIXTURE_TEST_CASE(Nack, AsfGridFixture)
+{
+  // nodeB has a FIB entry to reach the producer, but nodeD does not
+  topo.registerPrefix(nodeB, linkBC->getFace(nodeB), PRODUCER_PREFIX);
+
+  // The strategy should first try to send to nodeD. But since nodeD does not have a route for
+  // the producer's prefix, it should return a NO_ROUTE Nack. The strategy should then start using the Face to
+  // nodeB.
+  runConsumer();
+
+  BOOST_CHECK_GE(linkAD->getFace(nodeA).getCounters().nInNacks, 1);
+  BOOST_CHECK_EQUAL(consumer->getForwarderFace().getCounters().nOutData, 29);
+  BOOST_CHECK_EQUAL(linkAB->getFace(nodeA).getCounters().nOutInterests, 29);
+
+  // nodeD should receive 2 Interests: one for the very first Interest and
+  // another from a probe
+  BOOST_CHECK_GE(linkAD->getFace(nodeA).getCounters().nOutInterests, 2);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace asf
+} // namespace fw
+} // namespace nfd
