diff --git a/tests/test-bloom-filter.cpp b/tests/test-bloom-filter.cpp
index 77a56a0..1788cd1 100644
--- a/tests/test-bloom-filter.cpp
+++ b/tests/test-bloom-filter.cpp
@@ -19,7 +19,8 @@
 
 #include "PSync/detail/bloom-filter.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/name.hpp>
 
 namespace psync {
@@ -42,18 +43,17 @@
   Name bfName("/test");
   BloomFilter bf(100, 0.001);
   bf.insert("/memphis");
-
   bf.appendToName(bfName);
 
-  BloomFilter bfFromName(100, 0.001, bfName.get(-1));
+  BloomFilter bfFromName(100, 0.001, bfName.at(-1));
 
-  BOOST_CHECK_EQUAL(bfName.get(1).toNumber(), 100);
-  BOOST_CHECK_EQUAL(bfName.get(2).toNumber(), 1);
+  BOOST_CHECK_EQUAL(bfName.at(1).toNumber(), 100);
+  BOOST_CHECK_EQUAL(bfName.at(2).toNumber(), 1);
   BOOST_CHECK_EQUAL(bf, bfFromName);
 
-  BOOST_CHECK_THROW(BloomFilter inCompatibleBf(200, 0.001, bfName.get(-1)), std::runtime_error);
+  BOOST_CHECK_THROW(BloomFilter(200, 0.001, bfName.at(-1)), std::runtime_error);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-consumer.cpp b/tests/test-consumer.cpp
index 9b08d53..e5560cd 100644
--- a/tests/test-consumer.cpp
+++ b/tests/test-consumer.cpp
@@ -18,36 +18,34 @@
  **/
 
 #include "PSync/consumer.hpp"
-#include "unit-test-time-fixture.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+#include "tests/unit-test-time-fixture.hpp"
+
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
 
 using namespace ndn;
-using namespace std;
 
 BOOST_AUTO_TEST_SUITE(TestConsumer)
 
 BOOST_AUTO_TEST_CASE(Constructor)
 {
   util::DummyClientFace face({true, true});
-  BOOST_REQUIRE_NO_THROW(Consumer(Name("/psync"),
-                                  face,
-                                  [] (const vector<Name>&) {},
-                                  [] (const vector<MissingDataInfo>&) {},
-                                  40,
-                                  0.001));
+  BOOST_REQUIRE_NO_THROW(Consumer(Name("/psync"), face,
+                                  [] (const std::vector<Name>&) {},
+                                  [] (const std::vector<MissingDataInfo>&) {},
+                                  40, 0.001));
 }
 
 BOOST_AUTO_TEST_CASE(AddSubscription)
 {
   util::DummyClientFace face({true, true});
   Consumer consumer(Name("/psync"), face,
-                    [] (const vector<Name>&) {},
-                    [] (const vector<MissingDataInfo>&) {},
+                    [] (const auto&) {},
+                    [] (const auto&) {},
                     40, 0.001);
 
   Name subscription("test");
@@ -57,12 +55,12 @@
   BOOST_CHECK(!consumer.addSubscription(subscription));
 }
 
-BOOST_FIXTURE_TEST_CASE(ConstantTimeoutForFirstSegment, ndn::tests::UnitTestTimeFixture)
+BOOST_FIXTURE_TEST_CASE(ConstantTimeoutForFirstSegment, tests::UnitTestTimeFixture)
 {
   util::DummyClientFace face(io, {true, true});
   Consumer consumer(Name("/psync"), face,
-                    [] (const vector<Name>&) {},
-                    [] (const vector<MissingDataInfo>&) {},
+                    [] (const auto&) {},
+                    [] (const auto&) {},
                     40, 0.001,
                     ndn::time::milliseconds(4000),
                     ndn::time::milliseconds(4000));
@@ -82,4 +80,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-full-producer.cpp b/tests/test-full-producer.cpp
index fc56a0c..33b5014 100644
--- a/tests/test-full-producer.cpp
+++ b/tests/test-full-producer.cpp
@@ -18,17 +18,17 @@
  **/
 
 #include "PSync/full-producer.hpp"
-#include "unit-test-time-fixture.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+#include "tests/unit-test-time-fixture.hpp"
+
 #include <ndn-cxx/name.hpp>
-#include <ndn-cxx/util/dummy-client-face.hpp>
 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
 
 using namespace ndn;
-using namespace std;
 
 BOOST_AUTO_TEST_SUITE(TestFullProducer)
 
@@ -51,7 +51,7 @@
   BOOST_REQUIRE_NO_THROW(node.onSyncInterest(syncPrefix, Interest(syncInterestName)));
 }
 
-BOOST_FIXTURE_TEST_CASE(ConstantTimeoutForFirstSegment, ndn::tests::UnitTestTimeFixture)
+BOOST_FIXTURE_TEST_CASE(ConstantTimeoutForFirstSegment, tests::UnitTestTimeFixture)
 {
   Name syncPrefix("/psync"), userNode("/testUser");
   util::DummyClientFace face(io, {true, true});
@@ -87,4 +87,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-full-sync.cpp b/tests/test-full-sync.cpp
index 1f5c6bb..38e7bf2 100644
--- a/tests/test-full-sync.cpp
+++ b/tests/test-full-sync.cpp
@@ -17,38 +17,35 @@
  * PSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "unit-test-time-fixture.hpp"
 #include "PSync/full-producer.hpp"
 #include "PSync/consumer.hpp"
 #include "PSync/detail/state.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+#include "tests/unit-test-time-fixture.hpp"
+
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
 
 using namespace ndn;
-using namespace std;
 
 class FullSyncFixture : public tests::UnitTestTimeFixture
 {
-public:
-  FullSyncFixture()
-   : syncPrefix("psync")
-  {
-  }
-
+protected:
   void
   addNode(int id)
   {
+    BOOST_ASSERT(id >= 0 && id <= 3);
     faces[id] = std::make_shared<util::DummyClientFace>(io, util::DummyClientFace::Options{true, true});
     userPrefixes[id] = Name("userPrefix" + to_string(id));
     nodes[id] = make_shared<FullProducer>(40, *faces[id], syncPrefix, userPrefixes[id],
-                                          [] (const std::vector<MissingDataInfo>& updates) {});
+                                          [] (const auto&) {});
   }
 
-  Name syncPrefix;
+protected:
+  const Name syncPrefix = "/psync";
   shared_ptr<util::DummyClientFace> faces[4];
   Name userPrefixes[4];
   shared_ptr<FullProducer> nodes[4];
@@ -134,7 +131,6 @@
   for (int i = 0; i < 4; i++) {
     addNode(i);
   }
-
   for (int i = 0; i < 3; i++) {
     faces[i]->linkTo(*faces[i + 1]);
   }
@@ -158,16 +154,14 @@
   }
 }
 
-BOOST_AUTO_TEST_CASE(MultipleNodesSimulataneousPublish)
+BOOST_AUTO_TEST_CASE(MultipleNodesSimultaneousPublish)
 {
   for (int i = 0; i < 4; i++) {
     addNode(i);
   }
-
   for (int i = 0; i < 3; i++) {
     faces[i]->linkTo(*faces[i + 1]);
   }
-
   for (int i = 0; i < 4; i++) {
     nodes[i]->publishName(userPrefixes[i]);
   }
@@ -196,7 +190,6 @@
   for (int i = 0; i < 4; i++) {
     addNode(i);
   }
-
   for (int i = 0; i < 3; i++) {
     faces[i]->linkTo(*faces[i + 1]);
   }
@@ -210,7 +203,6 @@
   for (int i = 0; i < 3; i++) {
     faces[i]->unlink();
   }
-
   faces[0]->linkTo(*faces[1]);
   faces[2]->linkTo(*faces[3]);
 
@@ -238,7 +230,6 @@
   for (int i = 0; i < 3; i++) {
     faces[i]->unlink();
   }
-
   for (int i = 0; i < 3; i++) {
     faces[i]->linkTo(*faces[i + 1]);
   }
@@ -369,7 +360,6 @@
   for (int i = 0; i < 4; i++) {
     addNode(i);
   }
-
   for (int i = 0; i < 3; i++) {
     faces[i]->linkTo(*faces[i + 1]);
   }
@@ -400,19 +390,17 @@
 
   int i = 0;
   State state;
-
-  std::shared_ptr<ndn::Buffer> compressed;
+  std::shared_ptr<Buffer> compressed;
   do {
     Name prefixToPublish("userNode0-" + to_string(i++));
     nodes[0]->addUserNode(prefixToPublish);
     nodes[0]->publishName(prefixToPublish);
 
-    state.addContent(ndn::Name(prefixToPublish).appendNumber(nodes[0]->m_prefixes[prefixToPublish]));
+    state.addContent(Name(prefixToPublish).appendNumber(nodes[0]->m_prefixes[prefixToPublish]));
 
     auto block = state.wireEncode();
     compressed = compress(nodes[0]->m_contentCompression, block.wire(), block.size());
-
-  } while (compressed->size() < (ndn::MAX_NDN_PACKET_SIZE >> 1));
+  } while (compressed->size() < (MAX_NDN_PACKET_SIZE >> 1));
 
   advanceClocks(ndn::time::milliseconds(10), 100);
 
@@ -430,6 +418,7 @@
   BOOST_CHECK_EQUAL(nodes[0]->m_segmentPublisher.m_ims.size(), 0);
 
   // Get data name from face and increase segment number to form next interest
+  BOOST_REQUIRE(!faces[0]->sentData.empty());
   Name dataName = faces[0]->sentData.front().getName();
   Name interestName = dataName.getSubName(0, dataName.size() - 2);
   interestName.appendSegment(1);
@@ -441,7 +430,8 @@
   // Should have repopulated SegmentPublisher
   BOOST_CHECK_EQUAL(nodes[0]->m_segmentPublisher.m_ims.size(), 2);
   // Should have received the second data segment this time
-  BOOST_CHECK_EQUAL(faces[0]->sentData.front().getName()[-1].toSegment(), 1);
+  BOOST_REQUIRE(!faces[0]->sentData.empty());
+  BOOST_CHECK_EQUAL(faces[0]->sentData.front().getName().at(-1).toSegment(), 1);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-iblt.cpp b/tests/test-iblt.cpp
index a2bb449..c689596 100644
--- a/tests/test-iblt.cpp
+++ b/tests/test-iblt.cpp
@@ -20,8 +20,8 @@
 #include "PSync/detail/iblt.hpp"
 #include "PSync/detail/util.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <ndn-cxx/name.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/interest.hpp>
 
 namespace psync {
@@ -71,40 +71,38 @@
 
 BOOST_AUTO_TEST_CASE(NameAppendAndExtract)
 {
-  int size = 10;
+  const int size = 10;
 
   IBLT iblt(size, CompressionScheme::DEFAULT);
-  std::string prefix = Name("/test/memphis").appendNumber(1).toUri();
-  uint32_t newHash = murmurHash3(11, prefix);
-  iblt.insert(newHash);
+  auto prefix = Name("/test/memphis").appendNumber(1).toUri();
+  auto hash = murmurHash3(11, prefix);
+  iblt.insert(hash);
 
-  Name ibltName("sync");
+  Name ibltName("/sync");
   iblt.appendToName(ibltName);
 
   IBLT rcvd(size, CompressionScheme::DEFAULT);
-  rcvd.initialize(ibltName.get(-1));
-
+  rcvd.initialize(ibltName.at(-1));
   BOOST_CHECK_EQUAL(iblt, rcvd);
 
   IBLT rcvdDiffSize(20, CompressionScheme::DEFAULT);
-  BOOST_CHECK_THROW(rcvdDiffSize.initialize(ibltName.get(-1)), IBLT::Error);
+  BOOST_CHECK_THROW(rcvdDiffSize.initialize(ibltName.at(-1)), IBLT::Error);
 
-  Name malformedName("test");
+  IBLT iblt2(size, CompressionScheme::NONE);
+  iblt2.insert(hash);
+  Name ibltName2("/sync");
+  iblt2.appendToName(ibltName2);
+  BOOST_CHECK_EQUAL_COLLECTIONS(IBF, IBF + sizeof(IBF),
+                                ibltName2.at(-1).wireEncode().begin(),
+                                ibltName2.at(-1).wireEncode().end());
+
+  Name malformedName("/test");
   auto compressed = compress(CompressionScheme::DEFAULT,
                              malformedName.wireEncode().value(),
                              malformedName.wireEncode().value_size());
-  IBLT rcvdDiffSize1(size, CompressionScheme::DEFAULT);
   malformedName.append(compressed->data(), compressed->size());
-  BOOST_CHECK_THROW(rcvdDiffSize1.initialize(malformedName.get(-1)), IBLT::Error);
-
-  IBLT iblt2(size, CompressionScheme::NONE);
-  iblt2.insert(newHash);
-  Name ibltName2("sync");
-  iblt2.appendToName(ibltName2);
-
-  BOOST_CHECK_EQUAL_COLLECTIONS(IBF, IBF + sizeof(IBF),
-                                ibltName2.get(-1).wireEncode().begin(),
-                                ibltName2.get(-1).wireEncode().end());
+  IBLT rcvd2(size, CompressionScheme::DEFAULT);
+  BOOST_CHECK_THROW(rcvd2.initialize(malformedName.at(-1)), IBLT::Error);
 }
 
 BOOST_AUTO_TEST_CASE(CopyInsertErase)
@@ -233,4 +231,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-partial-producer.cpp b/tests/test-partial-producer.cpp
index c55fd22..ffddac8 100644
--- a/tests/test-partial-producer.cpp
+++ b/tests/test-partial-producer.cpp
@@ -19,15 +19,15 @@
 
 #include "PSync/partial-producer.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/name.hpp>
-#include <ndn-cxx/util/dummy-client-face.hpp>
 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
 
 using namespace ndn;
-using namespace std;
 
 BOOST_AUTO_TEST_SUITE(TestPartialProducer)
 
@@ -46,12 +46,9 @@
   face.processEvents(time::milliseconds(-1));
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
-
-  face.sentInterests.back();
-  Interest interest = *face.sentInterests.begin();
-  BOOST_CHECK_EQUAL(interest.getName().get(3), name::Component("register"));
-  name::Component test = interest.getName().get(4);
-  nfd::ControlParameters params(test.blockFromValue());
+  auto interest = face.sentInterests.front();
+  BOOST_CHECK_EQUAL(interest.getName().at(3), name::Component("register"));
+  nfd::ControlParameters params(interest.getName().at(4).blockFromValue());
   BOOST_CHECK_EQUAL(params.getName(), syncPrefix);
 }
 
@@ -144,4 +141,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-partial-sync.cpp b/tests/test-partial-sync.cpp
index fae7958..31058ff 100644
--- a/tests/test-partial-sync.cpp
+++ b/tests/test-partial-sync.cpp
@@ -19,26 +19,26 @@
 
 #include "PSync/partial-producer.hpp"
 #include "PSync/consumer.hpp"
-#include "unit-test-time-fixture.hpp"
 
-#include <boost/test/unit_test.hpp>
+#include "tests/boost-test.hpp"
+#include "tests/unit-test-time-fixture.hpp"
+
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace psync {
 
 using namespace ndn;
-using namespace std;
 
 class PartialSyncFixture : public tests::UnitTestTimeFixture
 {
 public:
   PartialSyncFixture()
-   : face(io, {true, true})
-   , syncPrefix("psync")
-   , userPrefix("testUser-0")
-   , numHelloDataRcvd(0)
-   , numSyncDataRcvd(0)
+    : face(io, {true, true})
+    , syncPrefix("psync")
+    , userPrefix("testUser-0")
+    , numHelloDataRcvd(0)
+    , numSyncDataRcvd(0)
   {
     producer = make_shared<PartialProducer>(40, face, syncPrefix, userPrefix);
     addUserNodes("testUser", 10);
@@ -54,16 +54,16 @@
   }
 
   void
-  addConsumer(int id, const vector<string>& subscribeTo, bool linkToProducer = true)
+  addConsumer(int id, const std::vector<std::string>& subscribeTo, bool linkToProducer = true)
   {
-    consumerFaces[id] = make_shared<util::DummyClientFace>(io, util::DummyClientFace::Options{true, true});
+    consumerFaces[id] = std::make_shared<util::DummyClientFace>(io, util::DummyClientFace::Options{true, true});
 
     if (linkToProducer) {
       face.linkTo(*consumerFaces[id]);
     }
 
-    consumers[id] = make_shared<Consumer>(syncPrefix, *consumerFaces[id],
-                      [&, id] (const vector<Name>& availableSubs)
+    consumers[id] = std::make_shared<Consumer>(syncPrefix, *consumerFaces[id],
+                      [&, id] (const std::vector<Name>& availableSubs)
                       {
                         numHelloDataRcvd++;
                         BOOST_CHECK(checkSubList(availableSubs));
@@ -100,9 +100,9 @@
   }
 
   bool
-  checkSubList(const vector<Name>& availableSubs)
+  checkSubList(const std::vector<Name>& availableSubs) const
   {
-    for (const auto& prefix : producer->m_prefixes ) {
+    for (const auto& prefix : producer->m_prefixes) {
       if (std::find(availableSubs.begin(), availableSubs.end(), prefix.first) == availableSubs.end()) {
         return false;
       }
@@ -151,7 +151,7 @@
 
 BOOST_AUTO_TEST_CASE(Simple)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -168,7 +168,7 @@
 
 BOOST_AUTO_TEST_CASE(MissedUpdate)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -189,7 +189,7 @@
 
 BOOST_AUTO_TEST_CASE(LateSubscription)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -207,7 +207,7 @@
 
 BOOST_AUTO_TEST_CASE(ConsumerSyncTimeout)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -230,7 +230,7 @@
 
 BOOST_AUTO_TEST_CASE(MultipleConsumersWithSameSubList)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
   addConsumer(1, subscribeTo);
   addConsumer(2, subscribeTo);
@@ -251,13 +251,13 @@
 
 BOOST_AUTO_TEST_CASE(MultipleConsumersWithDifferentSubList)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
-  vector<string> subscribeTo1{"testUser-1", "testUser-3", "testUser-5"};
+  std::vector<std::string> subscribeTo1{"testUser-1", "testUser-3", "testUser-5"};
   addConsumer(1, subscribeTo1);
 
-  vector<string> subscribeTo2{"testUser-2", "testUser-3"};
+  std::vector<std::string> subscribeTo2{"testUser-2", "testUser-3"};
   addConsumer(2, subscribeTo2);
 
   consumers[0]->sendHelloInterest();
@@ -277,7 +277,7 @@
 
 BOOST_AUTO_TEST_CASE(ReplicatedProducer)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -316,7 +316,7 @@
   // 50 is more than expected number of entries of 40 in the producer's IBF
   addUserNodes("testUser", 50);
 
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   consumers[0]->sendHelloInterest();
@@ -354,7 +354,7 @@
 
 BOOST_AUTO_TEST_CASE(SegmentedHello)
 {
-  vector<string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
+  std::vector<std::string> subscribeTo{"testUser-2", "testUser-4", "testUser-6"};
   addConsumer(0, subscribeTo);
 
   addUserNodes("testUser", 400);
@@ -364,6 +364,7 @@
   BOOST_CHECK_EQUAL(numHelloDataRcvd, 1);
 
   // Simulate sending delayed interest for second segment
+  BOOST_REQUIRE(!face.sentData.empty());
   Name dataName = face.sentData.back().getName();
   face.sentData.clear();
   BOOST_CHECK_EQUAL(producer->m_segmentPublisher.m_ims.size(), 2);
@@ -374,7 +375,8 @@
   producer->onHelloInterest(consumers[0]->m_helloInterestPrefix, Interest(dataName));
   advanceClocks(ndn::time::milliseconds(10));
   BOOST_CHECK_EQUAL(producer->m_segmentPublisher.m_ims.size(), 2);
-  BOOST_CHECK_EQUAL(face.sentData.front().getName()[-1].toSegment(), 1);
+  BOOST_REQUIRE(!face.sentData.empty());
+  BOOST_CHECK_EQUAL(face.sentData.front().getName().at(-1).toSegment(), 1);
 }
 
 BOOST_AUTO_TEST_CASE(SegmentedSync)
@@ -385,7 +387,7 @@
   }
   addUserNodes(longNameToExceedDataSize.toUri(), 10);
 
-  vector<string> subscribeTo;
+  std::vector<std::string> subscribeTo;
   for (int i = 1; i < 10; i++) {
     subscribeTo.push_back(longNameToExceedDataSize.toUri() + "-" + to_string(i));
   }
@@ -425,7 +427,8 @@
   producer->onSyncInterest(consumers[0]->m_syncInterestPrefix, Interest(syncInterestName));
   advanceClocks(ndn::time::milliseconds(10));
   BOOST_CHECK_EQUAL(producer->m_segmentPublisher.m_ims.size(), 2);
-  BOOST_CHECK_EQUAL(face.sentData.front().getName()[-1].toSegment(), 1);
+  BOOST_REQUIRE(!face.sentData.empty());
+  BOOST_CHECK_EQUAL(face.sentData.front().getName().at(-1).toSegment(), 1);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-producer-base.cpp b/tests/test-producer-base.cpp
index c5f1112..e3a813c 100644
--- a/tests/test-producer-base.cpp
+++ b/tests/test-producer-base.cpp
@@ -20,8 +20,8 @@
 #include "PSync/producer-base.hpp"
 #include "PSync/detail/util.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <ndn-cxx/name.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/interest.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
@@ -75,10 +75,9 @@
   producerBase.m_syncReplyFreshness = time::milliseconds(1000);
   producerBase.sendApplicationNack(Name("test"));
   face.processEvents(time::milliseconds(10));
-  BOOST_CHECK_EQUAL(face.sentData.size(), 1);
 
-  Data data = *face.sentData.begin();
-  BOOST_CHECK_EQUAL(data.getContentType(), ndn::tlv::ContentType_Nack);
+  BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
+  BOOST_CHECK_EQUAL(face.sentData.front().getContentType(), ndn::tlv::ContentType_Nack);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-segment-publisher.cpp b/tests/test-segment-publisher.cpp
index 46e6c5c..55db765 100644
--- a/tests/test-segment-publisher.cpp
+++ b/tests/test-segment-publisher.cpp
@@ -19,10 +19,10 @@
 
 #include "PSync/segment-publisher.hpp"
 #include "PSync/detail/state.hpp"
-#include "unit-test-time-fixture.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <ndn-cxx/name.hpp>
+#include "tests/boost-test.hpp"
+#include "tests/unit-test-time-fixture.hpp"
+
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/interest.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
diff --git a/tests/test-state.cpp b/tests/test-state.cpp
index 6d7239c..3f04c8b 100644
--- a/tests/test-state.cpp
+++ b/tests/test-state.cpp
@@ -19,8 +19,8 @@
 
 #include "PSync/detail/state.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <ndn-cxx/name.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/data.hpp>
 
 namespace psync {
@@ -90,4 +90,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
diff --git a/tests/test-util.cpp b/tests/test-util.cpp
index 2ec1de8..bea4e68 100644
--- a/tests/test-util.cpp
+++ b/tests/test-util.cpp
@@ -18,17 +18,11 @@
  **/
 
 #include "PSync/detail/util.hpp"
-#include "PSync/detail/config.hpp"
-#include "unit-test-time-fixture.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <iostream>
+#include "tests/boost-test.hpp"
 
 namespace psync {
 
-using namespace ndn;
-using namespace std;
-
 BOOST_AUTO_TEST_SUITE(TestUtil)
 
 BOOST_AUTO_TEST_CASE(Basic)
@@ -76,4 +70,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync
