1 / 29

Programlama Süreci

Programlama Süreci. STAIR problem çözme süreci. S tate the problem (Problemi tanımlayın) Identify the t ools available for solving the problem (Problemi çözmek için mevcut araçları belirleyin) Write an a lgorithm (Bir algoritma yazın) I mplement the solution (Çözümü gerçekleştirin)

cfreda
Download Presentation

Programlama Süreci

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programlama Süreci

  2. STAIR problem çözmesüreci • State the problem (Problemi tanımlayın) • Identify the tools available for solving the problem (Problemi çözmek için mevcut araçları belirleyin) • Write an algorithm (Bir algoritma yazın) • Implement the solution (Çözümü gerçekleştirin) • Refine the solution (Çözümü sadeleştirin) • Testing the solution, fixing bugs, and making enhancements

  3. Debug terimi nerden geliyor?National Museum of American History

  4. Hataları Gidermek Neden Önemli?Tarihteki Büyük Yazılım Hataları • July 28, 1962 -- Mariner I space probe • 1982 -- Soviet gas pipeline • 1985-1987 -- Therac-25 medical accelerator • 1988 -- Buffer overflow in Berkeley Unix finger daemon • 1988-1996 -- Kerberos Random Number Generator • January 15, 1990 -- AT&T Network Outage • 1993 -- Intel Pentium floating point divide • 1995/1996 -- The Ping of Death • June 4, 1996 -- Ariane 5 Flight 501 • November 2000 -- National Cancer Institute, Panama City

  5. Debugging (Hata Ayıklama, Hata Giderme) • Errors are a fact of life when it comes to programming. • The trick is knowing how to trace them andthen fixing them before other people get their hands on your program! • Bu derste bahsedeceklerimiz: • Programlama hataları çeşitleri, • Programlama hataları neden olur, • Programlama hataları nasıl düzeltilir, • Programlama hatalarının ardındaki psikoloji ve bazı hatalarla neden diğerlerinden fazla karşılaştığımız.

  6. Yamalar, düzeltmeler, güncellemeler, v.s. • Microsoft Windows XP • SP1, SP2, SP3 • Microsoft Windows 2000 • SP1, SP2, SP3, SP4 • Office 2003 • SP1, SP2, SP3 • Örnek Güncellemeler, yamalar, düzeltmeler

  7. Psikolojik Gaz  • New programmers quickly get the impression that making mistakes and getting error messages is something to beashamed of, and that they are a sign of failure and something to be embarrassed about. • Errors are a fact of life, and any programmers whotell you that they can write prefect code all the time are either lying through their teeth or don’tactually do much programming — at least, muchserious programming. • Eliminate any testing and beta test stages of softwarereleases, and save millions of dollars, releasing perfect software that didn’t need service packs,maintenance releases, or patches and so save even more money. • Windows Vista:Ekimde çıkan hazırlık sürümlerinden RC2’yi 50,000 - 100,000 arası kullanıcı sınadı. • Windows Vista Geliştirme Tarihçesi • Dell Windows Vista Hazırlıkları: >100,000 hours of testing (52 years)

  8. Herkes hata yapabilir. Bu hayatın gerçeği.

  9. Initially, you are bound to make more errors in your coding simply because you are learning. The syntaxof statements takes time to grasp, operators are unfamiliar, and basic coding practices are foreign to you:until you are comfortable with these, errors will happen. Look at mistakes as learning pointers, showingyou areas that you need to pay attention to, while error-free statements are examples of things that youare doing right! • Stick with programming, and you’ll notice that you make fewer and fewer errors in your code — that’sgood progress and something you should feel proud of. But don’t worry with trying to be 100 percenterror-free, leave that to the “perfect” programmers who feel they have to show off!

  10. Hata Çeşitleri • Are errors all created the same? • Are there different types of errors? • Different Kinds of Error • Compiler errors • Runtime errors • Logic errors

  11. Compiler errors (Derleyici Hataları) • A compiler error is an errorthrown up by the compiler as you are in the process or turning your source code into a standaloneapplication. • It’s important to note that you will only get a compiler error if you use a compiler

  12. Compiler Errors: Örnek 1

  13. Compiler Errors: Örnek 2

  14. Compiler Errors: Örnek 3

  15. Compiler Errors: Örnek 4

  16. Compiler Errors:Örnek 5

  17. Compilers also cangenerate warnings.

  18. Error vs. Warning • When the compiler encounters an error itaborts the compile and generates the warning. With a warning, the compiler doesn’t abort compilingand still builds an executable as normal.

  19. Runtime Errors (Çalışma Zamanı Hataları) • Runtime errors are errors that appear in your program when you run it. With an application that you’vecompiled, such as a C++ application, runtime errors generally mean that you have to go back to the sourcecode to discover what the problem is. With languages that are interpreted, an error like this means thatyou have to go back to the code and examine it. • When you are using a language that is an interpreted language as opposed to a compiled language, theerrors that would normally be picked up and highlighted by the compiler will not show up until the codeis run and these become runtime errors.

  20. Runtime Errors: Örnek • Tracing runtime errors in compiled code is tricky in that the application gives you a memory address and not much more. Debugging can be time-consuming and tricky.

  21. Logic Errors (Mantık Hataları) • Logic errors are among the hardest errors to spot simply because they aren’t errors that affect whether the code runs or compiles, but they are errors that affect how the code works. Usually, you wanted your code to do one thing, but wrote something else by mistake.

  22. Logic Errors: Örnek Olması gereken Dükkan zararda Müşteri zararda

  23. Logic Errors: Infinite Loops

  24. = (Atama) == (Karşılaştırma) Logic Errors: Using the wrong operator

  25. Mantık hataları nasıl önlenir? • The only effective ways to prevent code containing logic errors from making it out into the wide worldis by thorough analysis of the code and careful, comprehensive testing of the code, using a variety ofinputs and checking them against independently worked-out outputs.

  26. Spotting Errors (Hataların Bulunması) • Proper Testing Is Vital • Perform desk checking • Perform a beta test • Compare results of the beta test against the old system's parallel test results • Read Each Line After You Press Enter • Does it look right? • Can you spot any typos or other odd errors? • Does it accomplish what you set out for it to do? • Have you used the appropriate line terminator? • Check the Preceding Statements

  27. Spotting Errors (Hataların Bulunması) • Keep the Layout Clear void functionname() { // Code goes here. } • Comments, Comments, Comments! • If you comment out a line of code to replace it with another or just to get rid of it, remember to add acomment detailing why you removed it and when

  28. Spotting Errors (Hataların Bulunması) • Remove Ambiguity (Belirsizlik) in Code • Semicolons • Semicolons go after complete statements. for( x = 0; x < 100; x++); { cout << “Hello, World!” << endl; }

  29. Spotting Errors (Hataların Bulunması) • Test the Code • Keep Track of Variables

More Related