The first step is to gather the requirements to build the software. This can be done in many different ways depending on your organizational culture and environment, detailed as follows:
If you are subject to regulatory requirements (for example, in the aerospace or pharmaceutical business), you need a very formal method
If you are outsourcing development to an external supplier, you need the exact requirements
If development will be handled by an in-house IT department, you might get by with less formal requirements
At the formal end of the spectrum, you need a complete list of all of the requirements that you can test against. If your organization is used to a more informal approach, you might only produce a fairly complete list of use cases or user stories. For a technology replacement project, where you replace a legacy application developed in, for example, Oracle Forms, the requirements might be simply, "it should work like the old system."