Without a bit more input it's hard to get very specific on identifying the source of the problem here but I'll see what I can do to point you in the right direction.
The first thing I'd say is that either the team is biting off more than it can chew (stories are too big) or there may be an immature (not derogatory - just earlier development level) development approach that looks at testing as something that happens after development.
If you take some of the test driven development (or even test driven design) approaches one of the first questions a developer needs to ask and answer is "how will I test this?", which isn't wildly different than the "how do I know I am done?" question that should always be front of mind, regardless of the flavour of development style.
As far as how you deal with leftovers I suppose you leave that story in the backlog as it isn't done and release it at the end of the next sprint.
I think you'll want to add some team reflection to your process - your devs will know what the main problems are and should bring them to the foreground...
Hope that helps!