0% found this document useful (0 votes)
21 views33 pages

CMTE Lecture 4 & 5

The document outlines the software development process, detailing the evolution of computing environments from zero generation to future supercomputers with AI. It describes the stepwise process for writing programs, including problem definition, algorithm design, debugging, testing, and documentation, while emphasizing structured programming styles and control structures. Additionally, it covers error analysis, testing phases, and the importance of both internal and external documentation for program usability.

Uploaded by

Pratap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views33 pages

CMTE Lecture 4 & 5

The document outlines the software development process, detailing the evolution of computing environments from zero generation to future supercomputers with AI. It describes the stepwise process for writing programs, including problem definition, algorithm design, debugging, testing, and documentation, while emphasizing structured programming styles and control structures. Additionally, it covers error analysis, testing phases, and the importance of both internal and external documentation for program usability.

Uploaded by

Pratap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

ME16002 - CMTE

Class 4 & 5

G R K Gupta, MED
SOFTWARE DEVELOPMENT PROCESS
(Reference: Numerical Methods for Engineers by Chapra & Canale)

G.R.K.Gupta
MED
Computing Environments
1. Zero Generation Computers (pre-1951) – Manual and Mechanical
2. First Generation Computers (1951-58) – Computers with Vacuum Tubes
3. Second Generation Computers (1958-1964) – Computers with
Transistors
4. Third Generation Computers (1964-1971) – Computers with Integrated
Circuits
5. Fourth Generation Computers (1971-2010) – Computers with
Microprocessors
6. Fifth Generation Computers (2011-present) – Computers with VLSI
7. Sixth Generation Computers (Future) – Super Computers with AI
Stepwise Process for Writing a Program
1. Defining the Problem
2. Problem Formulation
3. Design of Algorithm – Developing the underlying logic of the program in
logical stepwise procedure
4. Flow Charting – Graphical representation of the algorithm
5. Pseudo Code – uses code like symbols with fundamental control structures
6. Program Composition – Writing the program in high level language
7. Debugging – deals with correcting known errors
8. Testing – with varied data to make it more reliable
9. Documentation – to make it easy to use and understand
10.Storage and Maintainance – backup and upgrading
Programming Style

1.Modular Design – Divide the program into sub-programs or


modules that can be developed and tested separately
2.Top-Down Design – Begins with the most general statement of
the program’s objective and then successively divides it into
more detailed segments. The design proceeds from general to
specific.
3.Structured Design – follows a set of rules that prescribes good
programming style that results in a superior, elegant and easily
understandable code.
Algorithm Design
An algorithm is a sequence of logical steps required to perform a
specific task.
A good algorithm must feature several attributes
1. Each step must be deterministic – that is, nothing is left to chance.
The final results cannot depend on who is following the algorithm.
2. The process must always end after a finite number of steps. An
algorithm cannot be open-ended.
3. The algorithm must be general enough to deal with any
contingency.
Flowcharting

1. A flowchart is visual or graphical representation of an


algorithm.
2. The flowchart employs a series of blocks and arrows, each of
which represents a particular operation or step in the
algorithm.
3. The arrows represent the sequence in which the operations are
implemented.
Flowchart
Symbols
Terminology

9
Pseudocode
Pseudeocode is an alternative way to express an
algorithm that bridges the gap between flow chart and
computer code.
This technique used codelike statements in place of the
graphical symbols of a flowchart.
Algorithm, Flow
chart and Pseudocode
for the problem of
adding two numbers
Top-Down Design Example

A hierarchy of flow charts dealing with the


problem of determining a student’s grade
point average.
(a)Provides a comprehensive plan.
(b)More detailed chart for a major module
(c)Detailed chart for a segment of the major
module.
Detailed flowchart for
computing the average
quiz grade
Structured Design
The following are the rules to be followed by Structured programming
style.
1. Program should consist solely of the three fundamental control
structures of sequence, selection and repetition. It is proved that any
program can be constructed from these three basic structures.
2. Each of the structure must have only one entry and one exit.
3. Unconditional transfers (GOTOs) must be avoided. (Unconditional
transfers may result in spaghetti algorithm)
4. The structure must be clearly identified with comments and visual
devices such as indentation, blank lines, and blank spaces.
• Sequence. Computer code must
be implemented one instruction
at a time, unless you instruct
otherwise. The structure can be
expressed as a flowchart or
pseudocode.

15
• Selection. Splits the program’s
flow into branches based on
outcome of a logical condition.
• Repetition. A means to implement instructions repeatedly.
(IF/THEN/ELSEIF Ladder, SWITCH/CASE)

17
The Fundamental Structures
19
20
Fundamental Control Structures
Pseudocode
for counting
the average
quiz grade
High Level Languages
1.BASIC – Beginner’s All purpose Symbolic Instruction Code
- Interpreter
2.FORTRAN 77 – FORmula TRANslation
3.PASCAL
4.C
5.C++
6.MATLAB – Matrix Laboratory
7.COBOL – COmmon Business Oriented Language
24
DEBUGGING: ERROR ANALYSIS
Types of Errors:
1. Syntax Errors: during compiling phase - violates the rules of the
language such as spelling, number formation, and other conventions.
These errors will be indicated during compiling through error diagonstics
(missing parenthesis, missing semicolon, printing undefined variable etc.
2. Link or Build Errors: during the link phase – misspelled name of a
function – “unresolved external reference”
3. Run-time Errors: during program execution – “divide by zero”, “square
root of a negative number”, “floating overflow”, etc.
4. Logical errors: due to faulty programming logic – will not be indicated
in error diagnostics. “infinite loop”, “wrong formulation””etc.
Debugging
One of the following happen when an error occurs
1. An explicit diagnostic can provide you with the exact location and the
nature of the error.
2. A diagnostic may occur but the exact location of the error is unclear.
3. No diagnostics occur but the program does not operate properly.
We have to Debug in one of the following ways
1. Print out intermediate results.
2. Locate the module with error by printing the results at the entry and exit
of each module.
3. Debug independent modules before integrating them
4. Scan the code line by line doing calculation and checking the values to
identify the exact location of the error.
5. Check from the beginning…formulation of the problem itself.
Testing
One of the greatest misconceptions of the novice programmer is the
belief that, if a prog ram runs and prints out results, the job is done.

1. The results may be completely incorrect.


2. The results may appear to be reasonable, but are in fact wrong.
3. The results may be qualitatively correct, but quantitatively wrong.

To ensure that such cases do not occur, the program must be subjected to
a battery of tests for which the correct answer is known beforehand.
Phases of Testing
1. Module Tests: The modules are run in isolation to determine that they are
executing properly.
2. Development Tests: They are implemented as the modules are integrated into
the total program package. A test is performed after each module is integrated
with a top-down approach that starts with the first module and progresses
down through the program in execution sequence.
3. Whole system tests: After the total program has been assembled, it is
subjected to a series of whole system tests by exposing them to (a) Typical
data, (b) Unusual but valid data, and (c) incorrect data to check the program’s
error handling capabilities.
4. Operational Tests: (Beta testing phase) – To test how the program runs in a
realistic setting. A standard way is to have the ultimate user to implement the
program.
Documentation
Sufficient documentation is to be included to allow the users to
immediately understand the program and how it can be
implemented. It needs

(a)Internal Documentation and

(b)External Documentation.
Internal Documentation
1. Include a module at the head of the program giving program’s title, your
name, date. This is your signature and marks the program as your work.
2. Include a second module to define each of the key variables.
3. Select the variable names that are reflective of the type of information the
variables are to store.
4. Insert spaces within statements to make them easier to read.
5. Use comment statements liberally throughout the program to add explanation
and to skip lines for the purpose of labeling, clarity, and separation of
modules.
6. In particular, use comment statements to clearly label and set off all the
modules.
7. Use indentation to clarify the program structures. In particular, to set off loops
and decisions.
External Documentation.
1. This refers to instructions in the form of output messages and
supplementary printed matter.
2. The messages occur when the program runs and are intended to make
the output attractive and user-friendly.
3. This involves effective use of spaces, blank lines, special characters
etc. to illuminate the logical sequence of structure of the program
results.
4. The program can designed to output descriptive error messages to alert
and inform the user regarding problems.
5. The making of a comprehensive user manual (user’s manual).
Storage and Maintainance
1.When you sign off the computer, your active file will be
destroyed. To retain the program for later use, you must transfer it
to a secondary storage device such as hard disk.
2.It has two other major tasks.
(a) Upgrading the program in light of experience: To gather
feedback regarding suggested improvements in design.
(b) Ensuring that the program is safely stored: A backup copy
should always be created before making major code changes.

You might also like