diff --git a/test/libpldmresponder_bios_string_attribute_test.cpp b/test/libpldmresponder_bios_string_attribute_test.cpp
new file mode 100644
index 0000000..747e60f
--- /dev/null
+++ b/test/libpldmresponder_bios_string_attribute_test.cpp
@@ -0,0 +1,200 @@
+#include "libpldmresponder/bios_string_attribute.hpp"
+#include "mocked_bios.hpp"
+#include "mocked_utils.hpp"
+
+#include <memory>
+#include <nlohmann/json.hpp>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace pldm::responder::bios;
+using ::testing::_;
+using ::testing::ElementsAreArray;
+using ::testing::Return;
+using ::testing::StrEq;
+using ::testing::Throw;
+
+class TestBIOSStringAttribute : public ::testing::Test
+{
+  public:
+    const auto& getStringInfo(const BIOSStringAttribute& biosStringAttribute)
+    {
+        return biosStringAttribute.stringInfo;
+    }
+};
+
+TEST_F(TestBIOSStringAttribute, CtorTest)
+{
+    auto jsonStringReadOnly = R"(  {
+            "attribute_name" : "str_example3",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string_length" : 2,
+            "default_string" : "ef"
+        })"_json;
+    BIOSStringAttribute stringReadOnly{jsonStringReadOnly, nullptr};
+    EXPECT_EQ(stringReadOnly.name, "str_example3");
+    EXPECT_TRUE(stringReadOnly.readOnly);
+
+    auto& stringInfo = getStringInfo(stringReadOnly);
+    EXPECT_EQ(stringInfo.stringType,
+              static_cast<uint8_t>(BIOSStringAttribute::Encoding::ASCII));
+    EXPECT_EQ(stringInfo.minLength, 1);
+    EXPECT_EQ(stringInfo.maxLength, 100);
+    EXPECT_EQ(stringInfo.defLength, 2);
+    EXPECT_EQ(stringInfo.defString, "ef");
+
+    auto jsonStringReadOnlyError = R"(  {
+            "attribute_name" : "str_example3",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string" : "ef"
+        })"_json; // missing default_string_length
+
+    EXPECT_THROW((BIOSStringAttribute{jsonStringReadOnlyError, nullptr}),
+                 Json::exception);
+
+    auto jsonStringReadWrite = R"({
+            "attribute_name" : "str_example1",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string_length" : 3,
+            "default_string" : "abc",
+            "dbus" : {
+                "object_path" : "/xyz/abc/def",
+                "interface" : "xyz.openbmc_project.str_example1.value",
+                "property_name" : "Str_example1",
+                "property_type" : "string"
+            }
+        })"_json;
+    BIOSStringAttribute stringReadWrite{jsonStringReadWrite, nullptr};
+
+    EXPECT_EQ(stringReadWrite.name, "str_example1");
+    EXPECT_TRUE(!stringReadWrite.readOnly);
+}
+
+TEST_F(TestBIOSStringAttribute, ConstructEntry)
+{
+    MockBIOSStringTable biosStringTable;
+    MockdBusHandler dbusHandler;
+
+    auto jsonStringReadOnly = R"({
+            "attribute_name" : "str_example1",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string_length" : 3,
+            "default_string" : "abc"
+        })"_json;
+
+    std::vector<uint8_t> expectedAttrEntry{
+        0,    0,       /* attr handle */
+        0x81,          /* attr type string read-only */
+        5,    0,       /* attr name handle */
+        1,             /* string type */
+        1,    0,       /* minimum length of the string in bytes */
+        100,  0,       /* maximum length of the string in bytes */
+        3,    0,       /* length of default string in length */
+        'a',  'b', 'c' /* default string  */
+    };
+
+    std::vector<uint8_t> expectedAttrValueEntry{
+        0,    0,        /* attr handle */
+        0x81,           /* attr type string read-only */
+        3,    0,        /* current string length */
+        'a',  'b', 'c', /* defaut value string handle index */
+    };
+
+    ON_CALL(biosStringTable, findHandle(StrEq("str_example1")))
+        .WillByDefault(Return(5));
+    BIOSStringAttribute stringReadOnly{jsonStringReadOnly, nullptr};
+
+    checkConstructEntry(stringReadOnly, biosStringTable, expectedAttrEntry,
+                        expectedAttrValueEntry);
+
+    auto jsonStringReadWrite = R"({
+            "attribute_name" : "str_example1",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string_length" : 3,
+            "default_string" : "abc",
+            "dbus" : {
+                "object_path" : "/xyz/abc/def",
+                "interface" : "xyz.openbmc_project.str_example1.value",
+                "property_name" : "Str_example1",
+                "property_type" : "string"
+            }
+        })"_json;
+    BIOSStringAttribute stringReadWrite{jsonStringReadWrite, &dbusHandler};
+
+    /* Set expected attr type to read-write */
+    expectedAttrEntry[2] = PLDM_BIOS_STRING;
+    expectedAttrValueEntry[2] = PLDM_BIOS_STRING;
+
+    EXPECT_CALL(
+        dbusHandler,
+        getDbusPropertyVariant(StrEq("/xyz/abc/def"), StrEq("Str_example1"),
+                               StrEq("xyz.openbmc_project.str_example1.value")))
+        .WillOnce(Throw(std::exception()));
+
+    checkConstructEntry(stringReadWrite, biosStringTable, expectedAttrEntry,
+                        expectedAttrValueEntry);
+
+    EXPECT_CALL(
+        dbusHandler,
+        getDbusPropertyVariant(StrEq("/xyz/abc/def"), StrEq("Str_example1"),
+                               StrEq("xyz.openbmc_project.str_example1.value")))
+        .WillOnce(Return(PropertyValue(std::string("abcd"))));
+
+    expectedAttrValueEntry = {
+        0,   0,             /* attr handle */
+        1,                  /* attr type string read-write */
+        4,   0,             /* current string length */
+        'a', 'b', 'c', 'd', /* defaut value string handle index */
+    };
+
+    checkConstructEntry(stringReadWrite, biosStringTable, expectedAttrEntry,
+                        expectedAttrValueEntry);
+}
+
+TEST_F(TestBIOSStringAttribute, setAttrValueOnDbus)
+{
+    auto jsonStringReadWrite = R"({
+            "attribute_name" : "str_example1",
+            "string_type" : "ASCII",
+            "minimum_string_length" : 1,
+            "maximum_string_length" : 100,
+            "default_string_length" : 3,
+            "default_string" : "abc",
+            "dbus" : {
+                "object_path" : "/xyz/abc/def",
+                "interface" : "xyz.openbmc_project.str_example1.value",
+                "property_name" : "Str_example1",
+                "property_type" : "string"
+            }
+        })"_json;
+
+    MockdBusHandler dbusHandler;
+    MockBIOSStringTable biosStringTable;
+
+    BIOSStringAttribute stringReadWrite{jsonStringReadWrite, &dbusHandler};
+    DBusMapping dbusMapping{"/xyz/abc/def",
+                            "xyz.openbmc_project.str_example1.value",
+                            "Str_example1", "string"};
+    std::vector<uint8_t> attrValueEntry{
+        0,   0,             /* attr handle */
+        1,                  /* attr type string read-write */
+        4,   0,             /* current string length */
+        'a', 'b', 'c', 'd', /* defaut value string handle index */
+    };
+    auto entry = reinterpret_cast<pldm_bios_attr_val_table_entry*>(
+        attrValueEntry.data());
+    PropertyValue value = std::string("abcd");
+    EXPECT_CALL(dbusHandler, setDbusProperty(dbusMapping, value)).Times(1);
+    stringReadWrite.setAttrValueOnDbus(entry, nullptr, biosStringTable);
+}
diff --git a/test/meson.build b/test/meson.build
index a7bd88f..827f9fc 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -20,6 +20,7 @@
   'libpldmresponder_base_test',
   'libpldmresponder_bios_test',
   'libpldmresponder_bios_attribute_test',
+  'libpldmresponder_bios_string_attribute_test',
   'libpldmresponder_pdr_state_effecter_test',
   'libpldmresponder_bios_table_test',
   'libpldmresponder_platform_test',
diff --git a/test/mocked_bios.hpp b/test/mocked_bios.hpp
new file mode 100644
index 0000000..eb95c33
--- /dev/null
+++ b/test/mocked_bios.hpp
@@ -0,0 +1,57 @@
+#include "libpldmresponder/bios_table.hpp"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using testing::ElementsAreArray;
+using namespace pldm::responder::bios;
+
+class MockBIOSStringTable : public BIOSStringTable
+{
+  public:
+    MockBIOSStringTable() : BIOSStringTable({})
+    {
+    }
+
+    MOCK_METHOD(uint16_t, findHandle, (const std::string&), (const override));
+};
+
+void checkHeader(const Table& attrEntry, const Table& attrValueEntry)
+{
+    auto attrHeader = table::attribute::decodeHeader(
+        reinterpret_cast<const pldm_bios_attr_table_entry*>(attrEntry.data()));
+    auto attrValueHeader = table::attribute_value::decodeHeader(
+        reinterpret_cast<const pldm_bios_attr_val_table_entry*>(
+            attrValueEntry.data()));
+
+    EXPECT_EQ(attrHeader.attrHandle, attrValueHeader.attrHandle);
+}
+
+void checkEntry(Table& entry, Table& expectedEntry)
+{
+    /** backup the attr handle */
+    auto attr0 = entry[0], eAttr0 = expectedEntry[0];
+    auto attr1 = entry[1], eAttr1 = expectedEntry[1];
+
+    /** attr handle is computed by libpldm, set it to 0 to test */
+    entry[0] = 0, expectedEntry[0] = 0;
+    entry[1] = 0, expectedEntry[1] = 0;
+
+    EXPECT_THAT(entry, ElementsAreArray(expectedEntry));
+
+    /** restore the attr handle */
+    entry[0] = attr0, expectedEntry[0] = eAttr0;
+    entry[1] = attr1, expectedEntry[1] = eAttr1;
+}
+
+void checkConstructEntry(BIOSAttribute& attribute, BIOSStringTable& stringTable,
+                         Table& expectedAttrEntry,
+                         Table& expectedAttrValueEntry)
+{
+    Table attrEntry, attrValueEntry;
+    attribute.constructEntry(stringTable, attrEntry, attrValueEntry);
+
+    checkHeader(attrEntry, attrValueEntry);
+    checkEntry(attrEntry, expectedAttrEntry);
+    checkEntry(attrValueEntry, expectedAttrValueEntry);
+}
\ No newline at end of file
diff --git a/test/mocked_utils.hpp b/test/mocked_utils.hpp
index 39ac8bb..0813830 100644
--- a/test/mocked_utils.hpp
+++ b/test/mocked_utils.hpp
@@ -1,5 +1,3 @@
-#pragma once
-
 #include "utils.hpp"
 
 #include <gmock/gmock.h>
@@ -32,4 +30,7 @@
   public:
     MOCK_METHOD(void, setDbusProperty,
                 (const DBusMapping&, const PropertyValue&), (const override));
+
+    MOCK_METHOD(PropertyValue, getDbusPropertyVariant,
+                (const char*, const char*, const char*), (const override));
 };
