Lecture 3 - Introduction to Software Development


Home


Objectives

Contents


1. Why do we need Programs?

Programs are needed for problems that:

2. Alternatives to Writing Programs

Writing a program isn't always the best solution to a problem. There should be a good reason to write a program.

Some alternatives

Advantages of Writing Software

Disadvantages of Writing Software

Advantages of using Packages

3. What do Programmers do?

Programmers don't spend all day coding programs. Their duties vary widely, with programming typically being an important part of there duties, but far from taking the majority of their time.

To be able to write a program programmers need to:

Along the way programmers will:

4. Basic Operations of a Computer

To be able to write computer programs we need to be aware of what a computer can do. In broad terms the basic operations that can be performed on a computer are:

1. Get information

2. Output information

3. Perform calculations

4. Store data to memory

5. Retrieve data from memory

6. Decide between alternative instructions

7. Repeat instructions

5. Software Development/Construction

Computer software can be incredibly complex, with some system being in excess of 20 million lines of code! We will be looking at very small programs in this subject, however many of the same principles apply to small and large systems.

Many people in the class won't have programmed before. While many people won't have programmed, it can be useful to give an overview of what software development is about. Creating software has many parallels with constructing a building. We'll look at the steps involved in constructing a building to help gain in insight into the processes that are undergone when constructing software and why the steps are needed.

5.1 Constructing a Building

Some of the things that may be done are:

1. Feasibility study

 
 

2. Concept planning

 
 

3. Design

 
 

4. Building

 
 

5. Handover

 
 

6. Maintenance

 
 

5.2 Constructing Software: Steps in Software Development

Systems or programs of any size have similar phases or steps. The following steps are based on Robertson p2-3. The words in italics are tools and techniques used by programmers that will be discussed in more detail later in this subject.

1. Define the problem

2. Specify a high level solution

3. Outline the solution

4. Develop the outline into an algorithm

5. Test the algorithm for correctness

6. Code the algorithm into a specific programming language

7. Test the program

8. Debug the program

9. Document and maintain the program

A disciplined approach to software development saves money and builds more reliable software.

The above terms will be introduced/covered in this subject in more detail.

6. Defining Diagrams

Before writing a detailed solution to a problem, it is essential that the problem to be solved is understood.

We will be using Defining Diagrams to provide and give an overview of the problem. Defining Diagrams are used to broadly state what is to be used (inputs), and what is to be done (processing) to solve the problem, and the results (outputs).

In the following example we will look at the first 2 steps in software construction: Define the problem and outline the solution.

Problem Description

Input two numbers, add the two numbers together and display their total.

Example Program Runs

An example run represents a generic run of the program using a simple user interface. A real program run, when implemented in a particular programming language may look different (e.g. it may use input boxes or dialog boxes, buttons etc), but should do the same task.

A number of conventions will be used to aid in understanding example program runs:

  1. Run will be used to indicate that the program is to be executed
  2. Input prompts will normally be indicated by the variable name followed by a question mark (?)
  3. Values input by the user will be shown in bold and italics
  4. Variables displayed by the user will usually be in the format variable-name = variable-value

Example Program Run

Run
Number 1 ? 10
Number 2 ? 3
Total = 13

Note: This is a simple problem, however it allows the concepts and techniques used to be demonstrated.

6.1 Understand the Problem

Step 1a: Carefully read the problem, a number of times if necessary, writing down any key information, highlighting keywords etc.

Step 1b: Check your understanding of the problem.

 

This is an important step. All too often, problems occur in later steps because the programmer didn't really understand what was required.

6.2 Specify a High Level Solution (Defining Diagram)

Study the problem identifying the inputs, processing and outputs.

Inputs and outputs are usually the things being acted on and are usually referred to by descriptive words e.g. two numbers, total

 

The processing required is usually indicated by verbs - indicating the actions to be performed e.g. input, add, display

 

Step 2a: Determine the outputs (result) required:

It is often easiest to identify the output(s) for a problem.

Step 2b: What processing is required to get to obtain the result:

 

Step 2c: What inputs are needed:

What is the least amount of information that must be supplied by the user. If the information can be provided by another source (e.g. calculation) then don't ask the user. The two numbers to be added can only be obtained from the user, there is no other way to get them.

 

Step 2d: Develop the Defining Diagram

Defining Diagram

The defining diagram provides a high level outline of the algorithm and data used. For most problems it isn't feasible or wise to leap straight into pseudo code or program code - defining diagrams allow the programmer to broadly specify what is to be done without getting immersed in too much detail. Keeping complexity to a minimum is essential if larger problems are to be successfully tackled.

 
 
  
	
	

The next steps in software development will be covered in the next few lectures.


Key Points

Further Reading


Written by Tim Whitfort.