Scrum is a team-based approach to iteratively, incrementally develop systems and products when requirements are rapidly changing. In a 2-4 weeks sprint, can you afford to wait for testing to start after code development is over? Don't you need to contain QA and defects within the sprint? What engineering practices do you need to deliver products iteratively and incrementally?
Test Driven Development (TDD) and Continuous Integration (CI) are the key engineering practices you need to deliver a shippable product after every sprint. Your scrum team needs to test often (daily builds) and automatically (using various tools for TDD). These engineering practices makes your team agile and ready for scrum.
Scrum works as a wrapper for the existing engineering practices. Hence, if you have poor engineering practices then scrum wrapper cannot yield good results. Improve your engineering practices first in order to make scrum wrapper work for you successfully. You may also think of Scrum as a mirror...
Reference: What is scrum?