There are many factors involved with swimming faster, both in competition and in practice (e.g. form, rest, hydration, nutrition, training schedule, warming up etc.) but the answer to the "train for race" question is simple: you have to swim faster in practice in order to go faster in competition. Seems pretty obvious to me, but I hear this a lot so I guess it isn't. But if you think about running, clearly a sprinter needs to sprint in practice to become faster, a distance runner needs to do longer intervals at higher levels of effort etc. in order to become faster. It's no different in swimming: at some point in your training you actually have to "work", huff and puff, hurt a little (or a lot) and really push yourself in order to get faster. Puking is ok too, just like training for anything else (please, though, no dairy products before practice and please hurl your lunch in the gutter!).