ByteDance Interview Question

Create a function to convert String to float, followed by asking how you would test this function.