Page 201 - DCAP104_EXPOSURE_TO_COMPUTER_DISCPLINES
P. 201

Exposure to Computer Disciplines



                   Notes         Eventually, after coding the program, you must prepare to test it on the computer. This step
                                 involves these phases:
                                   (i) Desk-checking. This phase, similar to proofreading, is sometimes avoided by the
                                      programmer who is looking for a shortcut and is eager to run the program on the computer
                                      once it is written. However, with careful desk-checking you may discover several errors
                                      and possibly save yourself time in the long run. In desk-checking you simply sit down and
                                      mentally trace, or check, the logic of the program to attempt to ensure that it is error-free and
                                      workable. Many organizations take this phase a step further with a walkthrough, a process
                                      in which a group of programmers-your peers-review your program and offer suggestions
                                      in a collegial way.
                                   (ii) Translating. A translator is a program that (1) checks the syntax of your program to make
                                      sure the programming language was used correctly, giving you all the syntax-error messages,
                                      called diagnostics, and (2) then translates your program into a form the computer can
                                      understand. A by-product of the process is that the translator tells you if you have improperly
                                      used the programming language in some way. These types of mistakes are called syntax
                                      errors. The translator produces descriptive error messages. For instance, if in FORTRAN
                                      you mistakenly write N=2 *(I+J))-which has two closing parentheses instead of one-you
                                      will get a message that says, “UNMATCHED PARENTHESES.” (Different translators may
                                      provide different wording for error messages.) Programs are most commonly translated by
                                      a compiler. A compiler translates your entire program at one time. The translation involves
                                      your original program, called a source module, which is transformed by a compiler into an
                                      object module. Prewritten programs from a system library may be added during the link/
                                      load phase, which results in a load module. The load module can then be executed by the
                                      computer.

                                  (iii) Debugging. A term used extensively in programming, debugging means detecting, locating,
                                      and correcting bugs (mistakes), usually by running the program. These bugs are logic errors,
                                      such as telling a computer to repeat an operation but not telling it how to stop repeating.
                                      In this phase you run the program using test data that you devise. You must plan the test
                                      data carefully to make sure you test every part of the program.

                                 9.3.1.5 Documenting the Program

                                 Documenting is an ongoing, necessary process, although, as many programmers are, you may be
                                 eager to pursue more exciting computer-centered activities. Documentation is a written detailed
                                 description of the programming cycle and specific facts about the program. Typical program
                                 documentation materials include the origin and nature of the problem, a brief narrative description
                                 of the program, logic tools such as flowcharts and pseudocode, data-record descriptions, program
                                 listings, and testing results. Comments in the program itself are also considered an essential part
                                 of documentation. Many programmers document as they code. In a broader sense, program
                                 documentation can be part of the documentation for an entire system.

                                 The wise programmer continues to document the program throughout its design, development,
                                 and testing. Documentation is needed to supplement human memory and to help organize
                                 program planning. Also, documentation is critical to communicate with others who have an
                                 interest in the program, especially other programmers who may be part of a programming team.
                                 And, since turnover is high in the computer industry, written documentation is needed so that
                                 those who come after you can make any necessary modifications in the program or track down
                                 any errors that you missed.



        194                               LOVELY PROFESSIONAL UNIVERSITY
   196   197   198   199   200   201   202   203   204   205   206