diff --git a/tests/daemon/fw/choose-strategy.hpp b/tests/daemon/fw/choose-strategy.hpp
new file mode 100644
index 0000000..9ecc54b
--- /dev/null
+++ b/tests/daemon/fw/choose-strategy.hpp
@@ -0,0 +1,64 @@
+/* -*- 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/>.
+ */
+
+#ifndef NFD_TESTS_DAEMON_FW_CHOOSE_STRATEGY_HPP
+#define NFD_TESTS_DAEMON_FW_CHOOSE_STRATEGY_HPP
+
+#include "fw/forwarder.hpp"
+#include "table/strategy-choice.hpp"
+
+namespace nfd {
+namespace fw {
+class Strategy;
+} // namespace fw
+
+namespace tests {
+
+/** \brief choose the strategy for a namespace
+ *  \tparam S strategy type, must be a complete type
+ *  \param forwarder the forwarder
+ *  \param prefix namespace to choose the strategy for
+ *  \param instanceName strategy instance name; the strategy must already be registered
+ *  \throw std::invalid_argument cannot find strategy by instanceName
+ *  \throw std::bad_cast strategy type is incompatible with S
+ *  \return a reference to the strategy
+ */
+template<typename S>
+typename std::enable_if<std::is_base_of<fw::Strategy, S>::value, S&>::type
+choose(Forwarder& forwarder, const Name& prefix = "/",
+       const Name& instanceName = S::getStrategyName())
+{
+  StrategyChoice& sc = forwarder.getStrategyChoice();
+  bool isInserted = sc.insert(prefix, instanceName);
+  if (!isInserted) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("cannot create strategy"));
+  }
+  return dynamic_cast<S&>(sc.findEffectiveStrategy(prefix));
+}
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_DAEMON_FW_CHOOSE_STRATEGY_HPP
diff --git a/tests/daemon/fw/dummy-strategy.cpp b/tests/daemon/fw/dummy-strategy.cpp
new file mode 100644
index 0000000..f806d08
--- /dev/null
+++ b/tests/daemon/fw/dummy-strategy.cpp
@@ -0,0 +1,90 @@
+/* -*- 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 "dummy-strategy.hpp"
+
+namespace nfd {
+namespace tests {
+
+NFD_REGISTER_STRATEGY(DummyStrategy);
+
+void
+DummyStrategy::registerAs(const Name& strategyName)
+{
+  registerAsImpl<DummyStrategy>(strategyName);
+}
+
+Name
+DummyStrategy::getStrategyName(uint64_t version)
+{
+  return Name("/dummy-strategy").appendVersion(version);
+}
+
+DummyStrategy::DummyStrategy(Forwarder& forwarder, const Name& name)
+  : Strategy(forwarder)
+  , afterReceiveInterest_count(0)
+  , beforeSatisfyInterest_count(0)
+  , beforeExpirePendingInterest_count(0)
+  , afterReceiveNack_count(0)
+{
+  this->setInstanceName(name);
+}
+
+void
+DummyStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
+                                    const shared_ptr<pit::Entry>& pitEntry)
+{
+  ++afterReceiveInterest_count;
+
+  if (interestOutFace != nullptr) {
+    this->sendInterest(pitEntry, *interestOutFace, interest);
+  }
+  else {
+    this->rejectPendingInterest(pitEntry);
+  }
+}
+
+void
+DummyStrategy::beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
+                                     const Face& inFace, const Data& data)
+{
+  ++beforeSatisfyInterest_count;
+}
+
+void
+DummyStrategy::beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry)
+{
+  ++beforeExpirePendingInterest_count;
+}
+
+void
+DummyStrategy::afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+                                const shared_ptr<pit::Entry>& pitEntry)
+{
+  ++afterReceiveNack_count;
+}
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index a6af8ac..6d4d45d 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -33,28 +33,27 @@
 
 /** \brief strategy for unit testing
  *
- *  Unless otherwise indicated, triggers are recorded but does nothing.
+ *  Triggers are recorded but do nothing.
+ *
+ *  DummyStrategy registers itself as /dummy-strategy/<max-version>, so that it can be instantiated
+ *  with any version number. Aliases can be created with \p registerAs function.
  */
 class DummyStrategy : public fw::Strategy
 {
 public:
   static void
-  registerAs(const Name& name)
-  {
-    if (!fw::Strategy::canCreate(name)) {
-      fw::Strategy::registerType<DummyStrategy>(name);
-    }
-  }
+  registerAs(const Name& strategyName);
 
-  DummyStrategy(Forwarder& forwarder, const Name& name)
-    : Strategy(forwarder)
-    , afterReceiveInterest_count(0)
-    , beforeSatisfyInterest_count(0)
-    , beforeExpirePendingInterest_count(0)
-    , afterReceiveNack_count(0)
-  {
-    this->setInstanceName(name);
-  }
+  static Name
+  getStrategyName(uint64_t version = std::numeric_limits<uint64_t>::max());
+
+  /** \brief constructor
+   *
+   *  \p name is recorded unchanged as \p getInstanceName() , and will not automatically
+   *  gain a version number when instantiated without a version number.
+   */
+  explicit
+  DummyStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
 
   /** \brief after receive Interest trigger
    *
@@ -63,36 +62,30 @@
    */
   void
   afterReceiveInterest(const Face& inFace, const Interest& interest,
-                       const shared_ptr<pit::Entry>& pitEntry) override
-  {
-    ++afterReceiveInterest_count;
-
-    if (interestOutFace != nullptr) {
-      this->sendInterest(pitEntry, *interestOutFace, interest);
-    }
-    else {
-      this->rejectPendingInterest(pitEntry);
-    }
-  }
+                       const shared_ptr<pit::Entry>& pitEntry) override;
 
   void
   beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
-                        const Face& inFace, const Data& data) override
-  {
-    ++beforeSatisfyInterest_count;
-  }
+                        const Face& inFace, const Data& data) override;
 
   void
-  beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry) override
-  {
-    ++beforeExpirePendingInterest_count;
-  }
+  beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry) override;
 
   void
   afterReceiveNack(const Face& inFace, const lp::Nack& nack,
-                   const shared_ptr<pit::Entry>& pitEntry) override
+                   const shared_ptr<pit::Entry>& pitEntry) override;
+
+protected:
+  /** \brief register an alias
+   *  \tparam S subclass of DummyStrategy
+   */
+  template<typename S>
+  static void
+  registerAsImpl(const Name& strategyName)
   {
-    ++afterReceiveNack_count;
+    if (!fw::Strategy::canCreate(strategyName)) {
+      fw::Strategy::registerType<S>(strategyName);
+    }
   }
 
 public:
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 11ef06b..37cb5f9 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -26,7 +26,7 @@
 #include "fw/forwarder.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
 #include "dummy-strategy.hpp"
-#include "install-strategy.hpp"
+#include "choose-strategy.hpp"
 #include <ndn-cxx/lp/tags.hpp>
 
 #include "tests/test-common.hpp"
@@ -256,32 +256,32 @@
   forwarder.addFace(face1);
   forwarder.addFace(face2);
 
-  DummyStrategy& strategyP = choose<DummyStrategy>(forwarder, "ndn:/", "ndn:/strategyP");
-  DummyStrategy& strategyQ = choose<DummyStrategy>(forwarder, "ndn:/B", "ndn:/strategyQ");
+  DummyStrategy& strategyA = choose<DummyStrategy>(forwarder, "ndn:/", DummyStrategy::getStrategyName());
+  DummyStrategy& strategyB = choose<DummyStrategy>(forwarder, "ndn:/B", DummyStrategy::getStrategyName());
 
   shared_ptr<Interest> interest1 = makeInterest("ndn:/A/1");
-  strategyP.afterReceiveInterest_count = 0;
-  strategyP.interestOutFace = face2;
+  strategyA.afterReceiveInterest_count = 0;
+  strategyA.interestOutFace = face2;
   forwarder.startProcessInterest(*face1, *interest1);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveInterest_count, 1);
 
   shared_ptr<Interest> interest2 = makeInterest("ndn:/B/2");
-  strategyQ.afterReceiveInterest_count = 0;
-  strategyQ.interestOutFace = face2;
+  strategyB.afterReceiveInterest_count = 0;
+  strategyB.interestOutFace = face2;
   forwarder.startProcessInterest(*face1, *interest2);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveInterest_count, 1);
 
   this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
 
   shared_ptr<Data> data1 = makeData("ndn:/A/1/a");
-  strategyP.beforeSatisfyInterest_count = 0;
+  strategyA.beforeSatisfyInterest_count = 0;
   forwarder.startProcessData(*face2, *data1);
-  BOOST_CHECK_EQUAL(strategyP.beforeSatisfyInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyA.beforeSatisfyInterest_count, 1);
 
   shared_ptr<Data> data2 = makeData("ndn:/B/2/b");
-  strategyQ.beforeSatisfyInterest_count = 0;
+  strategyB.beforeSatisfyInterest_count = 0;
   forwarder.startProcessData(*face2, *data2);
-  BOOST_CHECK_EQUAL(strategyQ.beforeSatisfyInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyB.beforeSatisfyInterest_count, 1);
 
   shared_ptr<Interest> interest3 = makeInterest("ndn:/A/3");
   interest3->setInterestLifetime(time::milliseconds(30));
@@ -290,11 +290,11 @@
   interest4->setInterestLifetime(time::milliseconds(5000));
   forwarder.startProcessInterest(*face1, *interest4);
 
-  strategyP.beforeExpirePendingInterest_count = 0;
-  strategyQ.beforeExpirePendingInterest_count = 0;
+  strategyA.beforeExpirePendingInterest_count = 0;
+  strategyB.beforeExpirePendingInterest_count = 0;
   this->advanceClocks(time::milliseconds(10), time::milliseconds(100));
-  BOOST_CHECK_EQUAL(strategyP.beforeExpirePendingInterest_count, 1);
-  BOOST_CHECK_EQUAL(strategyQ.beforeExpirePendingInterest_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.beforeExpirePendingInterest_count, 1);
+  BOOST_CHECK_EQUAL(strategyB.beforeExpirePendingInterest_count, 0);
 }
 
 BOOST_AUTO_TEST_CASE(IncomingData)
@@ -345,8 +345,8 @@
   forwarder.addFace(face2);
   forwarder.addFace(face3);
 
-  DummyStrategy& strategyP = choose<DummyStrategy>(forwarder, "ndn:/", "ndn:/strategyP");
-  DummyStrategy& strategyQ = choose<DummyStrategy>(forwarder, "ndn:/B", "ndn:/strategyQ");
+  DummyStrategy& strategyA = choose<DummyStrategy>(forwarder, "ndn:/", DummyStrategy::getStrategyName());
+  DummyStrategy& strategyB = choose<DummyStrategy>(forwarder, "ndn:/B", DummyStrategy::getStrategyName());
 
   Pit& pit = forwarder.getPit();
 
@@ -359,18 +359,18 @@
   pit2->insertOrUpdateOutRecord(*face1, *interest2);
 
   lp::Nack nack1 = makeNack("/A/AYJqayrzF", 562, lp::NackReason::CONGESTION);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face1, nack1);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 1);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 1);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
   lp::Nack nack2 = makeNack("/B/EVyP73ru", 221, lp::NackReason::CONGESTION);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face1, nack2);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 0);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 1);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 1);
 
   // record Nack on PIT out-record
   pit::OutRecordCollection::iterator outRecord1 = pit1->getOutRecord(*face1);
@@ -380,11 +380,11 @@
 
   // drop if no PIT entry
   lp::Nack nack3 = makeNack("/yEcw5HhdM", 243, lp::NackReason::CONGESTION);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face1, nack3);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 0);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
   // drop if no out-record
   shared_ptr<Interest> interest4 = makeInterest("/Etab4KpY", 157);
@@ -392,27 +392,27 @@
   pit4->insertOrUpdateOutRecord(*face1, *interest4);
 
   lp::Nack nack4a = makeNack("/Etab4KpY", 157, lp::NackReason::CONGESTION);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face2, nack4a);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 0);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
   // drop if Nonce does not match out-record
   lp::Nack nack4b = makeNack("/Etab4KpY", 294, lp::NackReason::CONGESTION);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face1, nack4b);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 0);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 
   // drop if inFace is multi-access
   pit4->insertOrUpdateOutRecord(*face3, *interest4);
-  strategyP.afterReceiveNack_count = 0;
-  strategyQ.afterReceiveNack_count = 0;
+  strategyA.afterReceiveNack_count = 0;
+  strategyB.afterReceiveNack_count = 0;
   forwarder.onIncomingNack(*face3, nack4a);
-  BOOST_CHECK_EQUAL(strategyP.afterReceiveNack_count, 0);
-  BOOST_CHECK_EQUAL(strategyQ.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyA.afterReceiveNack_count, 0);
+  BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
 }
 
 BOOST_AUTO_TEST_CASE(OutgoingNack)
diff --git a/tests/daemon/fw/install-strategy.hpp b/tests/daemon/fw/install-strategy.hpp
deleted file mode 100644
index a0dab28..0000000
--- a/tests/daemon/fw/install-strategy.hpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- 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/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_FW_INSTALL_STRATEGY_HPP
-#define NFD_TESTS_DAEMON_FW_INSTALL_STRATEGY_HPP
-
-#include "fw/forwarder.hpp"
-
-namespace nfd {
-namespace fw {
-class Strategy;
-} // namespace fw
-
-namespace tests {
-
-/** \brief install a strategy to forwarder
- *  \tparam S strategy type
- *  \param forwarder the forwarder
- *  \param args arguments to strategy constructor
- *  \throw std::bad_cast a strategy with duplicate strategyName is already installed
- *                       and has an incompatible type
- *  \return a reference to the strategy
- *  \deprecated use strategy registry
- *  \todo #3868 delete this function template
- */
-template<typename S, typename ...Args>
-typename std::enable_if<std::is_base_of<fw::Strategy, S>::value, S&>::type
-install(Forwarder& forwarder, Args&&... args)
-{
-  auto strategy = make_unique<S>(ref(forwarder), std::forward<Args>(args)...);
-  fw::Strategy* installed = forwarder.getStrategyChoice().install(std::move(strategy)).second;
-  return dynamic_cast<S&>(*installed);
-}
-
-/** \brief install a strategy to forwarder, and choose the strategy for a namespace
- *  \tparam S strategy type
- *  \param forwarder the forwarder
- *  \param prefix namespace to choose the strategy for
- *  \param args arguments to strategy constructor
- *  \throw std::bad_cast a strategy with duplicate strategyName is already installed
- *                       and has an incompatible type
- *  \return a reference to the strategy
- *  \todo #3868 disallow args
- */
-template<typename S, typename ...Args>
-typename std::enable_if<std::is_base_of<fw::Strategy, S>::value, S&>::type
-choose(Forwarder& forwarder, const Name& prefix, Args&&... args)
-{
-  S& strategy = install<S>(forwarder, std::forward<Args>(args)...);
-  StrategyChoice& sc = forwarder.getStrategyChoice();
-  sc.insert(prefix, strategy.getName());
-  return dynamic_cast<S&>(sc.findEffectiveStrategy(prefix));
-}
-
-/** \brief install a strategy to forwarder, and choose the strategy as default
- *  \tparam S strategy type
- *  \param forwarder the forwarder
- *  \throw std::bad_cast a strategy with duplicate strategyName is already installed
- *                       and has an incompatible type
- *  \return a reference to the strategy
- *  \todo #3868 merge into the other overload with default argument
- */
-template<typename S>
-typename std::enable_if<std::is_base_of<fw::Strategy, S>::value, S&>::type
-choose(Forwarder& forwarder)
-{
-  return choose<S>(forwarder, "ndn:/");
-}
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_FW_INSTALL_STRATEGY_HPP
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 2311ff7..d031bf9 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -37,7 +37,7 @@
 
 #include "tests/test-common.hpp"
 #include "tests/limited-io.hpp"
-#include "install-strategy.hpp"
+#include "choose-strategy.hpp"
 #include "strategy-tester.hpp"
 #include "tests/daemon/face/dummy-face.hpp"
 #include <boost/mpl/copy_if.hpp>
diff --git a/tests/daemon/fw/strategy.t.cpp b/tests/daemon/fw/strategy.t.cpp
index 0ec85ca..0ac550a 100644
--- a/tests/daemon/fw/strategy.t.cpp
+++ b/tests/daemon/fw/strategy.t.cpp
@@ -46,7 +46,7 @@
 public:
   explicit
   FaceTableAccessTestStrategy(Forwarder& forwarder)
-    : DummyStrategy(forwarder, Name("ndn:/strategy"))
+    : DummyStrategy(forwarder)
   {
     this->afterAddFace.connect([this] (const Face& face) {
       this->addedFaces.push_back(face.getId());
@@ -106,7 +106,7 @@
   public:
     explicit
     TestStrategy(Forwarder& forwarder)
-      : DummyStrategy(forwarder, Name("ndn:/strategy"))
+      : DummyStrategy(forwarder)
     {
     }
 
diff --git a/tests/daemon/fw/topology-tester.hpp b/tests/daemon/fw/topology-tester.hpp
index e5b21da..ec122b6 100644
--- a/tests/daemon/fw/topology-tester.hpp
+++ b/tests/daemon/fw/topology-tester.hpp
@@ -33,7 +33,7 @@
 #include "face/internal-transport.hpp"
 #include "face/face.hpp"
 #include "fw/strategy.hpp"
-#include "install-strategy.hpp"
+#include "choose-strategy.hpp"
 #include "tests/test-common.hpp"
 
 #include <ndn-cxx/face.hpp>
