100 likes | 115 Views
Learn about the software life cycle and the techniques for programming and problem solving. Understand the steps involved in program development, from problem analysis and specification to algorithm design, coding, execution, testing, and maintenance.
E N D
CS 160Lecture 6 Martin van Bommel
Program Development • Software Engineering • study and use of techniques for programming and problem solving • Software Life Cycle • software development goes through cycles, where begins again when software outdated
Software Life Cycle 1. Specify the problem requirements. 2. Analyze the problem. 3. Design the algorithm to solve the problem. 4. Implement the program. 5. Test and verify the completed program. 6. Maintain and update the program.
Problem Analysis and Spec. • Determine its input • what information is given • what items are important to solving problem • Determine its output • what information must be produced to solve the problem • Determine scope of the problem • questions, questions, and more questions
Algorithm Design • Procedure to convert inputs to outputs • Uses step-by-step process • Top-down step-wise refinement • Produce pseudo-code or flowchart
Algorithm • Three basic forms of control 1. Sequential - one step after another 2. Selection - choose one of many alternatives 3. Repetition - one or more steps repeatedly
Program Coding • Program should be correct, readable, and understandable • Simple and clear - no tricks • Modular - program and test subtasks of overall problem separately • Conforms to syntax of language
Program Formatting • Spaces between items in statements • between variables and operators • Blank lines between major sections • each subpart separated from others • Good indentation • indent statements in loops • Meaningful variable names • Distance and Time instead of d and t
Execution and Testing • Test each unit separately before combining • Use expected data with known result • Use unexpected data to check for problems • Validation - tested with several sets of test data, but never can tell if absolutely valid.
Program Maintenance • Programs survive for many years • New features must be added • Laws, rules, and procedures change • Hardware changes • e.g. Year 2000 problem