diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index df92d1b..3705037 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -34,10 +34,15 @@
 NFD_REGISTER_STRATEGY(AccessStrategy);
 
 AccessStrategy::AccessStrategy(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+  : Strategy(forwarder)
   , m_removeFaceInfoConn(this->beforeRemoveFace.connect(
                          bind(&AccessStrategy::removeFaceInfo, this, _1)))
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("AccessStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
 
 const Name&
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index cb2bca3..076a3bb 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -39,13 +39,18 @@
 const time::milliseconds AsfStrategy::RETX_SUPPRESSION_MAX(250);
 
 AsfStrategy::AsfStrategy(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+  : Strategy(forwarder)
   , m_measurements(getMeasurements())
   , m_probing(m_measurements)
   , m_retxSuppression(RETX_SUPPRESSION_INITIAL,
                       RetxSuppressionExponential::DEFAULT_MULTIPLIER,
                       RETX_SUPPRESSION_MAX)
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("AsfStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
 
 const Name&
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index b58ed88..ad70ab6 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -29,23 +29,14 @@
 namespace nfd {
 namespace fw {
 
-NFD_REGISTER_STRATEGY(BestRouteStrategy);
-
-BestRouteStrategy::BestRouteStrategy(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+BestRouteStrategyBase::BestRouteStrategyBase(Forwarder& forwarder)
+  : Strategy(forwarder)
 {
 }
 
-const Name&
-BestRouteStrategy::getStrategyName()
-{
-  static Name strategyName("/localhost/nfd/strategy/best-route/%FD%01");
-  return strategyName;
-}
-
 void
-BestRouteStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
-                                        const shared_ptr<pit::Entry>& pitEntry)
+BestRouteStrategyBase::afterReceiveInterest(const Face& inFace, const Interest& interest,
+                                            const shared_ptr<pit::Entry>& pitEntry)
 {
   if (hasPendingOutRecords(*pitEntry)) {
     // not a new Interest, don't forward
@@ -67,5 +58,24 @@
   this->rejectPendingInterest(pitEntry);
 }
 
+NFD_REGISTER_STRATEGY(BestRouteStrategy);
+
+BestRouteStrategy::BestRouteStrategy(Forwarder& forwarder, const Name& name)
+  : BestRouteStrategyBase(forwarder)
+{
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("BestRouteStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
+}
+
+const Name&
+BestRouteStrategy::getStrategyName()
+{
+  static Name strategyName("/localhost/nfd/strategy/best-route/%FD%01");
+  return strategyName;
+}
+
 } // namespace fw
 } // namespace nfd
diff --git a/daemon/fw/best-route-strategy.hpp b/daemon/fw/best-route-strategy.hpp
index 70d975d..3cef907 100644
--- a/daemon/fw/best-route-strategy.hpp
+++ b/daemon/fw/best-route-strategy.hpp
@@ -31,6 +31,17 @@
 namespace nfd {
 namespace fw {
 
+class BestRouteStrategyBase : public Strategy
+{
+public:
+  void
+  afterReceiveInterest(const Face& inFace, const Interest& interest,
+                       const shared_ptr<pit::Entry>& pitEntry) override;
+
+protected:
+  BestRouteStrategyBase(Forwarder& forwarder);
+};
+
 /** \brief Best Route strategy version 1
  *
  *  This strategy forwards a new Interest to the lowest-cost nexthop
@@ -38,11 +49,11 @@
  *  Subsequent similar Interests or consumer retransmissions are suppressed
  *  until after InterestLifetime expiry.
  *
- *  \deprecated This strategy is superceded by Best Route strategy version 2,
- *              which allows consumer retransmissions. This version is kept for
- *              comparison purposes and is not recommended for general usage.
+ *  \note This strategy is superceded by Best Route strategy version 2,
+ *        which allows consumer retransmissions. This version is kept for
+ *        comparison purposes and is not recommended for general usage.
  */
-class BestRouteStrategy : public Strategy
+class BestRouteStrategy : public BestRouteStrategyBase
 {
 public:
   explicit
@@ -50,10 +61,6 @@
 
   static const Name&
   getStrategyName();
-
-  virtual void
-  afterReceiveInterest(const Face& inFace, const Interest& interest,
-                       const shared_ptr<pit::Entry>& pitEntry) override;
 };
 
 } // namespace fw
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 9b53b4b..0ba94e8 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -37,11 +37,16 @@
 const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_MAX(250);
 
 BestRouteStrategy2::BestRouteStrategy2(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+  : Strategy(forwarder)
   , m_retxSuppression(RETX_SUPPRESSION_INITIAL,
                       RetxSuppressionExponential::DEFAULT_MULTIPLIER,
                       RETX_SUPPRESSION_MAX)
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("BestRouteStrategy2 does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
 
 const Name&
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
index edb98cd..8c99db2 100644
--- a/daemon/fw/client-control-strategy.cpp
+++ b/daemon/fw/client-control-strategy.cpp
@@ -33,8 +33,16 @@
 NFD_REGISTER_STRATEGY(ClientControlStrategy);
 
 ClientControlStrategy::ClientControlStrategy(Forwarder& forwarder, const Name& name)
-  : BestRouteStrategy(forwarder, name)
+  : BestRouteStrategyBase(forwarder)
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("ClientControlStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
+
+  NFD_LOG_WARN("NextHopFaceId field is honored universally and "
+               "it's unnecessary to set client-control strategy.");
 }
 
 const Name&
@@ -44,18 +52,5 @@
   return strategyName;
 }
 
-void
-ClientControlStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,
-                                            const shared_ptr<pit::Entry>& pitEntry)
-{
-  if (m_isFirstUse) {
-    NFD_LOG_WARN("NextHopFaceId field is honored universally and "
-                 "it's unnecessary to set client-control strategy.");
-    m_isFirstUse = false;
-  }
-
-  this->BestRouteStrategy::afterReceiveInterest(inFace, interest, pitEntry);
-}
-
 } // namespace fw
 } // namespace nfd
diff --git a/daemon/fw/client-control-strategy.hpp b/daemon/fw/client-control-strategy.hpp
index e18f15b..8d627dd 100644
--- a/daemon/fw/client-control-strategy.hpp
+++ b/daemon/fw/client-control-strategy.hpp
@@ -34,7 +34,7 @@
 /** \brief identical to BestRouteStrategy v1, for backwards compatibility
  *  \deprecated NextHopFaceId field is honored universally and it's unnecessary to set this strategy
  */
-class ClientControlStrategy : public BestRouteStrategy
+class ClientControlStrategy : public BestRouteStrategyBase
 {
 public:
   explicit
@@ -42,13 +42,6 @@
 
   static const Name&
   getStrategyName();
-
-  virtual void
-  afterReceiveInterest(const Face& inFace, const Interest& interest,
-                       const shared_ptr<pit::Entry>& pitEntry) override;
-
-private:
-  bool m_isFirstUse = true;
 };
 
 } // namespace fw
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index 3248684..7a416e3 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -32,8 +32,13 @@
 NFD_REGISTER_STRATEGY(MulticastStrategy);
 
 MulticastStrategy::MulticastStrategy(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+  : Strategy(forwarder)
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("MulticastStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
 
 const Name&
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 0c8b53a..cfc22cb 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -37,8 +37,13 @@
 const time::nanoseconds NccStrategy::MEASUREMENTS_LIFETIME = time::seconds(16);
 
 NccStrategy::NccStrategy(Forwarder& forwarder, const Name& name)
-  : Strategy(forwarder, name)
+  : Strategy(forwarder)
 {
+  ParsedInstanceName parsed = parseInstanceName(name);
+  if (!parsed.parameters.empty()) {
+    BOOST_THROW_EXCEPTION(std::invalid_argument("NccStrategy does not accept parameters"));
+  }
+  this->setInstanceName(makeInstanceName(name, getStrategyName()));
 }
 
 const Name&
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index ae8a17c..3009123 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -43,43 +43,51 @@
 }
 
 Strategy::Registry::const_iterator
-Strategy::find(const Name& strategyName)
+Strategy::find(const Name& instanceName)
 {
   const Registry& registry = getRegistry();
+  ParsedInstanceName parsed = parseInstanceName(instanceName);
+
+  ///\todo #3868 accommodate parameters
+  if (parsed.version) {
+    NFD_LOG_TRACE("find " << instanceName <<
+                  " strategyName=" << parsed.strategyName << " versioned");
+    ///\todo #3868 if exact version unavailable, choose closest higher version
+    return registry.find(parsed.strategyName);
+  }
+
+  NFD_LOG_TRACE("find " << instanceName <<
+                " strategyName=" << parsed.strategyName << " unversioned");
   Registry::const_iterator candidate = registry.end();
-  for (auto it = registry.lower_bound(strategyName);
-       it != registry.end() && strategyName.isPrefixOf(it->first); ++it) {
-    switch (it->first.size() - strategyName.size()) {
-      case 0: // exact match
-        return it;
-      case 1: // unversioned strategyName matches versioned strategy
-        candidate = it;
-        break;
+  for (auto it = registry.lower_bound(parsed.strategyName);
+       it != registry.end() && parsed.strategyName.isPrefixOf(it->first); ++it) {
+    if (it->first.size() == parsed.strategyName.size() + 1) { // only one extra component: version
+      candidate = it;
     }
   }
   return candidate;
-  ///\todo #3868 if exact version unavailable, choose closest higher version
-  ///\todo #3868 allow parameter component
 }
 
 bool
-Strategy::canCreate(const Name& strategyName)
+Strategy::canCreate(const Name& instanceName)
 {
-  return Strategy::find(strategyName) != getRegistry().end();
+  return Strategy::find(instanceName) != getRegistry().end();
 }
 
 unique_ptr<Strategy>
-Strategy::create(const Name& strategyName, Forwarder& forwarder)
+Strategy::create(const Name& instanceName, Forwarder& forwarder)
 {
-  auto found = Strategy::find(strategyName);
+  auto found = Strategy::find(instanceName);
   if (found == getRegistry().end()) {
-    NFD_LOG_DEBUG("create " << strategyName << " not-found");
+    NFD_LOG_DEBUG("create " << instanceName << " not-found");
     return nullptr;
   }
 
-  NFD_LOG_DEBUG("create " << strategyName << " found=" << found->first);
-  ///\todo #3868 pass parameters to strategy constructor
-  return found->second(forwarder, found->first);
+  unique_ptr<Strategy> instance = found->second(forwarder, instanceName);
+  NFD_LOG_DEBUG("create " << instanceName << " found=" << found->first <<
+                " created=" << instance->getInstanceName());
+  BOOST_ASSERT(!instance->getInstanceName().empty());
+  return instance;
 }
 
 std::set<Name>
@@ -91,10 +99,30 @@
   return strategyNames;
 }
 
-Strategy::Strategy(Forwarder& forwarder, const Name& name)
+Strategy::ParsedInstanceName
+Strategy::parseInstanceName(const Name& input)
+{
+  for (ssize_t i = input.size() - 1; i > 0; --i) {
+    if (input[i].isVersion()) {
+      return {input.getPrefix(i + 1), input[i].toVersion(), input.getSubName(i + 1)};
+    }
+  }
+  return {input, ndn::nullopt, PartialName()};
+}
+
+Name
+Strategy::makeInstanceName(const Name& input, const Name& strategyName)
+{
+  BOOST_ASSERT(strategyName.at(-1).isVersion());
+
+  bool hasVersion = std::any_of(input.rbegin(), input.rend(),
+                                [] (const name::Component& comp) { return comp.isVersion(); });
+  return hasVersion ? input : Name(input).append(strategyName.at(-1));
+}
+
+Strategy::Strategy(Forwarder& forwarder)
   : afterAddFace(forwarder.getFaceTable().afterAdd)
   , beforeRemoveFace(forwarder.getFaceTable().beforeRemove)
-  , m_name(name)
   , m_forwarder(forwarder)
   , m_measurements(m_forwarder.getMeasurements(), m_forwarder.getStrategyChoice(), *this)
 {
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 187f7fe..c2949b2 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -39,7 +39,7 @@
 public: // registry
   /** \brief register a strategy type
    *  \tparam S subclass of Strategy
-   *  \param strategyName versioned strategy name
+   *  \param strategyName strategy program name, must contain version
    *  \note It is permitted to register the same strategy type under multiple names,
    *        which is useful in tests and for creating aliases.
    */
@@ -47,27 +47,27 @@
   static void
   registerType(const Name& strategyName = S::getStrategyName())
   {
+    BOOST_ASSERT(strategyName.at(-1).isVersion());
     Registry& registry = getRegistry();
     BOOST_ASSERT(registry.count(strategyName) == 0);
     registry[strategyName] = &make_unique<S, Forwarder&, const Name&>;
   }
 
-  /** \return whether a strategy instance can be created from \p strategyName
-   *  \param strategyName strategy name, may contain version
-   *  \todo #3868 may contain parameters
+  /** \return whether a strategy instance can be created from \p instanceName
+   *  \param instanceName strategy instance name, may contain version and parameters
    *  \note This function finds a strategy type using same rules as \p create ,
    *        but does not attempt to construct an instance.
    */
   static bool
-  canCreate(const Name& strategyName);
+  canCreate(const Name& instanceName);
 
-  /** \return a strategy instance created from \p strategyName,
-   *  \retval nullptr if !canCreate(strategyName)
-   *  \todo #3868 throw std::invalid_argument strategy type constructor
-   *              does not accept specified version or parameters
+  /** \return a strategy instance created from \p instanceName
+   *  \retval nullptr if !canCreate(instanceName)
+   *  \throw std::invalid_argument strategy type constructor does not accept
+   *                               specified version or parameters
    */
   static unique_ptr<Strategy>
-  create(const Name& strategyName, Forwarder& forwarder);
+  create(const Name& instanceName, Forwarder& forwarder);
 
   /** \return registered versioned strategy names
    */
@@ -76,36 +76,43 @@
 
 public: // constructor, destructor, strategy name
   /** \brief construct a strategy instance
-   *  \param forwarder a reference to the Forwarder, used to enable actions and accessors.
-   *         Strategy subclasses should pass this reference,
-   *         and should not keep a reference themselves.
-   *  \param name the strategy Name.
-   *         It's recommended to include a version number as the last component.
-   *  \todo #3868 name contains version and parameters as instantiated.
+   *  \param forwarder a reference to the forwarder, used to enable actions and accessors.
+   *  \note Strategy subclass constructor should not retain a reference to the forwarder.
    */
-  Strategy(Forwarder& forwarder, const Name& name);
+  explicit
+  Strategy(Forwarder& forwarder);
 
   virtual
   ~Strategy();
 
 #ifdef DOXYGEN
-  /** \return a name that represents the strategy program
-   *  \todo #3868 This name contains version as given in code,
-   *              which may differ from instantiated version.
+  /** \return strategy program name
+   *
+   *  The strategy name is defined by the strategy program.
+   *  It must end with a version component.
    */
   static const Name&
   getStrategyName();
 #endif
 
-  /** \return a name that represents the strategy program
-   *  \todo #3868 This name contains version and parameters as instantiated.
+  /** \return strategy instance name
+   *
+   *  The instance name is assigned during instantiation.
+   *  It contains a version component, and may have extra parameter components.
    */
   const Name&
-  getName() const
+  getInstanceName() const
   {
     return m_name;
   }
 
+  DEPRECATED(
+  const Name&
+  getName() const)
+  {
+    return this->getInstanceName();
+  }
+
 public: // triggers
   /** \brief trigger after Interest is received
    *
@@ -249,9 +256,42 @@
     return m_forwarder.getFaceTable();
   }
 
-protected: // accessors
-  signal::Signal<FaceTable, Face&>& afterAddFace;
-  signal::Signal<FaceTable, Face&>& beforeRemoveFace;
+protected: // instance name
+  struct ParsedInstanceName
+  {
+    Name strategyName; ///< strategy name without parameters
+    ndn::optional<uint64_t> version; ///< whether strategyName contains a version component
+    PartialName parameters; ///< parameter components
+  };
+
+  /** \brief parse a strategy instance name
+   *  \param input strategy instance name, may contain version and parameters
+   *  \throw std::invalid_argument input format is unacceptable
+   */
+  static ParsedInstanceName
+  parseInstanceName(const Name& input);
+
+  /** \brief construct a strategy instance name
+   *  \param input strategy instance name, may contain version and parameters
+   *  \param strategyName strategy name with version but without parameters;
+   *                      typically this should be \p getStrategyName()
+   *
+   *  If \p input contains a version component, return \p input unchanged.
+   *  Otherwise, return \p input plus the version component taken from \p strategyName.
+   *  This allows a strategy instance to be constructed with an unversioned name,
+   *  but its final instance name should contain the version.
+   */
+  static Name
+  makeInstanceName(const Name& input, const Name& strategyName);
+
+  /** \brief set strategy instance name
+   *  \note This must be called by strategy subclass constructor.
+   */
+  void
+  setInstanceName(const Name& name)
+  {
+    m_name = name;
+  }
 
 private: // registry
   typedef std::function<unique_ptr<Strategy>(Forwarder& forwarder, const Name& strategyName)> CreateFunc;
@@ -261,7 +301,11 @@
   getRegistry();
 
   static Registry::const_iterator
-  find(const Name& strategyName);
+  find(const Name& instanceName);
+
+protected: // accessors
+  signal::Signal<FaceTable, Face&>& afterAddFace;
+  signal::Signal<FaceTable, Face&>& beforeRemoveFace;
 
 private: // instance fields
   Name m_name;
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index 985d05c..63e33ee 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -116,7 +116,15 @@
 bool
 StrategyChoice::insert(const Name& prefix, const Name& strategyName)
 {
-  unique_ptr<Strategy> createdStrategy = Strategy::create(strategyName, m_forwarder);
+  unique_ptr<Strategy> createdStrategy;
+  try {
+    createdStrategy = Strategy::create(strategyName, m_forwarder);
+  }
+  catch (const std::invalid_argument& e) {
+    NFD_LOG_ERROR("insert(" << prefix << "," << strategyName << ") cannot create strategy: " << e.what());
+    return false;
+  }
+
   Strategy* strategy = createdStrategy.get();
   if (strategy == nullptr) {
     strategy = this->getStrategy(strategyName);
diff --git a/tests/daemon/fw/access-strategy.t.cpp b/tests/daemon/fw/access-strategy.t.cpp
index a25c44c..148f5a8 100644
--- a/tests/daemon/fw/access-strategy.t.cpp
+++ b/tests/daemon/fw/access-strategy.t.cpp
@@ -60,6 +60,18 @@
   BOOST_CHECK_EQUAL(Strategy::listRegistered().count(AccessStrategy::getStrategyName()), 1);
 }
 
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(AccessStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    AccessStrategy(forwarder, AccessStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    AccessStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    AccessStrategy(forwarder, Name(AccessStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
 class TwoLaptopsFixture : public UnitTestTimeFixture
 {
 protected:
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 97f7da7..c370cbd 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -48,6 +48,18 @@
   BOOST_CHECK_EQUAL(Strategy::listRegistered().count(AsfStrategy::getStrategyName()), 1);
 }
 
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(AsfStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    AsfStrategy(forwarder, AsfStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    AsfStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    AsfStrategy(forwarder, Name(AsfStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
 class AsfGridFixture : public UnitTestTimeFixture
 {
 protected:
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index 7a2db75..a28ec83 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -38,6 +38,29 @@
 typedef StrategyTester<BestRouteStrategy> BestRouteStrategyTester;
 NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
 
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestBestRouteStrategy, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Registration)
+{
+  BOOST_CHECK_EQUAL(Strategy::listRegistered().count(BestRouteStrategy::getStrategyName()), 1);
+}
+
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(BestRouteStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    BestRouteStrategy(forwarder, BestRouteStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    BestRouteStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    BestRouteStrategy(forwarder, Name(BestRouteStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
 } // namespace tests
 } // namespace fw
 } // namespace nfd
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 29de094..6a1848e 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -81,6 +81,18 @@
   BOOST_CHECK_EQUAL(Strategy::listRegistered().count(BestRouteStrategy2::getStrategyName()), 1);
 }
 
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(BestRouteStrategy2::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    BestRouteStrategy2(forwarder, BestRouteStrategy2::getStrategyName().getPrefix(-1)).getInstanceName(),
+    BestRouteStrategy2::getStrategyName());
+  BOOST_CHECK_THROW(
+    BestRouteStrategy2(forwarder, Name(BestRouteStrategy2::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
 BOOST_AUTO_TEST_CASE(Forward)
 {
   fib::Entry& fibEntry = *fib.insert(Name()).first;
diff --git a/tests/daemon/fw/client-control-strategy.t.cpp b/tests/daemon/fw/client-control-strategy.t.cpp
new file mode 100644
index 0000000..b03673a
--- /dev/null
+++ b/tests/daemon/fw/client-control-strategy.t.cpp
@@ -0,0 +1,61 @@
+/* -*- 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 "fw/client-control-strategy.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace fw {
+namespace tests {
+
+using namespace nfd::tests;
+
+BOOST_AUTO_TEST_SUITE(Fw)
+BOOST_FIXTURE_TEST_SUITE(TestClientControlStrategy, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Registration)
+{
+  BOOST_CHECK_EQUAL(Strategy::listRegistered().count(ClientControlStrategy::getStrategyName()), 1);
+}
+
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(ClientControlStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    ClientControlStrategy(forwarder, ClientControlStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    ClientControlStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    ClientControlStrategy(forwarder, Name(ClientControlStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestClientControlStrategy
+BOOST_AUTO_TEST_SUITE_END() // Fw
+
+} // namespace tests
+} // namespace fw
+} // namespace nfd
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index 08d10b0..a6af8ac 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -38,13 +38,22 @@
 class DummyStrategy : public fw::Strategy
 {
 public:
+  static void
+  registerAs(const Name& name)
+  {
+    if (!fw::Strategy::canCreate(name)) {
+      fw::Strategy::registerType<DummyStrategy>(name);
+    }
+  }
+
   DummyStrategy(Forwarder& forwarder, const Name& name)
-    : Strategy(forwarder, name)
+    : Strategy(forwarder)
     , afterReceiveInterest_count(0)
     , beforeSatisfyInterest_count(0)
     , beforeExpirePendingInterest_count(0)
     , afterReceiveNack_count(0)
   {
+    this->setInstanceName(name);
   }
 
   /** \brief after receive Interest trigger
@@ -52,7 +61,7 @@
    *  If \p interestOutFace is not null, Interest is forwarded to that face via send Interest action;
    *  otherwise, reject pending Interest action is invoked.
    */
-  virtual void
+  void
   afterReceiveInterest(const Face& inFace, const Interest& interest,
                        const shared_ptr<pit::Entry>& pitEntry) override
   {
@@ -66,20 +75,20 @@
     }
   }
 
-  virtual void
+  void
   beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
                         const Face& inFace, const Data& data) override
   {
     ++beforeSatisfyInterest_count;
   }
 
-  virtual void
+  void
   beforeExpirePendingInterest(const shared_ptr<pit::Entry>& pitEntry) override
   {
     ++beforeExpirePendingInterest_count;
   }
 
-  virtual void
+  void
   afterReceiveNack(const Face& inFace, const lp::Nack& nack,
                    const shared_ptr<pit::Entry>& pitEntry) override
   {
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index b8c3d2f..49bf940 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -72,6 +72,18 @@
   BOOST_CHECK_EQUAL(Strategy::listRegistered().count(MulticastStrategy::getStrategyName()), 1);
 }
 
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(MulticastStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    MulticastStrategy(forwarder, MulticastStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    MulticastStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    MulticastStrategy(forwarder, Name(MulticastStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
 BOOST_AUTO_TEST_CASE(Forward2)
 {
   fib::Entry& fibEntry = *fib.insert(Name()).first;
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index bc482e5..bc617c7 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -48,12 +48,24 @@
   BOOST_CHECK_EQUAL(Strategy::listRegistered().count(NccStrategy::getStrategyName()), 1);
 }
 
-// NccStrategy is fairly complex.
-// The most important property is:
-// it remembers which upstream is the fastest to return Data,
-// and favors this upstream in subsequent Interests.
+BOOST_AUTO_TEST_CASE(InstanceName)
+{
+  Forwarder forwarder;
+  BOOST_REQUIRE(NccStrategy::getStrategyName().at(-1).isVersion());
+  BOOST_CHECK_EQUAL(
+    NccStrategy(forwarder, NccStrategy::getStrategyName().getPrefix(-1)).getInstanceName(),
+    NccStrategy::getStrategyName());
+  BOOST_CHECK_THROW(
+    NccStrategy(forwarder, Name(NccStrategy::getStrategyName()).append("param")),
+    std::invalid_argument);
+}
+
 BOOST_AUTO_TEST_CASE(FavorRespondingUpstream)
 {
+  // NccStrategy is fairly complex.
+  // The most important property is: it remembers which upstream is the fastest to return Data,
+  // and favors this upstream in subsequent Interests.
+
   LimitedIo limitedIo(this);
   Forwarder forwarder;
   NccStrategyTester& strategy = choose<NccStrategyTester>(forwarder);
diff --git a/tests/daemon/table/strategy-choice.t.cpp b/tests/daemon/table/strategy-choice.t.cpp
index 91634e9..a9042a9 100644
--- a/tests/daemon/table/strategy-choice.t.cpp
+++ b/tests/daemon/table/strategy-choice.t.cpp
@@ -32,94 +32,132 @@
 namespace nfd {
 namespace tests {
 
+class StrategyChoiceFixture : public BaseFixture
+{
+protected:
+  StrategyChoiceFixture()
+    : sc(forwarder.getStrategyChoice())
+  {
+  }
+
+  Name
+  insertAndGet(const Name& prefix, const Name& strategyName)
+  {
+    BOOST_REQUIRE(sc.insert(prefix, strategyName));
+    bool isFound;
+    Name foundName;
+    std::tie(isFound, foundName) = sc.get(prefix);
+    BOOST_REQUIRE(isFound);
+    return foundName;
+  }
+
+protected:
+  Forwarder forwarder;
+  StrategyChoice& sc;
+};
+
 BOOST_AUTO_TEST_SUITE(Table)
-BOOST_FIXTURE_TEST_SUITE(TestStrategyChoice, BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestStrategyChoice, StrategyChoiceFixture)
 
 using fw::Strategy;
 
+BOOST_AUTO_TEST_CASE(Parameters)
+{
+  const Name strategyName("/strategy-choice-test-parameters/%FD%01");
+  DummyStrategy::registerAs(strategyName);
+
+  // no parameters
+  BOOST_CHECK_EQUAL(this->insertAndGet("/A", strategyName), strategyName);
+
+  // one parameter
+  Name oneParamName = Name(strategyName).append("param");
+  BOOST_CHECK_EQUAL(this->insertAndGet("/B", oneParamName), oneParamName);
+
+  // two parameters
+  Name twoParamName = Name(strategyName).append("x").append("y");
+  BOOST_CHECK_EQUAL(this->insertAndGet("/C", twoParamName), twoParamName);
+
+  // parameter without version is disallowed
+  Name oneParamUnversioned = strategyName.getPrefix(-1).append("param");
+  BOOST_CHECK_EQUAL(sc.insert("/D", oneParamUnversioned), false);
+}
+
 BOOST_AUTO_TEST_CASE(Get)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   install<DummyStrategy>(forwarder, nameP);
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
-
-  BOOST_CHECK(table.insert("ndn:/", nameP));
+  BOOST_CHECK(sc.insert("ndn:/", nameP));
   // { '/'=>P }
 
-  auto getRoot = table.get("ndn:/");
+  auto getRoot = sc.get("ndn:/");
   BOOST_CHECK_EQUAL(getRoot.first, true);
   BOOST_CHECK_EQUAL(getRoot.second, nameP);
 
-  auto getA = table.get("ndn:/A");
+  auto getA = sc.get("ndn:/A");
   BOOST_CHECK_EQUAL(getA.first, false);
 }
 
 BOOST_AUTO_TEST_CASE(FindEffectiveStrategy)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   Name nameZ("ndn:/strategy/Z");
   install<DummyStrategy>(forwarder, nameP);
   install<DummyStrategy>(forwarder, nameQ);
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
-
-  BOOST_CHECK(table.insert("ndn:/", nameP));
+  BOOST_CHECK(sc.insert("ndn:/", nameP));
   // { '/'=>P }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
 
-  BOOST_CHECK(table.insert("ndn:/A/B", nameP));
+  BOOST_CHECK(sc.insert("ndn:/A/B", nameP));
   // { '/'=>P, '/A/B'=>P }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
   // same instance
-  BOOST_CHECK_EQUAL(&table.findEffectiveStrategy("ndn:/"),
-                    &table.findEffectiveStrategy("ndn:/A/B"));
+  BOOST_CHECK_EQUAL(&sc.findEffectiveStrategy("ndn:/"),
+                    &sc.findEffectiveStrategy("ndn:/A/B"));
 
-  table.erase("ndn:/A"); // no effect
+  sc.erase("ndn:/A"); // no effect
   // { '/'=>P, '/A/B'=>P }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
 
-  BOOST_CHECK(table.insert("ndn:/A", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/A", nameQ));
   // { '/'=>P, '/A/B'=>P, '/A'=>Q }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
 
-  table.erase("ndn:/A/B");
+  sc.erase("ndn:/A/B");
   // { '/'=>P, '/A'=>Q }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameQ);
 
-  BOOST_CHECK(!table.insert("ndn:/", nameZ)); // non existent strategy
+  BOOST_CHECK(!sc.insert("ndn:/", nameZ)); // non existent strategy
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(table.insert("ndn:/A", nameP));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/A", nameP));
   // { '/'=>Q, '/A'=>P }
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/")   .getName(), nameQ);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/D")  .getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/")   .getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A")  .getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/A/B").getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/D")  .getName(), nameQ);
 }
 
 BOOST_AUTO_TEST_CASE(FindEffectiveStrategyWithPitEntry)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   install<DummyStrategy>(forwarder, nameP);
@@ -128,10 +166,8 @@
   shared_ptr<Data> dataABC = makeData("/A/B/C");
   Name fullName = dataABC->getFullName();
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
-
-  BOOST_CHECK(table.insert("/A", nameP));
-  BOOST_CHECK(table.insert(fullName, nameQ));
+  BOOST_CHECK(sc.insert("/A", nameP));
+  BOOST_CHECK(sc.insert(fullName, nameQ));
 
   Pit& pit = forwarder.getPit();
   shared_ptr<Interest> interestAB = makeInterest("/A/B");
@@ -139,29 +175,26 @@
   shared_ptr<Interest> interestFull = makeInterest(fullName);
   shared_ptr<pit::Entry> pitFull = pit.insert(*interestFull).first;
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy(*pitAB).getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy(*pitFull).getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy(*pitAB).getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy(*pitFull).getName(), nameQ);
 }
 
 BOOST_AUTO_TEST_CASE(FindEffectiveStrategyWithMeasurementsEntry)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   install<DummyStrategy>(forwarder, nameP);
   install<DummyStrategy>(forwarder, nameQ);
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
-
-  BOOST_CHECK(table.insert("/A", nameP));
-  BOOST_CHECK(table.insert("/A/B/C", nameQ));
+  BOOST_CHECK(sc.insert("/A", nameP));
+  BOOST_CHECK(sc.insert("/A/B/C", nameQ));
 
   Measurements& measurements = forwarder.getMeasurements();
   measurements::Entry& mAB = measurements.get("/A/B");
   measurements::Entry& mABCD = measurements.get("/A/B/C/D");
 
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy(mAB).getName(), nameP);
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy(mABCD).getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy(mAB).getName(), nameP);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy(mABCD).getName(), nameQ);
 }
 
 //XXX BOOST_CONCEPT_ASSERT((ForwardIterator<std::vector<int>::iterator>))
@@ -170,24 +203,21 @@
 
 BOOST_AUTO_TEST_CASE(Enumerate)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   install<DummyStrategy>(forwarder, nameP);
   install<DummyStrategy>(forwarder, nameQ);
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
+  sc.insert("ndn:/",      nameP);
+  sc.insert("ndn:/A/B",   nameQ);
+  sc.insert("ndn:/A/B/C", nameP);
+  sc.insert("ndn:/D",     nameP);
+  sc.insert("ndn:/E",     nameQ);
 
-  table.insert("ndn:/",      nameP);
-  table.insert("ndn:/A/B",   nameQ);
-  table.insert("ndn:/A/B/C", nameP);
-  table.insert("ndn:/D",     nameP);
-  table.insert("ndn:/E",     nameQ);
-
-  BOOST_CHECK_EQUAL(table.size(), 5);
+  BOOST_CHECK_EQUAL(sc.size(), 5);
 
   std::map<Name, Name> map; // namespace=>strategyName
-  for (StrategyChoice::const_iterator it = table.begin(); it != table.end(); ++it) {
+  for (StrategyChoice::const_iterator it = sc.begin(); it != sc.end(); ++it) {
     map[it->getPrefix()] = it->getStrategyName();
   }
   BOOST_CHECK_EQUAL(map.size(), 5);
@@ -211,37 +241,35 @@
 
 BOOST_AUTO_TEST_CASE(ClearStrategyInfo)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   install<DummyStrategy>(forwarder, nameP);
   install<DummyStrategy>(forwarder, nameQ);
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
   Measurements& measurements = forwarder.getMeasurements();
 
-  BOOST_CHECK(table.insert("ndn:/", nameP));
+  BOOST_CHECK(sc.insert("ndn:/", nameP));
   // { '/'=>P }
   measurements.get("ndn:/").insertStrategyInfo<PStrategyInfo>();
   measurements.get("ndn:/A").insertStrategyInfo<PStrategyInfo>();
   measurements.get("ndn:/A/B").insertStrategyInfo<PStrategyInfo>();
   measurements.get("ndn:/A/C").insertStrategyInfo<PStrategyInfo>();
 
-  BOOST_CHECK(table.insert("ndn:/A/B", nameP));
+  BOOST_CHECK(sc.insert("ndn:/A/B", nameP));
   // { '/'=>P, '/A/B'=>P }
   BOOST_CHECK(measurements.get("ndn:/").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A/B").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A/C").getStrategyInfo<PStrategyInfo>() != nullptr);
 
-  BOOST_CHECK(table.insert("ndn:/A", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/A", nameQ));
   // { '/'=>P, '/A/B'=>P, '/A'=>Q }
   BOOST_CHECK(measurements.get("ndn:/").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A").getStrategyInfo<PStrategyInfo>() == nullptr);
   BOOST_CHECK(measurements.get("ndn:/A/B").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A/C").getStrategyInfo<PStrategyInfo>() == nullptr);
 
-  table.erase("ndn:/A/B");
+  sc.erase("ndn:/A/B");
   // { '/'=>P, '/A'=>Q }
   BOOST_CHECK(measurements.get("ndn:/").getStrategyInfo<PStrategyInfo>() != nullptr);
   BOOST_CHECK(measurements.get("ndn:/A").getStrategyInfo<PStrategyInfo>() == nullptr);
@@ -251,21 +279,19 @@
 
 BOOST_AUTO_TEST_CASE(EraseNameTreeEntry)
 {
-  Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   install<DummyStrategy>(forwarder, nameP);
   install<DummyStrategy>(forwarder, nameQ);
 
   NameTree& nameTree = forwarder.getNameTree();
-  StrategyChoice& table = forwarder.getStrategyChoice();
 
-  table.insert("ndn:/", nameP);
+  sc.insert("ndn:/", nameP);
 
   size_t nNameTreeEntriesBefore = nameTree.size();
 
-  table.insert("ndn:/A/B", nameQ);
-  table.erase("ndn:/A/B");
+  sc.insert("ndn:/A/B", nameQ);
+  sc.erase("ndn:/A/B");
   BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
 }
 
@@ -280,8 +306,6 @@
   Name nameQ("ndn:/strategy/Q");
   Name nameQ5("ndn:/strategy/Q/%FD%05");
 
-  StrategyChoice& table = forwarder.getStrategyChoice();
-
   // install
   auto strategyP1 = make_unique<DummyStrategy>(ref(forwarder), nameP1);
   Strategy* instanceP1 = strategyP1.get();
@@ -295,56 +319,56 @@
   bool isInstalled = false;
   Strategy* installed = nullptr;
 
-  std::tie(isInstalled, installed) = table.install(std::move(strategyP1));
+  std::tie(isInstalled, installed) = sc.install(std::move(strategyP1));
   BOOST_CHECK_EQUAL(isInstalled, true);
   BOOST_CHECK_EQUAL(installed, instanceP1);
-  std::tie(isInstalled, installed) = table.install(std::move(strategyP1b));
+  std::tie(isInstalled, installed) = sc.install(std::move(strategyP1b));
   BOOST_CHECK_EQUAL(isInstalled, false);
   BOOST_CHECK_EQUAL(installed, instanceP1);
 
-  BOOST_CHECK_EQUAL(table.hasStrategy(nameP,  false), true);
-  BOOST_CHECK_EQUAL(table.hasStrategy(nameP,  true),  false);
-  BOOST_CHECK_EQUAL(table.hasStrategy(nameP1, true),  true);
+  BOOST_CHECK_EQUAL(sc.hasStrategy(nameP,  false), true);
+  BOOST_CHECK_EQUAL(sc.hasStrategy(nameP,  true),  false);
+  BOOST_CHECK_EQUAL(sc.hasStrategy(nameP1, true),  true);
 
-  BOOST_CHECK_EQUAL(table.install(std::move(strategyP2)).first, true);
-  BOOST_CHECK_EQUAL(table.install(std::move(strategy3)).first, true);
-  BOOST_CHECK_EQUAL(table.install(std::move(strategy4)).first, true);
-  BOOST_CHECK_EQUAL(table.install(std::move(strategyQ)).first, true);
-  BOOST_CHECK_EQUAL(table.install(std::move(strategyQ5)).first, true);
+  BOOST_CHECK_EQUAL(sc.install(std::move(strategyP2)).first, true);
+  BOOST_CHECK_EQUAL(sc.install(std::move(strategy3)).first, true);
+  BOOST_CHECK_EQUAL(sc.install(std::move(strategy4)).first, true);
+  BOOST_CHECK_EQUAL(sc.install(std::move(strategyQ)).first, true);
+  BOOST_CHECK_EQUAL(sc.install(std::move(strategyQ5)).first, true);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
   // exact match, { '/'=>Q }
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameQ);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(table.insert("ndn:/", nameP));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/", nameP));
   // { '/'=>P2 }
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP2);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameP2);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(table.insert("ndn:/", nameP1));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/", nameP1));
   // { '/'=>P1 }
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP1);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameP1);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(table.insert("ndn:/", nameP2));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(sc.insert("ndn:/", nameP2));
   // { '/'=>P2 }
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameP2);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameP2);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(! table.insert("ndn:/", "ndn:/strategy/A"));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(! sc.insert("ndn:/", "ndn:/strategy/A"));
   // not installed
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameQ);
 
-  BOOST_CHECK(table.insert("ndn:/", nameQ));
-  BOOST_CHECK(! table.insert("ndn:/", "ndn:/strategy/Z"));
+  BOOST_CHECK(sc.insert("ndn:/", nameQ));
+  BOOST_CHECK(! sc.insert("ndn:/", "ndn:/strategy/Z"));
   // not installed
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), nameQ);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), nameQ);
 
-  BOOST_CHECK(table.insert("ndn:/", nameP1));
-  BOOST_CHECK(table.insert("ndn:/", "ndn:/"));
+  BOOST_CHECK(sc.insert("ndn:/", nameP1));
+  BOOST_CHECK(sc.insert("ndn:/", "ndn:/"));
   // match one component longer only, { '/'=>4 }
-  BOOST_CHECK_EQUAL(table.findEffectiveStrategy("ndn:/").getName(), name4);
+  BOOST_CHECK_EQUAL(sc.findEffectiveStrategy("ndn:/").getName(), name4);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoice
