How to correctly read a string from Arduino serial port?
This is a common (and my favorite) approach:


Choose an “end of message” character. CR or LF can be good choices,
especially if you want to test your program with a terminal emulator.
On the Arduino, buffer all the received bytes until you see the end of
message.
When you see the end of message, handle the buffer to a function that
will parse and process it.


I would avoid parseInt() for anything but the simplest tests, because
it is both blocking and sensitive to the timing of the input.

For an example, you can take a look at this
Simple Arduino command line
interpreter
(look at loop()). It's non blocking, so you can add background
processing to perform while waiting for input characters.