Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programlama Süreci. STAIR problem çözme süreci State the problem (Problemi tanımlayın) Identify the tools available for solving the problem (Problemi.

Similar presentations


Presentation on theme: "Programlama Süreci. STAIR problem çözme süreci State the problem (Problemi tanımlayın) Identify the tools available for solving the problem (Problemi."— Presentation transcript:

1 Programlama Süreci

2 STAIR problem çözme sü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? Debug terimi nerden geliyor? National Museum of American History

4 Hataları Gidermek Neden Önemli? Tarihteki Büyük Yazılım Hataları Tarihteki Büyük Yazılım Hataları July 28, Mariner I space probe Soviet gas pipeline Therac-25 medical accelerator Buffer overflow in Berkeley Unix finger daemon Kerberos Random Number Generator January 15, AT&T Network Outage Intel Pentium floating point divide 1995/ The Ping of Death June 4, Ariane 5 Flight 501 November 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 and then 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 be ashamed of, and that they are a sign of failure and something to be embarrassed about. Errors are a fact of life, and any programmers who tell you that they can write prefect code all the time are either lying through their teeth or don’t actually do much programming — at least, much serious programming. –Eliminate any testing and beta test stages of software releases, 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 arası kullanıcı sınadı.Ekimde çıkan hazırlık sürümlerinden RC2’yi 50, ,000 arası kullanıcı sınadı. –Windows Vista Geliştirme TarihçesiWindows Vista Geliştirme Tarihçesi –Dell Windows Vista Hazırlıkları: >100,000 hours of testing (52 years)>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 syntax of 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, showing you areas that you need to pay attention to, while error-free statements are examples of things that you are doing right! Stick with programming, and you’ll notice that you make fewer and fewer errors in your code — that’s good progress and something you should feel proud of. But don’t worry with trying to be 100 percent error-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 error thrown up by the compiler as you are in the process or turning your source code into a standalone application. 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 can generate warnings.

18 Error vs. Warning When the compiler encounters an error it aborts the compile and generates the warning. With a warning, the compiler doesn’t abort compiling and 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’ve compiled, such as a C++ application, runtime errors generally mean that you have to go back to the source code to discover what the problem is. With languages that are interpreted, an error like this means that you 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, the errors that would normally be picked up and highlighted by the compiler will not show up until the code is 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 zarardaMüşteri zararda

23 Logic Errors: Infinite Loops

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

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

26 Spotting Errors (Hataların Bulunması) Proper Testing Is Vital 1.Perform desk checking 2.Perform a beta test 3.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 a comment 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


Download ppt "Programlama Süreci. STAIR problem çözme süreci State the problem (Problemi tanımlayın) Identify the tools available for solving the problem (Problemi."

Similar presentations


Ads by Google