diff --git a/tests/unit-tests/update-handler.t.cpp b/tests/unit-tests/update-handler.t.cpp
new file mode 100644
index 0000000..22624b6
--- /dev/null
+++ b/tests/unit-tests/update-handler.t.cpp
@@ -0,0 +1,277 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+* Copyright (c) 2016 Regents of the University of California.
+*
+* This file is part of the nTorrent codebase.
+*
+* nTorrent is free software: you can redistribute it and/or modify it under the
+* terms of the GNU Lesser General Public License as published by the Free Software
+* Foundation, either version 3 of the License, or (at your option) any later version.
+*
+* nTorrent 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 Lesser General Public License for more details.
+*
+* You should have received copies of the GNU General Public License and GNU Lesser
+* General Public License along with nTorrent, e.g., in COPYING.md file. If not, see
+* <http://www.gnu.org/licenses/>.
+*
+* See AUTHORS for complete list of nTorrent authors and contributors.
+*/
+
+#include "boost-test.hpp"
+#include "update-handler.hpp"
+#include "unit-test-time-fixture.hpp"
+#include "dummy-parser-fixture.hpp"
+
+#include <ndn-cxx/name.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
+#include <ndn-cxx/util/io.hpp>
+
+namespace ndn {
+namespace ntorrent {
+namespace tests {
+
+using util::DummyClientFace;
+using std::vector;
+
+class TestUpdateHandler : public UpdateHandler {
+public:
+  TestUpdateHandler(Name torrentName, shared_ptr<KeyChain> keyChain,
+                    shared_ptr<StatsTable> statsTable, shared_ptr<Face> face)
+  : UpdateHandler(torrentName, keyChain, statsTable, face)
+  {
+  }
+
+  ~TestUpdateHandler()
+  {
+  }
+
+  Name
+  getOwnRoutablePrefix()
+  {
+    return UpdateHandler::getOwnRoutablePrefix();
+  }
+};
+
+class FaceFixture : public UnitTestTimeFixture
+{
+public:
+  explicit
+  FaceFixture()
+  : face1(util::makeDummyClientFace(io, { true, true }))
+  , face2(util::makeDummyClientFace(io, { true, true }))
+  {
+  }
+
+public:
+  shared_ptr<DummyClientFace> face1;
+  shared_ptr<DummyClientFace> face2;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestUpdateHandlerClass, FaceFixture)
+
+BOOST_AUTO_TEST_CASE(TestInitialSetup)
+{
+  shared_ptr<StatsTable> table1 = make_shared<StatsTable>(Name("linux15.01"));
+
+  shared_ptr<KeyChain> keyChain = make_shared<KeyChain>();
+
+  TestUpdateHandler handler1(Name("linux15.01"), keyChain, table1, face1);
+  advanceClocks(time::milliseconds(1), 10);
+  // Create a data packet containing one name as content
+  shared_ptr<Data> d = DummyParser::createDataPacket(Name("/localhop/nfd/rib/routable-prefixes"),
+                                                      { Name("ucla") });
+  keyChain->sign(*d);
+  face1->receive(*d);
+
+  BOOST_CHECK_EQUAL(handler1.getOwnRoutablePrefix().toUri(), "/ucla");
+
+  shared_ptr<StatsTable> table2 = make_shared<StatsTable>(Name("linux15.01"));
+  TestUpdateHandler handler2(Name("linux15.01"), keyChain, table2, face2);
+  advanceClocks(time::milliseconds(1), 10);
+  // Create a data packet containing one name as content
+  d = DummyParser::createDataPacket(Name("/localhop/nfd/rib/routable-prefixes"),
+                                     { Name("arizona") });
+  keyChain->sign(*d);
+  face2->receive(*d);
+
+  BOOST_CHECK_EQUAL(handler2.getOwnRoutablePrefix().toUri(), "/arizona");
+}
+
+BOOST_AUTO_TEST_CASE(TestAliveInterestExchange)
+{
+  shared_ptr<StatsTable> table1 = make_shared<StatsTable>(Name("linux15.01"));
+  table1->insert(Name("isp1"));
+  table1->insert(Name("isp2"));
+  table1->insert(Name("isp3"));
+
+  shared_ptr<KeyChain> keyChain = make_shared<KeyChain>();
+
+  TestUpdateHandler handler1(Name("linux15.01"), keyChain, table1, face1);
+  advanceClocks(time::milliseconds(1), 10);
+  // Create a data packet containing one name as content
+  shared_ptr<Data> d = DummyParser::createDataPacket(Name("/localhop/nfd/rib/routable-prefixes"),
+                                                      { Name("ucla") });
+  keyChain->sign(*d);
+  face1->receive(*d);
+
+  shared_ptr<StatsTable> table2 = make_shared<StatsTable>(Name("linux15.01"));
+  table2->insert(Name("ucla"));
+  TestUpdateHandler handler2(Name("linux15.01"), keyChain, table2, face2);
+  advanceClocks(time::milliseconds(1), 10);
+  // Create a data packet containing one name as content
+  d = DummyParser::createDataPacket(Name("/localhop/nfd/rib/routable-prefixes"),
+                                     { Name("arizona") });
+  keyChain->sign(*d);
+  face2->receive(*d);
+
+  handler2.sendAliveInterest(table2->begin());
+
+  advanceClocks(time::milliseconds(1), 40);
+  Interest interest(Name("/NTORRENT/linux15.01/ALIVE/test"));
+  face1->receive(interest);
+
+  advanceClocks(time::milliseconds(1), 10);
+  std::vector<Data> dataVec = face1->sentData;
+
+  BOOST_CHECK_EQUAL(dataVec.size(), 1);
+  BOOST_CHECK_EQUAL(dataVec[0].getName().toUri(), "/NTORRENT/linux15.01/ALIVE/test");
+
+  auto block = dataVec[0].getContent();
+  shared_ptr<vector<Name>> nameVec = DummyParser::decodeContent(block);
+  auto it = nameVec->begin();
+
+  BOOST_CHECK_EQUAL(it->toUri(), "/test");
+  ++it;
+  BOOST_CHECK_EQUAL(it->toUri(), "/isp3");
+  ++it;
+  BOOST_CHECK_EQUAL(it->toUri(), "/isp2");
+  ++it;
+  BOOST_CHECK_EQUAL(it->toUri(), "/isp1");
+
+  BOOST_CHECK_EQUAL((table1->end() - 1)->getRecordName().toUri(), "/test");
+
+  d = DummyParser::createDataPacket(Name("/NTORRENT/linux15.01/ALIVE/arizona"),
+                                     { Name("isp1"), Name("isp2"), Name("isp3") });
+  keyChain->sign(*d);
+
+  advanceClocks(time::milliseconds(1), 40);
+  face2->receive(*d);
+
+  auto i = table2->begin();
+  ++i;
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp1");
+  ++i;
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp2");
+  ++i;
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp3");
+
+  table1->erase(Name("isp1"));
+  table1->erase(Name("isp2"));
+
+  table1->insert(Name("isp4"));
+  table1->insert(Name("isp5"));
+  table1->insert(Name("isp6"));
+  table1->insert(Name("isp7"));
+  table1->insert(Name("isp8"));
+  table1->insert(Name("isp9"));
+
+  handler2.sendAliveInterest(table2->begin());
+
+  advanceClocks(time::milliseconds(1), 40);
+  Interest interest2(Name("/NTORRENT/linux15.01/ALIVE/arizona"));
+  face1->receive(interest2);
+
+  advanceClocks(time::milliseconds(1), 10);
+
+  dataVec = face1->sentData;
+  BOOST_CHECK_EQUAL(dataVec.size(), 2);
+
+  auto iter = dataVec.begin() + 1;
+  advanceClocks(time::milliseconds(1), 30);
+  face2->receive(*iter);
+
+  i = table2->begin();
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/ucla");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp1");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp2");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp3");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/test");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp4");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp5");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK_EQUAL(i->getRecordName().toUri(), "/isp6");
+  BOOST_CHECK_EQUAL(i->getRecordSuccessRate(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordSentInterests(), 0);
+  BOOST_CHECK_EQUAL(i->getRecordReceivedData(), 0);
+  ++i;
+
+  BOOST_CHECK(i == table2->end());
+}
+
+BOOST_AUTO_TEST_CASE(TestNeedsUpdate)
+{
+  shared_ptr<StatsTable> table1 = make_shared<StatsTable>(Name("linux15.01"));
+  table1->insert(Name("isp1"));
+  table1->insert(Name("isp2"));
+  table1->insert(Name("isp3"));
+
+  shared_ptr<KeyChain> keyChain = make_shared<KeyChain>();
+
+  UpdateHandler handler1(Name("linux15.01"), keyChain, table1, face1);
+
+  BOOST_CHECK(handler1.needsUpdate());
+
+  auto i = table1->begin() + 1;
+  i->incrementSentInterests();
+  i->incrementSentInterests();
+  i->incrementReceivedData();
+
+  BOOST_CHECK(handler1.needsUpdate());
+
+  table1->insert(Name("isp4"));
+  table1->insert(Name("isp5"));
+
+  BOOST_CHECK(!handler1.needsUpdate());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace ntorrent
+} // namespace ndn
