I have a income from one state for the entire year but stayed in two states. How should I make sure that the part year state tax is right?

If anyone lives in MA for part of the year then also he/she has to file the state tax for the complete year?