The documentation of the problem definition should include a description of:
The documentation for these three items, the input, output, and processing steps, is referred to as the program specifications.
As an example of this process, let's define and document a specific programming problem. The accounting department's payroll section is not functioning properly. Checks are issued late, and many are incorrect. Most of the reports to management, local and state governments, and union officials are woefully inadequate. The payroll section's personnel often work overtime to process the previous week's payroll checks.
The problem is fairly obvious-- company expansion and new reporting requirements have strained the accounting department beyond its capacity. A new computerized payroll system has been suggested. Management has agreed with this assessment and has contacted the computer services department for help in solving the problem. The accounting department and computer services department, working together, have defined the problem as shown below.
Problem Definition: Write a program to process the company's payroll. This program will generate not only individual paychecks but appropriate summary reports.
Desired Output: First of all, the payroll program must issue the paychecks. It must also send a statement of weekly and monthly payroll expenses to management and an updated list of changes in employee salaries and positions to the personnel department. The local, state, and federal governments require a monthly report of income taxes withheld, and the union receives payment of employee dues deducted by the payroll section. Not only the checks but all of these reports must be printed by the program. The content and format (layout) of the reports should be deterrnined at this time.
Needed Input: The next step in defining the problem is to determine the input needed to generate the output listed above. This input includes each employee's time card, which contains the employee number and the hours worked each day of the week. Another input, dealing with new employees and changes in pay scales, is sent by the personnel department. Supervisors provide a special form regarding employee pro-motions. The tax section sends updates of tax tables used to calculate local, state, and federal withholdings. The union provides inforrnation about the withholding of union dues. The format and content of the forms used for input must also be determined as part of the process of identifying the needed input.
Processing Requirements: Given the needed output and input, the processing re-quired of the new computerized payroll system is illustrated in the Figure below.
First, each employee's gross pay must be calculated from the employee's time card and pay scale. Second, each deduction regarding taxes and union dues must be determined from the tax rates provided by the tax department and the information regarding union dues provided by the union, and these deductions must be subtracted from the gross pay to arrive at the net, or take-home, pay. Third, each employee's paycheck must be printed. Totals must be kept of all employees' gross pay and net pay values as well as of taxes and union dues withheld. These totals are used to generate reports to management, government, and union officials. In addition, changes in any employee's work status must be reported to the personnel department.
The programmer or system analyst must not only thoroughly understand the problem, but also must write the statement of the problem in a clear, concise style. By documenting the problem, it becomes apparent whether or not it is clearly understood. This written documentation should be shown to the potential user(s) of the program to determine if the analyst's understanding of the problem is the same as that of the user(s). Making certain of this early in the programming process will save time and increase the probability that everyone involved will be satisfied with the end product.