1 Structured Programming A VERY important Philosophy for Writing Programs This is supposed to be a refresher only. You are expected to hone your skills.

Презентация:



Advertisements
Похожие презентации
What to expect? How to prepare? What to do? How to win and find a good job? BUSINESS ENGLISH COURSE NOVA KAKHOVKA GUMNASUIM 2012.
Advertisements

How to crack technical interview ? Yogesh Mehla. Many of my friends who are technically good and even great, but they are unable to crack their first.
While its always a good idea to think outside the box when approaching a creative task, this is not always the case. For example, when working with teams,
REFERENCE ELEMENTS 64. If your REFERENCE ELEMENTS toolbar is not in view and not hidden, you can retrieve it from the toolbars menu seen here. 65.
The waterfall model is a popular version of the systems development life cycle model for software engineering. Often considered the classic approach to.
LEADERSHIP SKILLS. Many years of experience in Exploring have shown that good leadership is a result of the careful application of 11 skills that any.
Linux Daemons. Agenda What is a daemon What is a daemon What Is It Going To Do? What Is It Going To Do? How much interaction How much interaction Basic.
Yogesh Mehla Now concept of logic building is not so complex and not so simple. We will not work on how to make logic program in.
The waterfall model is a popular version of the systems development life cycle model for software engineering. Often considered the classic approach to.
S POTLIGHT ON EXAMS FOR STUDENTS OF 11th FORM. P LEASE, TRY TO ANSWER THE QUESTIONS : What kind of job would you like to do? What skills do you need for.
Project Viktorija Stepanova. Computer and Internet dependency.
Why do we learn English at schools. (by Kurdina Ekaterina) Learning a new language often begins at a young age and, at some schools, is continued throughout.
Any film needs a script. The script can be written by yourself or you can buy it. The second is preferable. All good writers are always listed in any.
PERT/CPM PROJECT SCHEDULING Allocation of resources. Includes assigning the starting and completion dates to each part (or activity) in such a manner that.
Teens problems Semenova Nastya The 10 Б form student Teacher: Pshennikova E.D
Welcome to…. YOUR FIRST PART – START TO FINISH 2.
Indirect Questions How do you make indirect questions? When do you use this grammar?
Work Wonders Пашковская Т.А. Лицей I spend about half of my time in my office, and the other half in court. I don`t have customers. I have clients.
The advantages of computers the disadvantages of computers the advantages of computers the disadvantages of computers.
المعلم : خالد محمد بكري الدرس : الكوارث الطبيعية الصف : الأول الثانوي مقدم إلى المدربة الفاضلة : منى البطانية.
Транксрипт:

1 Structured Programming A VERY important Philosophy for Writing Programs This is supposed to be a refresher only. You are expected to hone your skills by writing programs and reading books on structured programming if you have not mastered structured programming

2 Bad Programming Habits Foggy idea about what is to be done Write program with no planning; Start from the beginning and write to the end No systematic debugging; Considered it finished if it works on one example Undesirable Results ! Do not know how to program Programs with numerous bugs that take extremely long time to debug, or even failure to complete Any change of requirement invites rewriting of the entire program again

3 Benefits of Structured Programming Programs that meet the needs of the customer Though initially take longer time to generate code, often result in code with runs with no bugs the first time its run Easy to handle change in program specifications in the future

4 Structured Programming A tool that becomes popular since the 70s Should have been learnt by student that have taken any programming course Absolutely essential for handling large programs that involve a team of programmers and huge number of man hours. The other popular philosophy is object oriented programming, but many programmers prefers structured programming

5 Seven Important Concepts of Structured Programming: 1. Structured Walkthrough Before writing any program, the programming team must sit down with the customer and find out the requirement Extremely important Customers requirement is often imprecise Iterative: several rounds of talks Must result in a specifications that is very precise Understandable by programmer in programming terms

6 2. Stepwise Refinement A DIVIDE and CONQUER strategy When given a large job, divide it into smaller jobs. Given any job, it is useful to divide it into Input Process Output Draw a tree Refine each job level by level (Breadth first) Use pseudo code to describe each job Decision on data structure is delayed as much as possible

7 Extremely Complex Job InputProcessOutputLevel 1 Input from user Initialize … … Level 2 Initialize security settings … Level 3

8 3. Modular Design Each ellipse is a module A module is a self contained block: It only receives inputs from its immediate ancestor It only outputs to its immediate ancestor Its computation should only require calling functions that are its immediate children and them only The input variables and output variables of each module should be specified when defining the module Each module must be programmable – no majic block should exist

9 4. Bottom Up Coding When the refinement has reached a simple function, code the simple function You can test the simple function independently of the rest of the program This gives you achievement and satisfaction, sustaining you through the long project Project Manager exercises division of labour here, ask a member to be responsible solely for that function

10 5. Testing Using Stubs A structured Programming project can be field tested before everything finishes Stubs - for unfinished modules, use a human being to emulate it, act on the test inputs, she fits in the correct output data by hand then other programmers can test their work Meanwhile she continues to program her own module (according to MS Project timelines)

11 6. White Box and Black Box Testing For each module and whole program White Box Input something for which you know the desired result, it should give your expected output Black Box Treat it as a black box, input some data, is the result reasonable?

12 7. Structured Programming Documents A structured programming document is generated along with the program When requirement of customer changes, go to the document Does not need to rewrite the whole program, just find which modules need to rewrite and rewrite the module and the sub-tree under it Programmer usually forgets their code in 2 months; the structured document helps her to refresh her work quickly

13 Advice YOU MUST TRY IT TO LEARN IT

14 References General Philosophy Numerous books about Structured Programming in the library C B.A. Forouzan, R.F. Gilberg, Computer Science: A Structured Programming Approach Using C A very good structured programming example W. Findlay and D.A. Watt, Pascal: An Introduction to Methodical Programming 1987, Ch. 7 illustrates how to use stepwise refinement to program a complicated task. Try it YOURSELF once, then you would get it