Any good carpenter, joiner, or other worker of materials will tell you to "measure twice, cut once". This is a good philosophy to apply to life and your craft as a software engineer. It implies attention to detail, efficiency and proper preparation; it results in "right first time" components and products, quality and reduced waste.
So, getting your pre-requisites right is important. There are different opportunities to emphasis quality: at the beginning of the project (planning and design), during the construction of the product and at the end of the project (testing). During the construction phase, your only option is to build the product solidly, with quality materials and tools. At the end of the project, when your only option is testing, you can't detect that your product is the wrong solution for the problem, or that it is the right product built in the wrong way. Testing is only one part of quality assurance, and only ensure that the thing is fit for purpose.
Therefore, the planning and design stages are your one opportunity to "get it right", and the cheapest opportunity to resolve any issues. You can, and should, make sure you have the right project and the right plans, and ensure the design is fit for the product. It's a risk reduction process. As my Dad used to tell me, and as his boss (fittingly, in the construction industry) used to say, remember "The Seven Ps": Proper Preparation and Planning Prevents Piss-Poor Performance.