**Stages of Program Development process/**

**Phases of Program Development process**

How to developed Program?

If we want to develop a program using any programming language (like C/C++/Java/PHP etc.), we follow a sequence of steps. These steps are called phases/Stages in program development.

The various stages in the development of a computer program are:

1. Problem Analysis: Reading and Understanding or identification of the problems.

**e.g. ****Problem: Finding GCD/HCF of two number **

Greatest Common Divisor (GCD)/Highest Common Factor(HCF) of two numbers. The GCD of two integers x and y is the largest number that divides both of x and y without leaving a remainder. In the GCD user enters two numbers.

GCD of 16 and 20 is 4

GCD of 43 and 37 is 1

2. Data and Task Analysis– Define suitable data structure

in this stages. All required data input and output consideration in this stage. Data names (variables), Data Type and Data size declared in this phase.

Task means process, processing step design in functions / procedures / modules. How many functions which operated in data used in program considered in this phase.

**e.g. **In above problem the data part used int x,y, r; here x and y is input data and r stored the result(output) all data (variables) are integer type and used 2 bytes (16 bits) of memory each.

We can use/design separate function/procedure/module as name gcd() which return single result and takes two values(arguments).

/* gcd function definition */

int gcd(int a, int b)

{

while(a!=b)

if (a>b)

a=a-b;

else

b=b-a;

return(a);

}

3. Program Design: The software developer makes use of tools like algorithm, flowchart and Pseudocode to develop the design of the program.

(a) Algorithm: Step by step solution of any problem called algorithm. Steps written in sequence and finite set.

Example:

Write an algorithm to Finding GCD/HCF of two number.

**Solution:**

Step1: Start

Step2: Read x, y

Step3: Repeat step 4 while (x!=y)

Step4: if x>y then

x = x-y

else

y= y-x

Step5: Write “GCD: ”, x

Step 6: End

Figure: To draw find GCD of two given integer number

(c) Pseudocode- Pseudocode is a programming analysis tool, which allows programmers to plan program logic by writing the program instructions in an ordinary natural language, such as English.

Example: Write Pseudocode to Finding GCD/HCF of two number.

**Solution:**

Write “Enter two Integer Numbers “

Read x,y

DO WHILE (x is not equal to y)

IF x>y THEN

x = x-y

ELSE

y= y-x

ENDIF

ENDDO

Write “GCD: ”, x

End

4. Source Code: Once the design process is complete the Algorithms convert into appropriate Computer Programming

Languages. Computer programs which written in High Level Language (C/C++/Java) called source code.

**Source Code of C Language**

/*Source Code of C Programming Language */

/* program calculate GCD of given two integers*/

#include<stdio.h>

#include<conio.h>

int gcd (int a, int b); /* function prototype Declaration */

void main()

{

int x,y, r;

clrscr();

printf(“Enter the two integer number\n”);

scanf(“%d%d”,&x,&y);

r= gcd(x,y); /* function calling with 2 arguments */

printf(“Greatest Common Divisor = %d\n”,r);

getch();

}

/* gcd function definition */

int gcd(int a, int b)

{

while(a!=b)

if (a>b)

a=a-b;

else

b=b-a;

return(a);

}

5. Testing and Debugging:

Testing is a process of finding bugs or errors in a software product that is done manually by tester or can be automated.

Debugging is a process of fixing the bugs found in testing phase. Programmer or developer is responsible for debugging and it can’t be automated.

6. Documentation:

Documentation is a very essential step in the program development. Documentation help the users and the people who maintain the software. This ensures that future modification if required can be done easily. Also it is required during redesigning and maintenance.

7 Maintenance:

Updating and correction of the program for changed conditions and field experience is accounted for in maintenance.