That happens because you are creating the StringVar before creating the Tk root element. If you move the statement root = Tk()
before the definition of the class, you'll see how it works as expected.
However, the ideal solution would be write it in a way that you don't depend on the order to make it work, so I'd suggest you to create the StringVar in the constructor:
class App:
def __init__(self,master):
frame = Frame(master)
frame.pack()
self.strval = StringVar(frame)
# ...