CHAPTER:14 Programming Methodology Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.

Slides:



Advertisements
Similar presentations
P5, M1, D1.
Advertisements

Programming Types of Testing.
Chapter 2: Input, Processing, and Output
CS 201 Functions Debzani Deb.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Chapter 1 Program Design
Introduction to C Programming
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 3 Planning Your Solution
BPC.1 Basic Programming Concepts
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 02.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to High-Level Language Programming
Introduction to Systems Analysis and Design Trisha Cummings.
Structured COBOL Programming, Stern & Stern, 9th edition
1 Shawlands Academy Higher Computing Software Development Unit.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Programming Lifecycle
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
The Java Programming Language
PROGRAMMING METHODOLOGY STYLISTIC GUI DELINES Meaningful Names for Identifiers. Guidelines followed while dealing with identifiers. 1. Assign meaningful.
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
CHAPTER:11 Programming Guidelines in JAVA Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 1 Introduction to Structured Design. Introduction  System  A combination of people, equipment, and procedures that work together to perform.
SE: CHAPTER 7 Writing The Program
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
I Power Higher Computing Software Development The Software Development Process.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
The Software Development Process
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
PROGRAMMING GUIDELINES. SYLISTIC GUIDELINES  Meaningful names for identifiers Identifiers identify different parts of C++ programs. Identifiers should.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Program Development Cycle
Intermediate 2 Computing Unit 2 - Software Development.
The Hashemite University Computer Engineering Department
Error Handling Tonga Institute of Higher Education.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
ICS 3UI - Introduction to Computer Science
Lecture 1 Introduction Richard Gesick.
Chapter 2: Input, Processing, and Output
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Unit# 9: Computer Program Development
Problem Solving Techniques
Program Design Introduction to Computer Programming By:
PROGRAMMING METHODOLOGY
Chapter 2: Input, Processing, and Output
CHAPTER 6 Testing and Debugging.
The Software Development Cycle
Presentation transcript:

CHAPTER:14 Programming Methodology Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND

Objective  In this presentation you will learn about the various guidelines regarding development of a good program.  Understanding goodness of a program  Steps to develop a Program.  Errors classification and understanding  Program Testing  Documentation

SYLISTIC GUIDELINES  Meaningful names for identifiers Identifiers identify different parts of C++ programs. Identifiers should have meaningful names.  Guidelines followed while dealing with identifiers- Assign meaningful names for identifiers. That is Variable, Class and Methods. Do not use similar looking names e. g.,manage,manager. Always assign names to scalar constants (created with final keyword) as it helps in clarity & readability.

 Ensure Clarity of Expressions: Expression in the program should be written clearly. Proper parenthesis may be used to enhance the clarity of the expression. Expressions carry out the specified actions. Avoid programming tricks whose intent will not be obvious to a reader. Never sacrifice clarity of expressions even if changed (but unclear) expressions may get you minor gain in machine execution time. Use standard methods in to enhance readability e.g.,use Math.sqrt () to calculate square root rather than writing your own logic for it.

 Use Comments & Indentation  Comments play very important role as they provide internal documentation of a program. Indentation makes the statements clear & readable.  C++ comments are given either by //or /*....*/brackets 1.Always insert prologues, the comment in the beginning of a program. 2.Insert explanatory comments where ever applicable. 3.Use comments to help identify {…}pairs greatly & enhance program understanding. 4.Always indent statements to highlight nesting of groups of control statements.

=> The insertion of blank lines & blank spaces: Blank lines can inserted before the declaration of blocks, comment lines, method’s prototype etc. It increases readability. Space must be given before and after an operator to make it more readability.. =>C++ provides free formatting styles: Program should be pretty typed i.e. All the statement must be written in separate lines. So that program may be readable and understandable. When program is formatting is done to make a program more readable, it is called pretty printing.

 Characteristics of a Good program: A good Program not only efficiently solves the given problem but also it should be presentable. The following features are expected for its goodness-  Effective and efficient: The program produces correct results and is faster, taking into account the memory constraints  User Friendly: The program should be user friendly. The user should not be concerned about what is happening inside the program.  The user should be only responsible for providing the input data values and rest everything be the program’s responsibility.  The output provided by the program should also be easily understandable and presentable.

 Self-Documenting Code: A good program must have self-documenting code. The source code that uses meaningful names for constants, variables and subprogram identifiers to clarity their meaning in the program is called Self-Documenting Code  Reliable: The program should be reliable i.e. it must be able to handle unexpected situation like wrong data or no data. The program should display proper error messages.  Portable: The program should be portable i.e. It should be able to run on different platforms.

STAGES OF PROGRAM DEVELOPMENT PROCESS: A program development problem is a step by step process where each stage contributes to building of an effective and efficient program. => There are four stages in program development process as given below: 1.Crack the problem: The problem is cracked and an algorithm is formulated which gives the solution for the problem. 2.Code the Algorithm: The algorithm should be translated into the program(source code)carefully to avoid errors that may crop up. 3.Compile the program: It is a process to convert the source code into the object code and reported errors should be rectified 4.Execute the program: At the run time,errors if any,should be removed & 3rd stage should be repeated to compile & finally execute the corrected version of the program.

 ROBSTNESS The ability of a program, to recover following error & to continue operating within its environment, is Robustness.  GUARD CODE: The code that can handle exceptional data errors and operational errors is called Guard Code.

Types of errors in the program An error or ‘Bug’ is anything in the program code that prevents a program to run in correct manner.  compile-time errors: An Errors that occur during compiling-time,are known as compile- time errors.

 Syntax Error: It is occurred when rules of the programming language are not followed. It is most common due to spelling errors in the Keywords and methods.  Semantic Error: It is occurred when a statement written is not meaningful. Ex. X + Y = Z  Logical Error: When Program does not give correct result due to mistake in the calculation or use of operators etc. These errors are most difficult to trace in a big sized program.  Run Time Error: This error occurred at Run-Time and it is due to incompatible Data Types used, divide by zero in the expression etc. which may cause the termination of program execution abnormally.

 Run time errors are also called exceptions, and handling such errors in the application is called exception handling  Exception : Unexpected situation or unexpected error, during program execution is known as Exception.  Exception Handling: Way of handling anomalous situation in a program-run, is known as Exception Handling Advantages: 1. Exception Handling separates error-handling code from normal code. 2. It clarifies the code and enhances readability. 3. It makes for clear, robust, fault-tolerant programs

PROBLEM SOLVING METHADOLOGY AND TECHNIQUES The following steps are taken while designing a program- 1. Understanding the Problem 2. Analyzing the Problem 3. Designing the Program 4. Coding the Program 5. Testing & Debugging The Program 6. Documentation 7. Maintenance of the Program

1.Understand the problem: You must recognize the need of program. Try to explore ‘WHAT’ component in the problem 2.Analyse the problem :After determining the need, carefully analyze the problem to get an effective solution. Try to explore the inputs to get required output. 3. Design the program: In this step ‘HOW’ component is explored. Try to find out the best sequence of steps (Algorithm) to solve the problem. A big problem can be broken in to smaller portion to get effective solution. -The logical sequence of precise steps that solve a given problem, is called Algorithm.

4.Coding of Program: The translate your solution into Programming Language. While translating you need to identify the control structure, arithmetic and logical calculations to be used. An IDE (eg. NetBeans) can be used to code the Program. 5.Test & Debug the program: Once a Program has been coded, it can be executed and find out the errors (Syntactical & Logical), if any. The errors also termed as ‘bugs’. Testing is the process of finding errors in a program,and debugging is the process of correcting errors found during the testing process.

6.complete your documentation: Documentation helps to others to understand the program. Details of the program including its source code, Input/Output screen and its operating instructions are recorded and compiled in the form of booklet. 7.Maintenance of the Program Maintenance is required To modify the program, To remove the undetected errors or To enhance the program functionality To keep the program up-to-date with its environment.

=>DOCUMENTATION: Documentation refers to written descriptions,specifications, design, code and comment, internal and external to a program, which make a program more understandable, readable and more easily modifiable. MODULES OF DOCUMENTATION: Modules make information easily accessible to the specific user for which they were prepared and they reduce the costs of production and maintenance. The aggregation of modules and their details would depend upon

1. Complexity of the system 2. Technical sophisticated of user 3. People involved in development and use 4. Expected life of documentation =>A User Documentation (or Manual) Should provide the following information 1.General Description 2. Run flow & Description 3. Logic Flow

4. Program Testing 5. File Description 6. Record Layouts 7. Output Specification 8. File Disposal 9. Error Message 10. Special run instructions 11. Security consideration 12. Restart and Recovery Procedures

=>Programmer ‘s Documentation (Technical Documentation ) : It Provides the technical part of the documentation. It also provide to insure smooth, easy and right maintenance for the system. =>There are two type of Technical Documentation 1. External Documentation 2. Internal Documentation

=> The Eternal Documentation of a program consists of a written information that is outside the body of the source code. that is History, modification design,User manual of a program. =>Internal Documentation: It includes comments, self Documentation code and program formatting. =>Uses of Documentation: 1. Facilitates communication about an application between the technical development personnel and the non-technical users

2. Useful for technical personnel not only during development, but also during operations and normal maintenance. 3. Essential during abnormal or urgent maintenance 4. Very helpful in initiating and training 5. Enable trouble shooting when the application system breaks down 6. Essential for internal and external control 7. Ensures that all commitments and expectation are on record

The documentation module (also called Manual) may be following types as per their contents.  User Manual: Describes how to use the program and contains all the I/O screens and operating instruction for its user.  Operation Manual: Describes the various steps to perform a specific task using the system.  Program Manual: It contains the Source code of the program for reference purpose. It is required during program Maintenance.  System Manual: It contains overall specification, results of all the program development stages etc.

Program Maintenance: Program maintenance refers to the modification of a program, in order to meet changing requirements or to take care of undetected errors. The following types of Maintenance may occur:  Corrective Maintenance: It is required to correct the errors which were undetected during the design of the program.  Adaptive Maintenance: Change in user’s need or program environment may occur and program must be changed to adapt such changes. This change in the program is called Adaptive Maintenance.

 Preventive Maintenance: Sometimes you could anticipate the errors before they actually occur. Preventive Maintenance is carried out to avoid such errors.  Perfective Maintenance: To cope with changing world i.e. changes in the technology, you should tune your system to keep it up-to-date. Due to arrival of new technology and facilities, the program is updated to make it perfect in respect of new technological need.