diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 051d7c9..3c2d59d 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -27,22 +27,15 @@
 
 #include "manager-common-fixture.hpp"
 
-#include <boost/filesystem.hpp>
-
 namespace nfd::tests {
 
-class CommandAuthenticatorFixture : public CommandInterestSignerFixture
+class CommandAuthenticatorFixture : public InterestSignerFixture
 {
 protected:
-  CommandAuthenticatorFixture()
-    : authenticator(CommandAuthenticator::create())
-  {
-  }
-
   void
   makeModules(std::initializer_list<std::string> modules)
   {
-    for (const std::string& module : modules) {
+    for (const auto& module : modules) {
       authorizations.emplace(module, authenticator->makeAuthorization(module, "verb"));
     }
   }
@@ -50,10 +43,9 @@
   void
   loadConfig(const std::string& config)
   {
-    auto configPath = boost::filesystem::current_path() / "command-authenticator-test.conf";
     ConfigFile cf;
     authenticator->setConfigFile(cf);
-    cf.parse(config, false, configPath.c_str());
+    cf.parse(config, false, "command-authenticator-test.conf");
   }
 
   bool
@@ -66,7 +58,7 @@
       modifyInterest(interest);
     }
 
-    ndn::mgmt::Authorization authorization = authorizations.at(module);
+    const auto& authorization = authorizations.at(module);
 
     bool isAccepted = false;
     bool isRejected = false;
@@ -91,7 +83,7 @@
   }
 
 protected:
-  shared_ptr<CommandAuthenticator> authenticator;
+  shared_ptr<CommandAuthenticator> authenticator = CommandAuthenticator::create();
   std::unordered_map<std::string, ndn::mgmt::Authorization> authorizations;
   std::string lastRequester;
   ndn::mgmt::RejectReply lastRejectReply;
@@ -110,7 +102,7 @@
   BOOST_REQUIRE(saveIdentityCert(id2, "2.ndncert", true));
 
   makeModules({"module0", "module1", "module2", "module3", "module4", "module5", "module6", "module7"});
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
@@ -199,7 +191,7 @@
   BOOST_REQUIRE(saveIdentityCert(id1, "1.ndncert", true));
 
   makeModules({"module0", "module1"});
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
@@ -238,12 +230,11 @@
 {
 protected:
   IdentityAuthorizedFixture()
-    : id1("/localhost/CommandAuthenticator/1")
   {
     BOOST_REQUIRE(saveIdentityCert(id1, "1.ndncert", true));
 
     makeModules({"module1"});
-    const std::string& config = R"CONFIG(
+    const std::string config = R"CONFIG(
       authorizations
       {
         authorize
@@ -266,10 +257,10 @@
   }
 
 protected:
-  Name id1;
+  const Name id1{"/localhost/CommandAuthenticator/1"};
 };
 
-BOOST_FIXTURE_TEST_SUITE(Rejects, IdentityAuthorizedFixture)
+BOOST_FIXTURE_TEST_SUITE(Reject, IdentityAuthorizedFixture)
 
 BOOST_AUTO_TEST_CASE(BadKeyLocator_NameTooShort)
 {
@@ -281,7 +272,7 @@
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT);
 }
 
-BOOST_AUTO_TEST_CASE(BadKeyLocator_BadSigInfo)
+BOOST_AUTO_TEST_CASE(BadSigInfo)
 {
   BOOST_CHECK_EQUAL(authorize1(
     [] (Interest& interest) {
@@ -291,7 +282,7 @@
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT);
 }
 
-BOOST_AUTO_TEST_CASE(BadKeyLocator_MissingKeyLocator)
+BOOST_AUTO_TEST_CASE(MissingKeyLocator)
 {
   BOOST_CHECK_EQUAL(authorize1(
     [] (Interest& interest) {
@@ -302,7 +293,7 @@
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT);
 }
 
-BOOST_AUTO_TEST_CASE(BadKeyLocator_BadKeyLocatorType)
+BOOST_AUTO_TEST_CASE(BadKeyLocatorType)
 {
   BOOST_CHECK_EQUAL(authorize1(
     [] (Interest& interest) {
@@ -364,13 +355,13 @@
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::STATUS403);
 }
 
-BOOST_AUTO_TEST_SUITE_END() // Rejects
+BOOST_AUTO_TEST_SUITE_END() // Reject
 
 BOOST_AUTO_TEST_SUITE(BadConfig)
 
 BOOST_AUTO_TEST_CASE(EmptyAuthorizationsSection)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
     }
@@ -381,7 +372,7 @@
 
 BOOST_AUTO_TEST_CASE(UnrecognizedKey)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       unrecognized_key
@@ -395,7 +386,7 @@
 
 BOOST_AUTO_TEST_CASE(CertfileMissing)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
@@ -412,7 +403,7 @@
 
 BOOST_AUTO_TEST_CASE(CertUnreadable)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
@@ -430,7 +421,7 @@
 
 BOOST_AUTO_TEST_CASE(PrivilegesMissing)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
@@ -445,7 +436,7 @@
 
 BOOST_AUTO_TEST_CASE(UnregisteredModule)
 {
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
diff --git a/tests/daemon/mgmt/cs-manager.t.cpp b/tests/daemon/mgmt/cs-manager.t.cpp
index 4f7b51b..fa9b6c5 100644
--- a/tests/daemon/mgmt/cs-manager.t.cpp
+++ b/tests/daemon/mgmt/cs-manager.t.cpp
@@ -63,7 +63,7 @@
   m_cs.enableServe(true);
 
   // send empty cs/config command
-  auto req = makeControlCommandRequest(cmdPrefix, ControlParameters());
+  auto req = makeControlCommandRequest(cmdPrefix);
   receiveInterest(req);
 
   // response shall reflect current config
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index de28f3b..ad354f3 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.hpp
@@ -57,12 +57,12 @@
   FaceManager manager;
 };
 
-class FaceManagerCommandFixture : public CommandInterestSignerFixture
+class FaceManagerCommandFixture : public InterestSignerFixture
 {
 public:
   FaceManagerCommandFixture();
 
-  ~FaceManagerCommandFixture();
+  ~FaceManagerCommandFixture() override;
 
 public:
   FaceManagerCommandNode node1; // used to test FaceManager
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index dba2dd8..ce74b1c 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -27,11 +27,6 @@
 
 #include "manager-common-fixture.hpp"
 
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/security/pib/identity.hpp>
-#include <ndn-cxx/security/pib/key.hpp>
-#include <ndn-cxx/security/pib/pib.hpp>
-
 namespace nfd::tests {
 
 class TestCommandVoidParameters : public ControlCommand
@@ -86,35 +81,35 @@
 
 BOOST_AUTO_TEST_CASE(RegisterCommandHandler)
 {
-  bool wasCommandHandlerCalled = false;
-  auto handler = [&] (auto&&...) { wasCommandHandlerCalled = true; };
+  bool wasHandlerCalled = false;
+  auto handler = [&] (auto&&...) { wasHandlerCalled = true; };
 
   m_manager.registerCommandHandler<TestCommandVoidParameters>("test-void", handler);
   m_manager.registerCommandHandler<TestCommandRequireName>("test-require-name", handler);
   setTopPrefix();
 
-  auto testRegisterCommandHandler = [&wasCommandHandlerCalled, this] (const Name& commandName) {
-    wasCommandHandlerCalled = false;
-    receiveInterest(makeControlCommandRequest(commandName, ControlParameters()));
+  auto testRegisterCommandHandler = [&] (const Name& commandName) {
+    wasHandlerCalled = false;
+    receiveInterest(makeControlCommandRequest(commandName));
   };
 
   testRegisterCommandHandler("/localhost/nfd/test-module/test-void");
-  BOOST_CHECK(wasCommandHandlerCalled);
+  BOOST_CHECK(wasHandlerCalled);
 
   testRegisterCommandHandler("/localhost/nfd/test-module/test-require-name");
-  BOOST_CHECK(!wasCommandHandlerCalled);
+  BOOST_CHECK(!wasHandlerCalled);
 }
 
 BOOST_AUTO_TEST_CASE(RegisterStatusDataset)
 {
-  bool isStatusDatasetCalled = false;
-  auto handler = [&] (auto&&...) { isStatusDatasetCalled = true; };
+  bool wasHandlerCalled = false;
+  auto handler = [&] (auto&&...) { wasHandlerCalled = true; };
 
   m_manager.registerStatusDatasetHandler("test-status", handler);
   setTopPrefix();
 
   receiveInterest(*makeInterest("/localhost/nfd/test-module/test-status", true));
-  BOOST_CHECK(isStatusDatasetCalled);
+  BOOST_CHECK(wasHandlerCalled);
 }
 
 BOOST_AUTO_TEST_CASE(RegisterNotificationStream)
@@ -136,13 +131,13 @@
   auto testAccept = [&] (const std::string& requester) { requesterName = requester; };
 
   m_manager.extractRequester(Interest("/test/interest/unsigned"), testAccept);
-  BOOST_CHECK(requesterName.empty());
+  BOOST_CHECK_EQUAL(requesterName, "");
 
-  requesterName = "";
-  m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed", ControlParameters()), testAccept);
+  requesterName.clear();
+  m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed"), testAccept);
   BOOST_CHECK_EQUAL(requesterName,
-    m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY)
-      .getDefaultKey().getDefaultCertificate().getName().toUri());
+                    m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY)
+                    .getDefaultKey().getDefaultCertificate().getName().toUri());
 }
 
 BOOST_AUTO_TEST_CASE(ValidateParameters)
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
index 8be600c..b427a3e 100644
--- a/tests/daemon/mgmt/manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -27,34 +27,26 @@
 
 namespace nfd::tests {
 
-CommandInterestSignerFixture::CommandInterestSignerFixture()
-  : m_signer(m_keyChain)
+InterestSignerFixture::InterestSignerFixture()
 {
   BOOST_REQUIRE(m_keyChain.createIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY));
 }
 
 Interest
-CommandInterestSignerFixture::makeCommandInterest(const Name& name, const Name& identity)
+InterestSignerFixture::makeCommandInterest(const Name& name, const Name& identity)
 {
   return m_signer.makeCommandInterest(name, ndn::security::signingByIdentity(identity));
 }
 
 Interest
-CommandInterestSignerFixture::makeControlCommandRequest(Name commandName,
-                                                        const ControlParameters& params,
-                                                        const Name& identity)
+InterestSignerFixture::makeControlCommandRequest(Name commandName,
+                                                 const ControlParameters& params,
+                                                 const Name& identity)
 {
   commandName.append(tlv::GenericNameComponent, params.wireEncode());
   return this->makeCommandInterest(commandName, identity);
 }
 
-ManagerCommonFixture::ManagerCommonFixture()
-  : m_face(g_io, m_keyChain, {true, true})
-  , m_dispatcher(m_face, m_keyChain, ndn::security::SigningInfo())
-  , m_responses(m_face.sentData)
-{
-}
-
 void
 ManagerCommonFixture::setTopPrefix()
 {
@@ -192,7 +184,7 @@
 {
   saveIdentityCert(DEFAULT_COMMAND_SIGNER_IDENTITY, "ManagerCommonFixture.ndncert");
 
-  const std::string& config = R"CONFIG(
+  const std::string config = R"CONFIG(
     authorizations
     {
       authorize
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
index 79923a0..2ae3b85 100644
--- a/tests/daemon/mgmt/manager-common-fixture.hpp
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -38,12 +38,13 @@
 
 namespace nfd::tests {
 
-/** \brief A fixture that wraps an InterestSigner.
+/**
+ * \brief A fixture that wraps an InterestSigner.
  */
-class CommandInterestSignerFixture : public GlobalIoTimeFixture, public KeyChainFixture
+class InterestSignerFixture : public GlobalIoTimeFixture, public KeyChainFixture
 {
 protected:
-  CommandInterestSignerFixture();
+  InterestSignerFixture();
 
   /** \brief sign a command Interest
    *  \param name command name include prefix and parameters
@@ -60,24 +61,23 @@
    *  \return a command Interest
    */
   Interest
-  makeControlCommandRequest(Name commandName, const ControlParameters& params,
+  makeControlCommandRequest(Name commandName,
+                            const ControlParameters& params = {},
                             const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
 
 protected:
-  static inline const Name DEFAULT_COMMAND_SIGNER_IDENTITY{"/CommandInterestSignerFixture-identity"};
+  static inline const Name DEFAULT_COMMAND_SIGNER_IDENTITY{"/InterestSignerFixture-identity"};
 
 private:
-  ndn::security::InterestSigner m_signer;
+  ndn::security::InterestSigner m_signer{m_keyChain};
 };
 
 /**
  * @brief A collection of common functions shared by all manager's test fixtures.
  */
-class ManagerCommonFixture : public CommandInterestSignerFixture
+class ManagerCommonFixture : public InterestSignerFixture
 {
 public: // initialize
-  ManagerCommonFixture();
-
   /**
    * @brief Add `/localhost/nfd` as a top prefix to the dispatcher.
    *
@@ -99,11 +99,10 @@
   receiveInterest(const Interest& interest);
 
 public: // verify
-  ControlResponse
+  static ControlResponse
   makeResponse(uint32_t code, const std::string& text, const ControlParameters& parameters);
 
-  enum class CheckResponseResult
-  {
+  enum class CheckResponseResult {
     OK,
     OUT_OF_BOUNDARY,
     WRONG_NAME,
@@ -153,9 +152,9 @@
   concatenateResponses(size_t startIndex = 0, size_t nResponses = 0);
 
 protected:
-  ndn::util::DummyClientFace m_face;
-  Dispatcher m_dispatcher;
-  std::vector<Data>& m_responses; ///< a reference to m_face.sentData
+  ndn::util::DummyClientFace m_face{g_io, m_keyChain, {true, true}};
+  Dispatcher m_dispatcher{m_face, m_keyChain};
+  std::vector<Data>& m_responses{m_face.sentData};
 };
 
 std::ostream&
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 9a06393..78589a2 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -135,12 +135,14 @@
     ndn::security::MakeCertificateOptions opts;
     opts.validity = derivedSelfSigned.getValidityPeriod();
     auto derivedCert = m_keyChain.makeCertificate(derivedSelfSigned,
-                       ndn::security::signingByIdentity(anchorIdentity), opts);
+                                                  ndn::security::signingByIdentity(anchorIdentity),
+                                                  opts);
     m_keyChain.setDefaultCertificate(derivedKey, derivedCert);
 
     if (m_status.isLocalhostConfigured) {
       m_manager.applyLocalhostConfig(getValidatorConfigSection(), "test");
     }
+
     if (m_status.isLocalhopConfigured) {
       m_manager.enableLocalhop(getLocalhopValidatorConfigSection(), "test");
     }
@@ -173,19 +175,20 @@
     auto replyFibAddCommand = [this] (const Interest& interest) {
       ControlParameters params(interest.getName().get(-5).blockFromValue());
       BOOST_CHECK(params.getName() == "/localhost/nfd/rib" || params.getName() == "/localhop/nfd/rib");
-      params.setFaceId(1).setCost(0);
+      params.setFaceId(1)
+            .setCost(0);
       ControlResponse resp;
+      resp.setCode(200)
+          .setBody(params.wireEncode());
 
-      resp.setCode(200).setBody(params.wireEncode());
-      shared_ptr<Data> data = make_shared<Data>(interest.getName());
+      auto data = make_shared<Data>(interest.getName());
       data->setContent(resp.wireEncode());
-
       m_keyChain.sign(*data, ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_SHA256));
 
       m_face.getIoService().post([this, data] { m_face.receive(*data); });
     };
 
-    Name commandPrefix("/localhost/nfd/fib/add-nexthop");
+    const Name commandPrefix("/localhost/nfd/fib/add-nexthop");
     for (const auto& command : m_face.sentInterests) {
       if (commandPrefix.isPrefixOf(command.getName())) {
         replyFibAddCommand(command);
