diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 40c79ee..7f126e9 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -34,6 +34,8 @@
 #include "tests/daemon/face/dummy-link-service.hpp"
 #include "tests/daemon/face/transport-test-common.hpp"
 
+#include <ndn-cxx/util/random.hpp>
+
 namespace nfd::tests {
 
 namespace ip = boost::asio::ip;
@@ -49,7 +51,7 @@
     ip::address mcastAddr;
     if (address.is_v4()) {
       // the administratively scoped group 224.0.0.254 is reserved for experimentation (RFC 4727)
-      mcastAddr = ip::make_address_v4(0xE00000FE);
+      mcastAddr = ip::make_address_v4("224.0.0.254");
     }
     else {
       // the group FF0X::114 is reserved for experimentation at all scope levels (RFC 4727)
@@ -57,22 +59,22 @@
       v6Addr.scope_id(netif->getIndex());
       mcastAddr = v6Addr;
     }
-    mcastEp = udp::endpoint(mcastAddr, 7373);
-    remoteMcastEp = udp::endpoint(mcastAddr, 8383);
+    mcastEp = udp::endpoint(mcastAddr, m_randomPort(ndn::random::getRandomNumberEngine()));
+    m_remoteMcastEp = udp::endpoint(mcastAddr, m_randomPort(ndn::random::getRandomNumberEngine()));
 
-    MulticastUdpTransport::openRxSocket(remoteSockRx, mcastEp, address);
-    MulticastUdpTransport::openTxSocket(remoteSockTx, udp::endpoint(address, 0), &*netif, true);
+    MulticastUdpTransport::openRxSocket(m_remoteSockRx, mcastEp, address);
+    MulticastUdpTransport::openTxSocket(m_remoteSockTx, udp::endpoint(address, 0), &*netif, true);
 
     udp::socket sockRx(g_io);
     udp::socket sockTx(g_io);
-    MulticastUdpTransport::openRxSocket(sockRx, remoteMcastEp, address);
+    MulticastUdpTransport::openRxSocket(sockRx, m_remoteMcastEp, address);
     MulticastUdpTransport::openTxSocket(sockTx, udp::endpoint(address, txPort), &*netif, true);
 
-    face = make_unique<Face>(make_unique<DummyLinkService>(),
-                             make_unique<MulticastUdpTransport>(mcastEp, std::move(sockRx), std::move(sockTx),
-                                                                ndn::nfd::LINK_TYPE_MULTI_ACCESS));
-    transport = static_cast<MulticastUdpTransport*>(face->getTransport());
-    receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+    m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+                               make_unique<MulticastUdpTransport>(mcastEp, std::move(sockRx), std::move(sockTx),
+                                                                  ndn::nfd::LINK_TYPE_MULTI_ACCESS));
+    transport = static_cast<MulticastUdpTransport*>(m_face->getTransport());
+    receivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
 
     BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
   }
@@ -80,8 +82,8 @@
   void
   remoteRead(std::vector<uint8_t>& buf, bool needToCheck = true)
   {
-    remoteSockRx.async_receive(boost::asio::buffer(buf),
-      [this, needToCheck] (const boost::system::error_code& error, size_t) {
+    m_remoteSockRx.async_receive(boost::asio::buffer(buf),
+      [this, needToCheck] (const auto& error, size_t) {
         if (needToCheck) {
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
         }
@@ -93,14 +95,14 @@
   void
   remoteWrite(const std::vector<uint8_t>& buf, bool needToCheck = true)
   {
-    sendToGroup(remoteSockTx, buf, needToCheck);
+    sendToGroup(m_remoteSockTx, buf, needToCheck);
     limitedIo.defer(1_s);
   }
 
   void
   sendToGroup(udp::socket& sock, const std::vector<uint8_t>& buf, bool needToCheck = true) const
   {
-    sock.async_send_to(boost::asio::buffer(buf), remoteMcastEp,
+    sock.async_send_to(boost::asio::buffer(buf), m_remoteMcastEp,
       [needToCheck] (const auto& error, size_t) {
         if (needToCheck) {
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
@@ -116,10 +118,11 @@
   std::vector<RxPacket>* receivedPackets = nullptr;
 
 private:
-  unique_ptr<Face> face;
-  udp::endpoint remoteMcastEp;
-  udp::socket remoteSockRx{g_io};
-  udp::socket remoteSockTx{g_io};
+  std::uniform_int_distribution<uint16_t> m_randomPort{10000};
+  udp::endpoint m_remoteMcastEp;
+  udp::socket m_remoteSockRx{g_io};
+  udp::socket m_remoteSockTx{g_io};
+  unique_ptr<Face> m_face;
 };
 
 } // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-transport-fixture.hpp b/tests/daemon/face/tcp-transport-fixture.hpp
index 01114e1..688028e 100644
--- a/tests/daemon/face/tcp-transport-fixture.hpp
+++ b/tests/daemon/face/tcp-transport-fixture.hpp
@@ -46,12 +46,12 @@
   void
   startAccept(const tcp::endpoint& remoteEp)
   {
-    BOOST_REQUIRE(!acceptor.is_open());
-    acceptor.open(remoteEp.protocol());
-    acceptor.set_option(boost::asio::socket_base::reuse_address(true));
-    acceptor.bind(remoteEp);
-    acceptor.listen(1);
-    acceptor.async_accept(remoteSocket, [this] (const boost::system::error_code& error) {
+    BOOST_REQUIRE(!m_acceptor.is_open());
+    m_acceptor.open(remoteEp.protocol());
+    m_acceptor.set_option(boost::asio::socket_base::reuse_address(true));
+    m_acceptor.bind(remoteEp);
+    m_acceptor.listen(1);
+    m_acceptor.async_accept(remoteSocket, [this] (const auto& error) {
       BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
       limitedIo.afterOp();
     });
@@ -60,8 +60,8 @@
   void
   stopAccept()
   {
-    BOOST_REQUIRE(acceptor.is_open());
-    acceptor.close();
+    BOOST_REQUIRE(m_acceptor.is_open());
+    m_acceptor.close();
   }
 
   void
@@ -72,7 +72,7 @@
     startAccept(remoteEp);
 
     tcp::socket sock(g_io);
-    sock.async_connect(remoteEp, [this] (const boost::system::error_code& error) {
+    sock.async_connect(remoteEp, [this] (const auto& error) {
       BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
       limitedIo.afterOp();
     });
@@ -89,10 +89,10 @@
       scope = ndn::nfd::FACE_SCOPE_NON_LOCAL;
     }
 
-    face = make_unique<Face>(make_unique<DummyLinkService>(),
-                             make_unique<TcpTransport>(std::move(sock), persistency, scope));
-    transport = static_cast<TcpTransport*>(face->getTransport());
-    receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+    m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+                               make_unique<TcpTransport>(std::move(sock), persistency, scope));
+    transport = static_cast<TcpTransport*>(m_face->getTransport());
+    receivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
 
     BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
   }
@@ -117,8 +117,8 @@
   std::vector<RxPacket>* receivedPackets = nullptr;
 
 private:
-  tcp::acceptor acceptor{g_io};
-  unique_ptr<Face> face;
+  tcp::acceptor m_acceptor{g_io};
+  unique_ptr<Face> m_face;
 };
 
 } // namespace nfd::tests
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index 24d7e26..474d520 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -53,10 +53,10 @@
 
     remoteConnect(address);
 
-    face = make_unique<Face>(make_unique<DummyLinkService>(),
-                             make_unique<UnicastUdpTransport>(std::move(sock), persistency, 3_s));
-    transport = static_cast<UnicastUdpTransport*>(face->getTransport());
-    receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+    m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+                               make_unique<UnicastUdpTransport>(std::move(sock), persistency, 3_s));
+    transport = static_cast<UnicastUdpTransport*>(m_face->getTransport());
+    receivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
 
     BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
   }
@@ -75,7 +75,7 @@
   remoteRead(std::vector<uint8_t>& buf, bool needToCheck = true)
   {
     remoteSocket.async_receive(boost::asio::buffer(buf),
-      [this, needToCheck] (const boost::system::error_code& error, size_t) {
+      [this, needToCheck] (const auto& error, size_t) {
         if (needToCheck) {
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
         }
@@ -104,7 +104,7 @@
   std::vector<RxPacket>* receivedPackets = nullptr;
 
 private:
-  unique_ptr<Face> face;
+  unique_ptr<Face> m_face;
 };
 
 } // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-transport-fixture.hpp b/tests/daemon/face/unix-stream-transport-fixture.hpp
index 2590cda..43b1ad0 100644
--- a/tests/daemon/face/unix-stream-transport-fixture.hpp
+++ b/tests/daemon/face/unix-stream-transport-fixture.hpp
@@ -80,14 +80,6 @@
 class UnixStreamTransportFixture : public GlobalIoFixture
 {
 protected:
-  UnixStreamTransportFixture()
-    : transport(nullptr)
-    , remoteSocket(g_io)
-    , receivedPackets(nullptr)
-    , acceptor(g_io)
-  {
-  }
-
   [[nodiscard]] std::tuple<bool, std::string>
   checkPreconditions() const
   {
@@ -98,13 +90,13 @@
   initialize()
   {
     unix_stream::socket sock(g_io);
-    acceptor.async_accept(sock, [this] (const boost::system::error_code& error) {
+    m_acceptor.async_accept(sock, [this] (const auto& error) {
       BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
       limitedIo.afterOp();
     });
 
-    unix_stream::endpoint remoteEp(acceptor.local_endpoint());
-    remoteSocket.async_connect(remoteEp, [this] (const boost::system::error_code& error) {
+    unix_stream::endpoint remoteEp(m_acceptor.local_endpoint());
+    remoteSocket.async_connect(remoteEp, [this] (const auto& error) {
       BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
       limitedIo.afterOp();
     });
@@ -112,10 +104,10 @@
     BOOST_REQUIRE_EQUAL(limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
 
     localEp = sock.local_endpoint();
-    face = make_unique<Face>(make_unique<DummyLinkService>(),
-                             make_unique<UnixStreamTransport>(std::move(sock)));
-    transport = static_cast<UnixStreamTransport*>(face->getTransport());
-    receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+    m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+                               make_unique<UnixStreamTransport>(std::move(sock)));
+    transport = static_cast<UnixStreamTransport*>(m_face->getTransport());
+    receivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
 
     BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
   }
@@ -134,14 +126,14 @@
 
 protected:
   LimitedIo limitedIo;
-  UnixStreamTransport* transport;
+  UnixStreamTransport* transport = nullptr;
   unix_stream::endpoint localEp;
-  unix_stream::socket remoteSocket;
-  std::vector<RxPacket>* receivedPackets;
+  unix_stream::socket remoteSocket{g_io};
+  std::vector<RxPacket>* receivedPackets = nullptr;
 
 private:
-  AcceptorWithCleanup acceptor;
-  unique_ptr<Face> face;
+  AcceptorWithCleanup m_acceptor{g_io};
+  unique_ptr<Face> m_face;
 };
 
 } // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index c6f25da..ce13198 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -103,10 +103,10 @@
     BOOST_REQUIRE_EQUAL(limitedIo.run(2, // serverHandleOpen, clientHandleOpen
                                       1_s), LimitedIo::EXCEED_OPS);
 
-    face = make_unique<Face>(make_unique<DummyLinkService>(),
-                             make_unique<WebSocketTransport>(serverHdl, server, pingInterval));
-    transport = static_cast<WebSocketTransport*>(face->getTransport());
-    serverReceivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
+    m_face = make_unique<Face>(make_unique<DummyLinkService>(),
+                               make_unique<WebSocketTransport>(serverHdl, server, pingInterval));
+    transport = static_cast<WebSocketTransport*>(m_face->getTransport());
+    serverReceivedPackets = &static_cast<DummyLinkService*>(m_face->getLinkService())->receivedPackets;
 
     BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
   }
@@ -205,7 +205,7 @@
   std::vector<std::string> clientReceivedMessages;
 
 private:
-  unique_ptr<Face> face;
+  unique_ptr<Face> m_face;
 };
 
 } // namespace nfd::tests
