90 likes | 112 Views
The Art of Programming. Top-Down Design. The Art of Problem Solving. The art of problem solving is the transformation of an English description of a problem into a form that permits a mechanical solution.
E N D
The Art of Programming Top-Down Design
The Art of Problem Solving • The art of problem solving is the transformation of an English description of a problem into a form that permits a mechanical solution. • A straightforward example of this process is transforming an algebra word problem into a set of algebraic equations that can then be solved for the unknowns.
Software Development Method • Requirements specification • Analysis • Design • Implementation or coding • Testing
Requirements Specification • State the problem and gain a clear understanding of what is required for the solution. • Sounds easy but can be most difficult part • Must define the problem precisely • eliminate unimportant aspects • zero in on root problem
Analysis • Identify input and outputs • What information should the solution provide? • What data do I have to work with? • Identify data types needed
Design • Develop a list of steps to solve the problem. This is called an algorithm. • First list the major steps of the problem that need to be solved (subproblems) • Now attack each of the subproblems. This is called refining the algorithm. (this process is like divide and conquer)
Implementation or Coding • Notice that until now the steps are the same regardless of the programming language you are using. • Translate your algorithm from pseudocode to Pascal. • Good programming style • comments
Testing • Test the completed program and verify it works as expected. • Don’t rely on just one test case. Run the program using several different sets of data. • Try to trick the program. A well written program should handle any error a user may make.
Midterm #1 • Chapters 1 (not really), 2 (not really), 3, 4, 5 • February 24, 2000 (two weeks from today) • I expect to finish chapter 5 on February 17 • February 22 will be a review (there is a chance we will have 1 or 2 topics to finish from chapter 5 that day)