diff --git a/tests/core/segment-publisher.t.cpp b/tests/core/segment-publisher.t.cpp
index b72c198..4223d19 100644
--- a/tests/core/segment-publisher.t.cpp
+++ b/tests/core/segment-publisher.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,7 @@
 #include <ndn-cxx/encoding/tlv.hpp>
 
 #include "tests/test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace nfd {
@@ -39,9 +40,9 @@
 {
 public:
   SegmentPublisherTester(ndn::util::DummyClientFace& face,
-                       const Name& prefix,
-                       ndn::KeyChain& keyChain,
-                       const time::milliseconds freshnessPeriod)
+                         const Name& prefix,
+                         ndn::KeyChain& keyChain,
+                         const time::milliseconds freshnessPeriod)
     : SegmentPublisher(face, prefix, keyChain, freshnessPeriod)
     , m_totalPayloadLength(0)
   {
@@ -49,9 +50,7 @@
   }
 
   virtual
-  ~SegmentPublisherTester()
-  {
-  }
+  ~SegmentPublisherTester() = default;
 
   uint16_t
   getLimit() const
@@ -71,10 +70,9 @@
   generate(ndn::EncodingBuffer& outBuffer)
   {
     size_t totalLength = 0;
-    for (int64_t i = 0; i < N; i++)
-      {
-        totalLength += prependNonNegativeIntegerBlock(outBuffer, tlv::Content, i);
-      }
+    for (int64_t i = 0; i < N; ++i) {
+      totalLength += prependNonNegativeIntegerBlock(outBuffer, tlv::Content, i);
+    }
     m_totalPayloadLength += totalLength;
     return totalLength;
   }
@@ -84,13 +82,13 @@
 };
 
 template<int64_t N>
-class SegmentPublisherFixture : public BaseFixture
+class SegmentPublisherFixture : public IdentityManagementFixture
 {
 public:
   SegmentPublisherFixture()
-    : m_face(ndn::util::makeDummyClientFace())
+    : m_face(m_keyChain)
     , m_expectedFreshnessPeriod(time::milliseconds(111))
-    , m_publisher(*m_face, "/localhost/nfd/SegmentPublisherFixture",
+    , m_publisher(m_face, "/localhost/nfd/SegmentPublisherFixture",
                   m_keyChain, m_expectedFreshnessPeriod)
   {
   }
@@ -106,10 +104,9 @@
     m_buffer.appendByteArray(payload.value(), payload.value_size());
 
     uint64_t segmentNo = data.getName()[-1].toSegment();
-    if (data.getFinalBlockId() != data.getName()[-1])
-      {
-        return;
-      }
+    if (data.getFinalBlockId() != data.getName()[-1]) {
+      return;
+    }
 
     NFD_LOG_DEBUG("got final block: #" << segmentNo);
 
@@ -125,18 +122,16 @@
     BOOST_REQUIRE_EQUAL(parser.elements_size(), m_publisher.getLimit());
 
     uint64_t expectedNo = m_publisher.getLimit() - 1;
-    for (Block::element_const_iterator i = parser.elements_begin();
-         i != parser.elements_end();
-         ++i)
-      {
-        uint64_t number = readNonNegativeInteger(*i);
+    std::for_each(parser.elements_begin(), parser.elements_end(),
+      [&expectedNo] (const Block& element) {
+        uint64_t number = readNonNegativeInteger(element);
         BOOST_REQUIRE_EQUAL(number, expectedNo);
         --expectedNo;
-      }
+      });
   }
 
 protected:
-  shared_ptr<ndn::util::DummyClientFace> m_face;
+  ndn::util::DummyClientFace m_face;
   const time::milliseconds m_expectedFreshnessPeriod;
   SegmentPublisherTester<N> m_publisher;
   ndn::EncodingBuffer m_buffer;
@@ -144,23 +139,22 @@
 };
 
 using boost::mpl::int_;
-typedef boost::mpl::vector<int_<10000>, int_<100>, int_<10>, int_<0> > DatasetSizes;
+typedef boost::mpl::vector<int_<10000>, int_<100>, int_<10>, int_<0>> DatasetSizes;
 
 BOOST_AUTO_TEST_SUITE(TestSegmentPublisher)
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Generate, T, DatasetSizes, SegmentPublisherFixture<T::value>)
 {
   this->m_publisher.publish();
-  this->m_face->processEvents();
+  this->m_face.processEvents();
 
-  size_t nSegments = this->m_publisher.getTotalPayloadLength() /
-                     this->m_publisher.getMaxSegmentSize();
-  if (this->m_publisher.getTotalPayloadLength() % this->m_publisher.getMaxSegmentSize() != 0 ||
-      nSegments == 0)
-    ++nSegments;
+  size_t nSegments =
+    this->m_publisher.getTotalPayloadLength() / this->m_publisher.getMaxSegmentSize() +
+    (this->m_publisher.getTotalPayloadLength() % this->m_publisher.getMaxSegmentSize() != 0 ||
+     this->m_publisher.getTotalPayloadLength() == 0);
 
-  BOOST_CHECK_EQUAL(this->m_face->sentDatas.size(), nSegments);
-  for (const Data& data : this->m_face->sentDatas) {
+  BOOST_CHECK_EQUAL(this->m_face.sentData.size(), nSegments);
+  for (const Data& data : this->m_face.sentData) {
     this->validate(data);
   }
 }
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index b827c85..fe6d147 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -27,6 +27,7 @@
 #include "fw/forwarder.hpp"
 
 #include "tests/test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
 
 #include <ndn-cxx/mgmt/dispatcher.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
@@ -46,8 +47,8 @@
 {
 public:
   FaceManagerNode(ndn::KeyChain& keyChain, const std::string& port = "6363")
-    : face(ndn::util::makeDummyClientFace(getGlobalIoService(), {true, true}))
-    , dispatcher(*face, keyChain, ndn::security::SigningInfo())
+    : face(getGlobalIoService(), keyChain, {true, true})
+    , dispatcher(face, keyChain, ndn::security::SigningInfo())
     , manager(forwarder.getFaceTable(), dispatcher, validator)
   {
     dispatcher.addTopPrefix("/localhost/nfd");
@@ -104,18 +105,19 @@
 
 public:
   Forwarder forwarder;
-  shared_ptr<ndn::util::DummyClientFace> face;
+  ndn::util::DummyClientFace face;
   ndn::mgmt::Dispatcher dispatcher;
   CommandValidator validator;
   FaceManager manager;
 };
 
 class FaceManagerFixture : public UnitTestTimeFixture
+                         , public IdentityManagementFixture
 {
 public:
   FaceManagerFixture()
-    : node1(keyChain, "16363")
-    , node2(keyChain, "26363")
+    : node1(m_keyChain, "16363")
+    , node2(m_keyChain, "26363")
   {
     advanceClocks(time::milliseconds(1), 100);
   }
@@ -128,7 +130,6 @@
   }
 
 public:
-  ndn::KeyChain keyChain;
   FaceManagerNode node1; // used to test FaceManager
   FaceManagerNode node2; // acts as a remote endpoint
 };
@@ -263,10 +264,10 @@
   commandName.append(FaceType().getParameters().wireEncode());
 
   shared_ptr<Interest> command(make_shared<Interest>(commandName));
-  this->keyChain.sign(*command);
+  m_keyChain.sign(*command);
 
   bool hasCallbackFired = false;
-  this->node1.face->onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
+  this->node1.face.onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
       // std::cout << response << std::endl;
       if (!command->getName().isPrefixOf(response.getName())) {
         return;
@@ -287,7 +288,7 @@
       hasCallbackFired = true;
     });
 
-  this->node1.face->receive(*command);
+  this->node1.face.receive(*command);
   this->advanceClocks(time::milliseconds(1), 100);
 
   BOOST_CHECK(hasCallbackFired);
@@ -314,9 +315,9 @@
     commandName.append(FaceType1().getParameters().wireEncode());
 
     shared_ptr<Interest> command(make_shared<Interest>(commandName));
-    this->keyChain.sign(*command);
+    m_keyChain.sign(*command);
 
-    this->node1.face->receive(*command);
+    this->node1.face.receive(*command);
     this->advanceClocks(time::milliseconds(1), 10);
   }
 
@@ -329,10 +330,10 @@
     commandName.append(FaceType2().getParameters().wireEncode());
 
     shared_ptr<Interest> command(make_shared<Interest>(commandName));
-    this->keyChain.sign(*command);
+    m_keyChain.sign(*command);
 
     bool hasCallbackFired = false;
-    this->node1.face->onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
+    this->node1.face.onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
         if (!command->getName().isPrefixOf(response.getName())) {
           return;
         }
@@ -347,7 +348,7 @@
         hasCallbackFired = true;
       });
 
-    this->node1.face->receive(*command);
+    this->node1.face.receive(*command);
     this->advanceClocks(time::milliseconds(1), 10);
 
     BOOST_CHECK(hasCallbackFired);
@@ -390,10 +391,10 @@
     commandName.append(OtherNodeFace().getParameters().wireEncode());
 
     shared_ptr<Interest> command(make_shared<Interest>(commandName));
-    this->keyChain.sign(*command);
+    m_keyChain.sign(*command);
 
     ndn::util::signal::ScopedConnection connection =
-      this->node2.face->onSendData.connect([this, command] (const Data& response) {
+      this->node2.face.onSendData.connect([this, command] (const Data& response) {
           if (!command->getName().isPrefixOf(response.getName())) {
             return;
           }
@@ -409,7 +410,7 @@
           face->sendInterest(*dummyInterest);
         });
 
-    this->node2.face->receive(*command);
+    this->node2.face.receive(*command);
     this->advanceClocks(time::milliseconds(1), 10);
   }
 
@@ -433,10 +434,10 @@
     commandName.append(FaceType().getParameters().wireEncode());
 
     shared_ptr<Interest> command(make_shared<Interest>(commandName));
-    this->keyChain.sign(*command);
+    m_keyChain.sign(*command);
 
     bool hasCallbackFired = false;
-    this->node1.face->onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
+    this->node1.face.onSendData.connect([this, command, &hasCallbackFired] (const Data& response) {
         if (!command->getName().isPrefixOf(response.getName())) {
           return;
         }
@@ -451,7 +452,7 @@
         hasCallbackFired = true;
       });
 
-    this->node1.face->receive(*command);
+    this->node1.face.receive(*command);
     this->advanceClocks(time::milliseconds(1), 10);
 
     BOOST_CHECK(hasCallbackFired);
diff --git a/tests/manager-common-fixture.cpp b/tests/manager-common-fixture.cpp
index cdf818d..a491296 100644
--- a/tests/manager-common-fixture.cpp
+++ b/tests/manager-common-fixture.cpp
@@ -29,9 +29,9 @@
 namespace tests {
 
 ManagerCommonFixture::ManagerCommonFixture()
-  : m_face(ndn::util::makeDummyClientFace(UnitTestTimeFixture::g_io, {true, true}))
-  , m_dispatcher(*m_face, m_keyChain, ndn::security::SigningInfo())
-  , m_responses(m_face->sentDatas)
+  : m_face(getGlobalIoService(), m_keyChain, {true, true})
+  , m_dispatcher(m_face, m_keyChain, ndn::security::SigningInfo())
+  , m_responses(m_face.sentData)
   , m_identityName("/unit-test/ManagerCommonFixture/identity")
   , m_certificate(m_keyChain.getCertificate(m_keyChain.createIdentity(m_identityName)))
 {
@@ -63,7 +63,7 @@
 void
 ManagerCommonFixture::receiveInterest(shared_ptr<Interest> interest)
 {
-  m_face->receive<Interest>(*interest);
+  m_face.receive(*interest);
   advanceClocks(time::milliseconds(1));
 }
 
diff --git a/tests/manager-common-fixture.hpp b/tests/manager-common-fixture.hpp
index aaa06f8..a29c441 100644
--- a/tests/manager-common-fixture.hpp
+++ b/tests/manager-common-fixture.hpp
@@ -143,11 +143,11 @@
   concatenateResponses(size_t startIndex = 0, size_t nResponses = 0);
 
 protected:
-  shared_ptr<ndn::util::DummyClientFace> m_face;
-  ndn::mgmt::Dispatcher                  m_dispatcher;
-  std::vector<Data>&                     m_responses; // a reference of m_face->sentDatas
-  Name                                   m_identityName; // the identity used to sign request
-  shared_ptr<ndn::IdentityCertificate>   m_certificate; // the certificate used to sign request
+  ndn::util::DummyClientFace m_face;
+  ndn::mgmt::Dispatcher m_dispatcher;
+  std::vector<Data>& m_responses; ///< a reference of m_face->sentData
+  Name m_identityName; ///< the identity used to sign request
+  shared_ptr<ndn::IdentityCertificate> m_certificate; ///< the certificate used to sign request
 };
 
 std::ostream&
diff --git a/tests/rib/auto-prefix-propagator.t.cpp b/tests/rib/auto-prefix-propagator.t.cpp
index 2429179..7db7510 100644
--- a/tests/rib/auto-prefix-propagator.t.cpp
+++ b/tests/rib/auto-prefix-propagator.t.cpp
@@ -33,20 +33,22 @@
 namespace rib {
 namespace tests {
 
+using namespace nfd::tests;
+
 NFD_LOG_INIT("AutoPrefixPropagatorTest");
 
 const Name TEST_LINK_LOCAL_NFD_PREFIX("/localhop/nfd");
 const time::milliseconds TEST_PREFIX_PROPAGATION_TIMEOUT(1000);
 
-class AutoPrefixPropagatorFixture : public nfd::tests::IdentityManagementFixture
-                                  , public nfd::tests::UnitTestTimeFixture
+class AutoPrefixPropagatorFixture : public IdentityManagementFixture
+                                  , public UnitTestTimeFixture
 {
 public:
   AutoPrefixPropagatorFixture()
-    : m_face(ndn::util::makeDummyClientFace(nfd::tests::UnitTestTimeFixture::g_io, {true, true}))
-    , m_controller(*m_face, m_keyChain)
+    : m_face(getGlobalIoService(), m_keyChain, {true, true})
+    , m_controller(m_face, m_keyChain)
     , m_propagator(m_controller, m_keyChain, m_rib)
-    , m_requests(m_face->sentInterests)
+    , m_requests(m_face.sentInterests)
     , m_entries(m_propagator.m_propagatedEntries)
   {
     m_propagator.enable();
@@ -173,12 +175,12 @@
   }
 
 protected:
-  shared_ptr<ndn::util::DummyClientFace>     m_face;
-  ndn::nfd::Controller                       m_controller;
-  Rib                                        m_rib;
-  AutoPrefixPropagator                       m_propagator;
-  std::vector<Interest>&                     m_requests; // store sent out requests
-  AutoPrefixPropagator::PropagatedEntryList& m_entries; // store propagated entries
+  ndn::util::DummyClientFace m_face;
+  ndn::nfd::Controller m_controller;
+  Rib m_rib;
+  AutoPrefixPropagator m_propagator;
+  std::vector<Interest>& m_requests; ///< store sent out requests
+  AutoPrefixPropagator::PropagatedEntryList& m_entries; ///< store propagated entries
 };
 
 std::ostream&
diff --git a/tests/rib/fib-updates-common.hpp b/tests/rib/fib-updates-common.hpp
index 34ae41d..1f293c6 100644
--- a/tests/rib/fib-updates-common.hpp
+++ b/tests/rib/fib-updates-common.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -23,8 +23,9 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "rib-test-common.hpp"
 #include "rib/fib-updater.hpp"
+#include "rib-test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
 
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
@@ -32,6 +33,8 @@
 namespace rib {
 namespace tests {
 
+using namespace nfd::tests;
+
 inline bool
 compareNameFaceIdCostAction(const FibUpdate& lhs, const FibUpdate& rhs)
 {
@@ -55,12 +58,12 @@
   return false;
 }
 
-class FibUpdatesFixture : public nfd::tests::BaseFixture
+class FibUpdatesFixture : public IdentityManagementFixture
 {
 public:
   FibUpdatesFixture()
-    : face(ndn::util::makeDummyClientFace())
-    , controller(*face, keyChain)
+    : face(getGlobalIoService(), m_keyChain)
+    , controller(face, m_keyChain)
     , fibUpdater(rib, controller)
   {
   }
@@ -163,8 +166,7 @@
   }
 
 public:
-  shared_ptr<ndn::util::DummyClientFace> face;
-  ndn::KeyChain keyChain;
+  ndn::util::DummyClientFace face;
   ndn::nfd::Controller controller;
   rib::FibUpdater fibUpdater;
   rib::Rib rib;
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 610c61d..30d1e1e 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -49,9 +49,9 @@
   explicit
   RibManagerFixture(const ConfigurationStatus& status,
                     bool shouldClearRib)
-    : m_commands(m_face->sentInterests)
+    : m_commands(m_face.sentInterests)
     , m_status(status)
-    , m_manager(m_dispatcher, *m_face, m_keyChain)
+    , m_manager(m_dispatcher, m_face, m_keyChain)
     , m_rib(m_manager.m_rib)
   {
     m_rib.m_onSendBatchFromQueue = bind(&RibManagerFixture::onSendBatchFromQueue, this, _1);
@@ -112,7 +112,7 @@
 
       m_keyChain.sign(*data, ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_SHA256));
 
-      m_face->getIoService().post([this, data] { m_face->receive(*data); });
+      m_face.getIoService().post([this, data] { m_face.receive(*data); });
     };
 
     Name commandPrefix("/localhost/nfd/fib/add-nexthop");
diff --git a/tests/rib/rib-status-publisher-common.hpp b/tests/rib/rib-status-publisher-common.hpp
index eee9a5e..3fc7fad 100644
--- a/tests/rib/rib-status-publisher-common.hpp
+++ b/tests/rib/rib-status-publisher-common.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,10 @@
 #define RIB_TESTS_UNIT_TESTS_RIB_STATUS_PUBLISHER_COMMON_HPP
 
 #include "rib/rib-status-publisher.hpp"
+#include "rib/rib.hpp"
 
 #include "tests/test-common.hpp"
-#include "rib/rib.hpp"
+#include "tests/identity-management-fixture.hpp"
 
 #include <ndn-cxx/management/nfd-control-parameters.hpp>
 #include <ndn-cxx/management/nfd-rib-entry.hpp>
@@ -40,9 +41,11 @@
 namespace rib {
 namespace tests {
 
+using namespace nfd::tests;
+
 using ndn::nfd::ControlParameters;
 
-class RibStatusPublisherFixture : public nfd::tests::BaseFixture
+class RibStatusPublisherFixture : public IdentityManagementFixture
 {
 public:
   static void
diff --git a/tests/rib/rib-status-publisher.t.cpp b/tests/rib/rib-status-publisher.t.cpp
index 55ba64f..9600d10 100644
--- a/tests/rib/rib-status-publisher.t.cpp
+++ b/tests/rib/rib-status-publisher.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2016,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -47,15 +47,14 @@
   route.flags = ndn::nfd::ROUTE_FLAG_CAPTURE;
   rib.insert(name, route);
 
-  ndn::KeyChain keyChain;
-  shared_ptr<ndn::util::DummyClientFace> face = ndn::util::makeDummyClientFace();
-  RibStatusPublisher publisher(rib, *face, "/localhost/nfd/rib/list", keyChain);
+  ndn::util::DummyClientFace face(getGlobalIoService(), m_keyChain);
+  RibStatusPublisher publisher(rib, face, "/localhost/nfd/rib/list", m_keyChain);
 
   publisher.publish();
-  face->processEvents(time::milliseconds(1));
+  face.processEvents(time::milliseconds(1));
 
-  BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
-  decodeRibEntryBlock(face->sentDatas[0], name, route);
+  BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
+  decodeRibEntryBlock(face.sentData[0], name, route);
 }
 
 
