payroll 12

Upload: sanket9996

Post on 01-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Payroll 12

    1/124

    PAYROLLMANAGMENT

     

    SYSTEM

      SUBMITTED BY:

  • 8/9/2019 Payroll 12

    2/124

    ACKNOWLEDGEMENT

    With Candor and Pleasure I take opportunity to

    express my sincere thanks and obligation to my

    esteemed guide . It is because of his able and

    mature guidance and co-operation without which

    it would not have been possible for me tocomplete my project.

    It is my pleasant duty to thank all the staff 

    member of the computer center who never 

    hesitated me from time during the project.

    inally! I gratefully acknowledge the support!

    encouragement " patience of my family! #nd as

    always! nothing in my life would be possible

    without $od! %hank &ou'

  • 8/9/2019 Payroll 12

    3/124

    (. Preface

    ). *ystem *tudy

    ).(. Introduction

    ).). easibility *tudy

    ).+. *ystem ,verview

    +. *ystem #nalysis

    +.(. Importance of Computeried

    P#&,// 0#1#$021% *ystem

    +.). #bout the Project

    +.+. unctional e3uirements

    4. *ystem 5esign

    4.(. *ystem 5evelopment Cycle

    4.). Context /evel 55

    4.+. 55 for Car enting *ystem

    4.4. *earch Process

    6. 5ata 5ictionary

    TABLE OF CONTENT

  • 8/9/2019 Payroll 12

    4/124

    6.(. Physical 5esign

    6.). *ource Code

    7. %esting7.(. %esting Phases

    7.). 8erification " 8alidation

    7.+. eports

    9. *ystem Implementation

    :. Post Implementation 0aintenance and eview

    ;.

  • 8/9/2019 Payroll 12

    5/124

    PROBLEM DEFINITION

    1.1 INTRODUCTION TO THE PROBLEM:

    %his is a Project work undertaken in context of partial fulfillment of the ?I%.

    *ince P#&,// is associated with the lives of common people and their 

    day to day routines so I decided to work on this project. %he manual

    handling of the record is time consuming and highly prone to error. %he user 

    can inputs codes of

    2mployee he wants to see Pay *lip. %he activities like see 2mployee ecord

    ! add ecord! modify records! delete ecord and finally receiving Pay *lipcan be performed easily. .

    I found two main key-points to design and programmed my project using

    %

  • 8/9/2019 Payroll 12

    6/124

    %he complete set of rules " procedures related to Payoll and generating

    report is called DP#&,// 0#1#$2021% *&*%20E. 0y project gives

    a brief idea regarding automated Payroll activities.

    %he following steps that gives the detailed information of the need of 

     proposed system areF

    Perform!"e: 5uring past several decades! the Payroll is supposed tomaintain manual handling of all the Payroll activities. %he manual handling

    of the record is time consuming and highly prone to error. %o improve the

     performance of the payroll system! the computeried payroll system is to be

    undertaken. %he computeried project is fully computeried and user 

    friendly even that any of the members can see the report and status of the

     pay.

    Eff#"#e!"$: %he basic need of the project is accuracy and efficiency . %he project should be efficient so that whenever a 2mployee is added!add his

    ecord ! delete his record! display and generate his payslip.

     

    Co!%ro&:  %he complete control of the project is under the hands of authoried person who has the password to access this project and illegal

    access is not supposed to deal with. #ll the control is under the administrator 

    and the other members have the rights to just see the records not to change

    any transaction or entry.

    Se"'r#%$: *ecurity is the main criteria for the proposed system. *inceillegal access may corrupt the database. *o security has to be given in this

     project.

    Sof%(re: *oftware includes the platform where the Payroll project is being prepared. I have done my project using DOS )*e+ Com,#&er

    TURBO C--  platform and the database is the FILE HANDLING

  • 8/9/2019 Payroll 12

    7/124

    MECHANISM OF TURBO C--. ?ut it is not necessary that we have to

    first install %urbo C@@ to run this project.

    OBECTI/E

  • 8/9/2019 Payroll 12

    8/124

    5uring the past several decades personnel function has been

    transformed from a relatively obscure record keeping staff to

    central and top level management function. %here are many factors

    that have influenced this transformation like technologicaladvances! professionalism! and general recognition of human

     beings as most important resources.

    # computer based management system is designed to handle all the

     primary information re3uired to calculate monthly statements of 

    2mployees ecord which include monthly statement of any month.

    *eparate database is maintained to handle all the details re3uired

    for the correct statement calculation and generation.

    %his project intends to introduce more user friendliness in the

    various activities such as record updation! maintenance! and

    searching. %he searching of record has been made 3uite simple as

    all the details of the 2mployee can be obtained by simply keying in

    the identification of that 2mployee. *imilarly! record maintenance

    and updation can also be accomplished by using the identification

    of 2mployee with all the details being automatically generated.%hese details are also being promptly automatically updated in the

    master file thus keeping the record absolutely up-to-date.

    %he entire information has maintained in the database or iles and

    whoever wants to retrieve can=t retrieve! only authoriation user 

    can retrieve the necessary information which can be easily be

    accessible from the file.

    %he main objective of the entire activity is to automate the processof day to day activities of pay.

  • 8/9/2019 Payroll 12

    9/124

    FEASIBILITY STUDY

  • 8/9/2019 Payroll 12

    10/124

    %he feasibility study proposes one or more conceptual solution to the

     problem set of the project. In fact! it is an evaluation of whether it is

    worthwhile to proceed with project or not.

    easibility analysis usually considers a number of project alternatives! one

    that is chosen as the most satisfactory solution. %hese alternatives also need

    to be evaluated in a broad way without committing too many resources.

    8arious steps involved in feasibility analysis areF

    (. %o propose a set of solution that can realie the project goal. %hese

    solutions are usually descriptions of what the new system should look 

    like.

    ). 2valuation of feasibility of such solutions. *uch evaluation often

    indicates shortcomings in the initial goals. %his step is repeated as thegoals are adjusted and the alternative solutions are evaluated.

    our primary areas of interest in feasibility study areF

    E"o!om#" Fe*#)#%$F #n evaluation of development cost weighedagainst the ultimate income of benefit derived from the development system

    of product. In economic feasibility! cost benefit analysis is done in which

    expected cost and benefits are evaluated.

    COST AND BENEFIT ANALYSIS

    Developing an IT application is an investment. Since aftereveloping t!at application it provies t!e organi"ation #it!pro$ts. Pro$ts can %e monetar& or in t!e form of an

    improve #or'ing environment. (o#ever) it carries ris's)%eca*se in some cases an estimate can %e #rong. An t!epro+ect mig!t not act*all& t*rn o*t to %e %ene$cial.

    ,ost %ene$t anal&sis !elps to give management a pict*re of t!e cost) %ene$ts an ris's. It *s*all& involves comparingalternate investments.

  • 8/9/2019 Payroll 12

    11/124

    ,ost %ene$t etermines t!e %ene$ts an savings t!at aree-pecte from t!e s&stem an compares t!em #it! t!ee-pecte costs.

    In performing cost an %ene$t anal&sis it is important toientif& cost an %ene$ts factors. ,ost an %ene$ts can %ecategori"e into t!e follo#ing categories

    (. De0e&o,me!% Co*%*    5evelopment costs is the costs that areincurred during the development of the system. It is one time investment.

    ). O,er%#! Co*%* ,perating Costs are the expenses re3uired for the day

    to day running of the system. 2xamples of ,perating Costs are Wages!

    *upplies and ,verheads.+. Hr+(re3Sof%(re Co*%* It includes the cost of purchasing

    or leasing of computers and it=s peripherals. *oftware costs involves

    re3uired *GW costs.

    4. Per*o!!e& Co*%* It is the money spent on the people involved inthe development of the system.

    6. F"#%$ Co*%* 2xpenses that are incurred during the preparation of the physical site where the system will be operational. %hese can be

    wiring! flooring! acoustics! lightning! and air-conditioning.

    7. S',,&$ Co*%* %hese are variable costs that are very proportionately with the amount of use of paper! ribbons! disks! and the

    like.

    BENEFITS

    We can define benefits as

    Prof#% or Be!ef#% 4 I!"ome Co*%*

    ?enefits can be accrued byF

    Increasing income! or 

    5ecreasing costs! or 

    ?oth

  • 8/9/2019 Payroll 12

    12/124

    Te"5!#"& Fe*#)#%$: 

    %echnical easibility includes existing and new HGW and *GW re3uirements

    that are re3uired to operate the project on the platform %urbo C@@. %he basic*GW re3uirement is %

  • 8/9/2019 Payroll 12

    13/124

    #n evaluation of alternative approaches to the development of system or 

     product.

    Co*% !+ Be!ef#% A!&$*#* of P$ro&& M!eme!% S$*%em

    Co*%*:

    Cost Cost per unit Juantity Cost

    Sof%(re

    T'r)o C--

    W#!+o(* NT Ser0er

    W#!+o(* 67

    Hr+(re 

    +!>>>

    +>!>>>

    (6!>>>

    4!>>>

    (

    (

    (

    )

      +!>>>

    +>!>>>

    (6!>>>

      :!>>>Ce!%r& Com,'%er

    Client 0achine

    5evelopment

    (>>!>>>

    6>!>>>

    (

    4

    (!>>!>>>

    )!>>!>>>

    #nalyst

    5eveloper 

    %raining

    5ata 2ntry

    Warranty B( month

    6>!>>>

    )>!>>>

    )>!>>>

    6!>>>>

    (

    )

    (

    (

    6>!>>>

    4>!>>>

    )>!>>>

      6!>>>

    Professional )>!>>> ( )>!>>>TOTAL COST 4!;(!>>>

    #ccording to the Payroll *ystem! s. )6> pay for a day of a single

    employee .

    2xpected increase in the number of 2mployeeF 4> per month and number of 

    customer for local isF (6> per day.

    /et the amount collected from operations in a monthF )6>!>>> for a month.

    #mount collected from the 2mployee when he returns car this yearK()LB4> L B)6> @ 46> @ (6> L +> L +> @ )6>>>>

    Ks. 4;!67!>>>

    or three years K + L 4;67!>>>

      K s. (!4:!7:!>>>

  • 8/9/2019 Payroll 12

    14/124

     1ow using 1et Present 8alue 0ethod for cost benefit analysis we have!

     1et Present 8alue Borigin K ?enefits M Costs

    K(4:7:>>>-4;(>>>

    Ks. (4+99>>>

    gain N K 1et Present 8alue G Investment

    K(4+99>>>G4;(>>>

    K);.):N

    ,verall gain K );):N in five year 

    or each year 

    (st  yearF

    Investment K 4;(!>>>

    ?enefit K 4;!67!>>>

     1et Present 8alue for first year K 4;67>>>-4;(>>>

    K4;76>>>

    gainNK4;76>>>G4;(>>>

    K;>;.+7N in first year 

    )nd  yearF

    Investment K 4;(!>>>

    ?enefit K (>4()!>>>

     1et Present 8alue for first year K (>4()>>>-4;(>>>

    K;;)(>>>

    gainNK;;)(>>>G4;(>>>

    K)>)>.69N at the end of second year 

    +rd  yearF

    Investment K 4;(!>>>

    ?enefit K (6:6;>>>

     1et Present 8alue for first year K (6:6;>>>-4;(>>>

    K(6+7:>>>

    gainNK(6+7:>>>G4;(>>>

    K+();.;+N at the end of third year 

  • 8/9/2019 Payroll 12

    15/124

    rom cost and benefit analysis we have found that the project is

    economically feasible since it is showing great gains Bapprox. above

    +>>>N.

    #fter economic feasibility! technical feasibility is done. In this! major issue

    is to see if the system is developed what is the likelihood that it=ll be

    implemented and put to operation Will there be any resistance from its

    user

    It is clear that the new automated system will work more efficiently and

    faster. *o the users will certainly accept it. #lso they are being actively

    involved in the development of the new system. *o our system is

    operationally feasible.

    #fter the feasibility study has been done and it is found to be feasible! themanagement has approved this project.

  • 8/9/2019 Payroll 12

    16/124

    FACT FINDING TECHNI8UES

    %he functioning of the system is to be understood by the system analyst to

    design the proposed system. 8arious methods are used for this and these areknown as fact-finding techni3ues. %he analyst needs to fully understand the

    current system.

    %he analyst needs data about the re3uirements and demands of the project

    undertaken and the techni3ues employed to gather this data are known as

    fact-finding techni3ues. 8arious kinds of techni3ues and the most popular 

    among them are interviews! 3uestionnaires! record views! case tools and also

    the personal observations made by the analyst himself.

    I!%er0#e(*

    Interview is a very important data gathering techni3ue as in this the

    analyst directly contacts system and the potential user of the

     proposed system.

    ,ne very essential aspect of conducting the interview is that the interviewer 

    should first establish a rapport with the interviewee. It should also be taken

    into account that the interviewee may or may not be a technician and theanalyst should prefer to use day to day language instead of jargon and

    technical terms.

    %he advantage of the interview is that the analyst has a free hand and the he

    can extract almost all the information from the concerned people but then as

    it is a very time consuming method! he should also employ other means such

    as 3uestionnaires! record reviews! etc. %his may also help the analyst to

    verify and validate the information gained. Interviewing should be

    approached! as logically and from a general point of view the followingguides can be very beneficial for a successful interviewF

    (. *et the stage for the interview.

    ). 2stablish rapportO put the interview at ease.

    +. Phrase 3uestions clearly and succinctly.

    4. ?e a good listenerO a void arguments.

    6. 2valuate the outcome of the interview.

  • 8/9/2019 Payroll 12

    17/124

    %he interviews are of the two types namely *%r'"%'re+ and '!*%r'"%'re+.

    I . S%r'"%'re+ I!%er0#e(

    *tructured interviews are those where the interviewee is asked a standard set

    of 3uestions in a particular order. #ll interviews are asked the same set of 

    3uestions. %he 3uestions are further divided into two kinds of formats for 

    conducting this type if interview.

    II. U!*%r'"%'re+ I!%er0#e(

    answer format. %his is of a much more flexible nature than the structured

    and %he unstructured interviews are undertaken in a 3uestion-and-can bevery rightly used to gather general in formation about the system.

    JuestionnairesF

    Juestionnaires are another way of information gathering where the potential

    users of the system are given 3uestionnaires to be filled up and returned to

    the analyst.

    Juestionnaires are useful when the analyst need to gather information froma large number of people. It is not possible to interview each individual. #lso

    if the time is very short! in that case also 3uestionnaires are useful. If the

    analyst guarantees the anonymity of the respondent then the respondent

    answers the 3uestionnaires very honestly and critically.

    %he analyst should sensibly design and frame 3uestionnaires with clarity of 

    it=s objective so as to do just to the cost incurred on their development and

    distribution.

    ecord eviews

    ecords and reports are the collection of information and data accumulated

    over the time by the users about the system and it=s operations. %his can also

     put light on the re3uirements of the system and the modifications it has

    undergone. ecords and reports may have a limitation if they are not up-to-

  • 8/9/2019 Payroll 12

    18/124

    date or if some essential links are missing. #ll the changes! which the system

    suffers! may not be recorded. %he analyst may scrutinie the records either at

    the beginning of his study which may give him a fair introduction about the

    system and will make him familiar with it or in the end which will provide

    the analyst with a comparison between what exactly isGwas desired from the

    system and it=s current working.

    ,n-*ite ,bservation

    ,n-site observations are one of the most effectively tools with the analyst

    where the analyst personally goes to the site and discovers the functioning of 

    the system. #s a observer! the analyst can gain first hand knowledge of the

    activities! operations! processes of the system on-site! hence here the role of 

    an analyst is of an information seeker. %his information is very meaningfulas it is unbiased and has been directly taken by the analyst. %his exposure

    also sheds some light on the actual happenings of the system as  compared

    to what has already been documented! thus the analyst gets closer 

    to system. %his techni3ue is also time-consuming and the analystshould not jump to conclusions or draw inferences from small samples of 

    observation rather the analyst should be more.

    ANALYST9S INTER/IEW WITHADMINISTRATOR

    A!&$*%: Hi! I have come to talk to you regarding the functioningof your payroll project.

    A+m#!#*%r%or: hello! do come in. I was expecting you.

    A!&$*%: I=ll come straight to the point. 5on=t hesitate! you can be

    as much open you want. %here are no restrictions.A+m#!#*%r%or: I=ll give you my whole contribution.

    A!&$*%: %ell me are you excited about the idea of having an

    automated system for your Payroll system

    A+m#!#*%r%or: &es! I do. 8ery much. #fter all it=s gonna reduce our 

    loads of work.

  • 8/9/2019 Payroll 12

    19/124

    A!&$*%: Will you elaborate on it

    A+m#!#*%r%or: 0ajor problem is managing the record of the

    2mployee ! 5isplay the record! 5elete the record . #t the

    time of payroll! it becomes more difficult to handle the

    report of payslip.

    A!&$*%: What do you think be ideal solution to this

    A+m#!#*%r%or: #ll the information of 2mployee should be put into

    computer. It=ll be easy for us to check how many record

    are avilable or not available of employee.

    A!&$*%: Could you explain how

    A+m#!#*%r%or: /ook whenever a new 2mployee is come heGshe is

    allotted a any Id or Code and the is reserved for the tillthe employee gets leave his job.

    A!&$*%: 5o you have different 2mployee categories

    A+m#!#*%r%or: yes we have categoriation for 2mployee .

    A!&$*%: How do you categorie your 2mployee

    A+m#!#*%r%or: ?y I5 no. and by name both.

    A!&$*%:5o you have any other expectations or suggestion for the

    new system

    A+m#!#*%r%or: It should be able to produce reports faster.

    A!&$*%: eports I completely forgot about them. What reports

    you people produce presently

    A+m#!#*%r%or: Well first is for 2mployee record another for 2mployee=s

    list .

    A!&$*%: 5o you have some format for them

    A+m#!#*%r%or: &es we do have and we want that the same format beused by the new system.

    A!&$*%: &es we=ll take care of that. #ny other suggestions

    A+m#!#*%r%or:  1o. &ou have already covered all the fields.

    A!&$*%: %hanks for your co-operation. It was nice talking to you.

  • 8/9/2019 Payroll 12

    20/124

    A+m#!#*%r%or: 0y pleasure. ?ye.

    8UESTIONNAIRES FOR STAFFInstructionsF #nswer as specified by the format. Put 1# for non-application

    situation.

    (. What are your expectations out of the new system Bcomputeried ate

    the following on a scale of (-4 giving allow value for low priority.

    Ba better cataloguing

    Bb better managing of users

    Bc better account and patients managementBd computer awareness

    Be any other 

    ). How many users are you expecting

      

    +. How many 2mployee are there

      

    4. How you want the 2mployee to be categoried for searching Blike by idno.! by name

      

    6. Is there any difference in the roles Bprivileges of two or more 2mployee

    &esG1o Please specify if &es

      

      

    7. 5o you want facility of generating the payslip&esG1o

    9. 5o you have data of 2mployee entered into some kind of database

    &esG1o

    :. How do you want users to be categoried

  • 8/9/2019 Payroll 12

    21/124

     or 

      

    ;. Would you like online registration for users rather than the printed form

    &esG1o

    (>.5o you already have some existing categoriation of 2mployee on the

     basis as specified in 3uestion 4 above

    &esG1o

    ((.#ny other specific suggestionGexpectation out of the proposed system.

      

      

  • 8/9/2019 Payroll 12

    22/124

    SYSTEM O/ER/IEW

    %he limited time and resources have restricted us to incorporate! in this

     project! only a main activities that are performed in a P#&,//

    0#1#$2021% *ystem! but utmost care has been taken to make the

    system efficient and user friendly. DP#&,// 0#1#$2021% *ystemE

    has been designed to computeried the following functions that are

     performed by the systemF

    (. 20P/,&22* 5etail unctions

    a #dding a 1ew 2C,5

     b 0odification to 2C,5 assigned

    a #dmission of 1ew 20P/,&22 .

     b 5eleting of 20P/,&22 record.

    2. Re,or%3De%#&* F'!"%#o!*

    a *tatement of Pay 5etails

    a.( 5#

    a.) H 

     b %otal number of 20P/,&22.

    c Individual 20P/,&22 eport .

  • 8/9/2019 Payroll 12

    23/124

  • 8/9/2019 Payroll 12

    24/124

    IMPORTANCE OF COMPUTERIED

    PAYROLL MANAGEMENT SYSTEM

    %here are several attributes in which the computer based information

    works. ?roadly the working of computer system is divided into two main

    groupsF

    ♦ %ransaction *ystem

    ♦ 5ecision *upport *ystem

    Tr!*"%#o! S$*%emF

    # transaction is a record of some well-defined single and usually small

    occurrence in a system. %ransactions are input into the computer to

    update the database files. It checks the entering data for its accuracy. %his

    means that numeric data appears in numeric field and character data in

    character field. ,nce all the checks are made! transaction is used to

    update the database. %ransaction can be inputted in on-line mode or batch

    mode. In on-line mode! transactions are entered and updated into the

    database almost instantaneously. In batch mode! transactions are

    collected into batches! which may be held for a while and inputted later.

    De"#*#o! S',,or% S$*%emF

    It assists the user to make analytical decision. It shows the various data in

    organied way called analysis. %his analysis can be made to syrdy

     preferences and help in making decisions.

     

  • 8/9/2019 Payroll 12

    25/124

    Computer system works out best with record maintenance. It will tell you

    which 20P/,&22 would get how much pendingGreports statements. It

    will also help to search the information about a particular person by

    simply entering his telephone number.

  • 8/9/2019 Payroll 12

    26/124

     FUNCTIONDETAILS%he basic objective of P#&,//  MANAGEMENT SYSTEM  is to

    generalie and simplify the monthly or day to day activities of Payroll like

    #dmission of 1ew employee! payroll! payslip #ssigning related to particular 

    employee! eports of 1umber of 2mployee and delete the employee record

    etc. which has to be performed repeatedly on regular basis. %o provide

    efficient! fast! reliable and user-friendly system is the basic motto behind this

    exercise.

    /et us now discuss how different functions handle the structure and data

    filesF

    (. unction #55 2C,5 B

    %his is the function used to open a new record for a employee so that

    heGshe can assign a separate ecord. In that screen! the automatic

    20P/,&22 number . #fter opening a new record for the employee!

    finally a C,52 is assigned to a 20P/,&22 .

    %his function is used for employee in our company after entering his

    all personal details like 1ame! #ddress! Phone! *ex including date of 

     joining ! he have his own convence or

     1ot and his salary.

    ). unction 25I%B

    %his function is used to delete the employee details from database.

    When the user inputs his code number! the same account number will

     be checked in the database! if the code number is matched in the

    database! then the employee record will be deleted from the database

  • 8/9/2019 Payroll 12

    27/124

    and transferred the record of the deleted employee to another table of 

    database so that the Payroll 0anagement has the record of deleted

    employee to fulfill his legal liabilities.

    +. unction $212#%2 P#&*/IPB

    When any employee re3uired his payslip! hisGher bill is generated

    automatically by calculated salary! 5# !H# etc. It also give its code

    and date of joining.

    4. unction 5I*P/#&2C,5B

    %his function is used to display all the transaction including the

    2mployee name! address! phone! code number to himGher in the

    screen. %his is a global report to display all the transaction records inthe screen.

  • 8/9/2019 Payroll 12

    28/124

    TESTING

    S%!+r+ C !+ Pre;S%!+r+ C

    (;:; *tandard C is widespread enough now that it is ok to use its features in

    new programs. %here is one exceptionF do not ever use the QtrigraphQ feature

    of *tandard C.

    (;;; *tandard C is not widespread yet! so please do not re3uire its features

    in programs. It is ok to use its features if they are present. However! it is

    easy to support pre-standard compilers in most programs! so if you knowhow to do that! feel free. If a program you are maintaining has such support!

    you should try to keep it working.

    %o support pre-standard C! instead of writing function definitions in standard

     prototype form!

    intfoo (int x, int y)

    ...

    Write the definition in pre-standard style like this!

    intfoo (x, y)  int x, y;

    ...

    and use a separate declaration to specify the argument prototypeF

    int foo Bint! intO

     &ou need such a declaration anyway! in a header file! to get the benefit of 

     prototypes in all the files where the function is called. #nd once you have

    the declaration! you normally lose nothing by writing the function definition

    in the pre-standard style.

  • 8/9/2019 Payroll 12

    29/124

    %his techni3ue does not work for integer types narrower than int. If you

    think of an argument as being of a type narrower than int! declare it as int

    instead.

    %here are a few special cases where this techni3ue is hard to use. or example! if a function argument needs to hold the system type dev_t! you

    run into trouble! because dev_t is shorter than int on some machinesO but

    you cannot use int  instead! because dev_t  is wider than int on some

    machines. %here is no type you can safely use on all machines in a non-

    standard definition. %he only way to support non-standard C and pass such

    an argument is to check the width of dev_t using #utoconf and choose the

    argument type accordingly. %his may not be worth the trouble.

    In order to support pre-standard compilers that do not recognie prototypes!

    you may want to use a preprocessor macro like thisF

    /* Declare the prototype for a general externalfunction. */#if defined (__STD__) !! defined ("$D%"S$T)#define &_(proto) proto#el'e#define &_(proto) ()

    Rendif 

    Co!+#%#o!& Com,#&%#o!

    When supporting configuration options already known when building your 

     program we prefer using if (... ) over conditional compilation! as in

    the former case the compiler is able to perform more extensive checking of 

    all possible code paths.

    or example! please write

    if (S_%%)  ...  el'e

      ...

  • 8/9/2019 Payroll 12

    30/124

     instead ofF

    #ifdef S_%%  ...  #el'e  ...

      Rendif 

    # modern compiler such as $CC will generate exactly the same code in both

    cases! and we have been using similar techni3ues with good success in

    several projects.

    While this is not a silver bullet solving all portability problems! following

    this policy would have saved the $CC project alone many people hours if 

    not days per year.

    In the case of function-like macros like +-+S__0%D in $CC

    which cannot be simply used in if( ...)  statements! there is an easy

    workaround. *imply introduce another macro

    S_+-+S__0%D as in the following exampleF

    #ifdef +-+S__0%D  #define S_+-+S__0%D 1

      #el'e  #define S_+-+S__0%D 2

      Rendif 

    Form%%#! Error Me**e*

    2rror messages from compilers should look like thisF

    Source-file-nameFlinenoF message

    If you want to mention the column number! use one of these formatsF

    Source-file-nameFlinenoFcolumnF message

    Source-file-nameFlineno.columnF message

    /ine numbers should start from ( at the beginning of the file! and column

    numbers should start from ( at the beginning of the line. B?oth of these

  • 8/9/2019 Payroll 12

    31/124

    conventions are chosen for compatibility. Calculate column numbers

    assuming that space and all #*CII printing characters have e3ual width and

    assuming tab stops every : columns.

    In an interactive program Bone that is reading commands from a terminal! it

    is better not to include the program name in an error message. %he place to

    indicate which program is running is in the prompt or with the screen layout.

    BWhen the same program runs with input from a source other than a

    terminal! it is not interactive and would do best to print error messages using

    the non-interactive style.

    %he string message should not begin with a capital letter when it follows a

     program name andGor file name. #lso! it should not end with a period.

    2rror messages from interactive programs! and other messages such as usage

    messages! should start with a capital letter. ?ut they should not end with a period.

  • 8/9/2019 Payroll 12

    32/124

    FUNCTIONAL RE8UIREMENT

    %he platform is the hardware and software combination that the

    ClientG*erver runs on. While hardware systems vary widely in features andcapabilities! certain common features are needed for the operating system

    software.

    HARDWARE SPECIFICATIONS

    Hardware is a set of physical components! which performs the functions of 

    applying appropriate! predefined instructions. In other words! one can say

    that electronic and mechanical parts of computer constitute hardware.

    %his package is designed on a powerful programming language 8isual

    ?asic. It is a powerful $raphical

  • 8/9/2019 Payroll 12

    33/124

    ADAPTER TYPE TLA STANDARD RESOLUTION

    0onochrome 5isplay

    #dapter 

    05# %ext only B:> characters by )6

    lines

    Color $raphics #dapter C$# 74> × )>>

    2nhanced $raphics

    #dapter

    2$# 74>× +6>

    8ideo $raphics #rray 8$# 74> × 4:>

    *uper 8$# *8$# :>>× 7>> or (>)4× 97:

    D#*< Dr#0e*2ach client computer must have enough disk space available to store the

    client portion of the software and any data files that needs to be storedlocally.

    It is best to provide a local disk drive for each client computer. However 

    ClientG*erver applications can use the “diskless workstations” for which the

    only disk access is the disk storage located on a network file server. %he hard

    disk drive at database server should be at least of the capacity 4.( $?. ?ut it

    is recommended to have one of capacity :.) $?.

    Mo'*e# mouse is a must for the client software running under Windows

    ,* or any other graphical environment.

    Ke$)or+2ach client must have a (>4 keys extended keyboard.

    SOFTWARE  RE8UIREMENTS

  • 8/9/2019 Payroll 12

    34/124

    %he software is a set of procedures of coded information or a program which

    when fed into the computer hardware! enables the computer to perform the

    various tasks. *oftware is like a current inside the wire! which cannot be

    seen but its effect can be felt.

    #pplication software F %

  • 8/9/2019 Payroll 12

    35/124

      SYSTEM DE/ELOPMENT

    LIFE CYCLE 

  • 8/9/2019 Payroll 12

    36/124

    PAYROLLMANAGEMENT SYSTEM

    DATA FLOW DIAGRAM

    EMPLOYEECODE

    DELETED

    EMPLOYEE

    RECORD

    PAYROLL

    MANAGEMEN

    T SYSTEM

    GENERATE

    PAYSLIP

  • 8/9/2019 Payroll 12

    37/124

    OPENING A EMPLOYEE

    RECORD

      I/2

     

    2mployee 5ocument

    DATA FLOW DIAGRAM

    Process

  • 8/9/2019 Payroll 12

    38/124

    ADMISSION OF A NEW EMPLOYEE

      I/2

     

    employee 5etails

    DATA FLOW DIAGRAM

    Process

  • 8/9/2019 Payroll 12

    39/124

    RECORD MODIFICATION

      I/2

    DATA FLOW DIAGRAM

  • 8/9/2019 Payroll 12

    40/124

    DELETE OF EMPLOYEE

      I/2

     

    2mploiyee 5etails

    DATA FLOW DIAGRAM

    Process

  • 8/9/2019 Payroll 12

    41/124

    LISTING OF EMPLOYEE

      I/2

    DATA FLOW DIAGRAM

    *can ecord

    Processing

    Processing ,utput

    %o *creenGPrinter 

    inal ,utput

    (

    ead the

    code

    number 

    ) *elect

    ecord

    from5atabase

    + Copy

    *elected

    ecord

    4

    Compute

    %otal

    7 Copy

    *electedecord

    6 *elect

    ecord

    :

    $enerate

    %otal /ist

    9

    Compute

    ?ill

    OUTPUT

    UNIT

    EMPLOYEE

  • 8/9/2019 Payroll 12

    42/124

    GENERATING PAYSLIP OF

    EMPLOYEE

      I/2

    DATA FLOW DIAGRAM

    *can bed 1o

  • 8/9/2019 Payroll 12

    43/124

    LIST OF ALL RECORDS

      I/2

     

    inal ,utput

    ,utput

    Processing

    Processing

    *can #ll ecord

    MANAG

    EMENT

    (

    ead the

    e3uest

    ) *elect

    ecord

    from ile

    + Copy

    *electedecord

    4

    Compute

    %otal

    6

    *elect

    ecord

    9 Copy*elected

    ecord

    9

    Compute

     bill

    : $enerate

    %otal /ist

    %o *creenGPrinter

    OUTPUT

  • 8/9/2019 Payroll 12

    44/124

  • 8/9/2019 Payroll 12

    45/124

    S$*%em  De*#!

    %he design document that we will develop during this phase is the blueprint

    of the software. It describes how the solution to the customer problem is to be built. *ince solution to complex problems isn=t usually found in the first

    try! iterations are most likely re3uired. %his is true for software design as

    well. or this reason! any design strategy! design method! or design

    language must be flexible and must easily accommodate changes due to

    iterations in the design . #ny techni3ue or design needs to support and guide

    the partitioning process in such a way that the resulting sub-problems are as

    independent as possible from each other and can be combined easily for the

    solution to the overall problem. *ub-problem independence and easy

    combination of their solutions reduces the complexity of the problem. %hisis the objective of the partitioning process. Partitioning or decomposition

    during design involves three types of decisionsF -

    5efine the boundaries along which to breakO

    5etermine into how money pieces to breakO and

    Identify the proper level of detail when design should stop and

    implementation should start.

    ?asic design principles that enable the software engineer to navigate the

    design process suggest a set of principles for software design! which have

     been adapted and extended in the following listF

    ree from the suffer from Qtunnel vision.Q # good designer should consider alternative approaches! judging each based on the re3uirements of the

     problem! the resources available to do the job.

    %he design should be traceable to the analysis model.  ?ecause a single

    element of the design model often traces to multiple re3uirements! it is

    necessary to have a means for tracking how re3uirements have been satisfied

     by the design model.

    %he design should not repeat the same thing. *ystems are constructed using

    a set of design patterns! many of which have likely been encountered before.

    %hese patterns should always be chosen as an alternative to reinvention.%ime is short and resources are limited' 5esign time should be invested in

    representing truly new ideas and integrating those patterns that already exist.

    %he design should Qminimie the intellectual distanceQ between the software

    and the problem as it exists in the real world. %hat is! the structure of the

    software design should Bwhenever possible mimic the structure of the

     problem domain.

  • 8/9/2019 Payroll 12

    46/124

    %he design should exhibit uniformity and integration. # design is uniform if 

    it appears that one person developed the entire thing. ules of style and

    format should be defined for a design team before design work begins. #

    design is integrated if care is taken in defining interfaces between design

    components.

    %he design activity begins when the re3uirements document for the software

    to be developed is available. %his may be the ** for the complete system!

    as is the case if the waterfall model is being followed or the re3uirements for 

    the next QiterationQ if the iterative enhancement is being followed or the

    re3uirements for the prototype if the prototyping is being followed. While

    the re3uirements specification activity is entirely in the problem domain!

    design is the first step in moving from the problem domain toward the

    solution domain. 5esign is essentially the bridge between re3uirements

    specification and the final solution for satisfying the re3uirements.

    %he design of a system is essentially a blueprint or a plan for a solution for the system. We consider a system to be a set of components with clearly

    defined behavior that interacts with each other in a fixed defined manner to

     produce some behavior or services for its environment. # component of a

    system can be considered a system! with its own components. In a software

    system! a component is a software module.

    %he design process for software systems! often! has two levels. #t the first

    level! the focus is on deciding which modules are needed for the system! the

    specifications of these modules! and how the modules should be

    interconnected. %his is what is called the system design or top-level design.

    In the second level! the internal design of the modules! or how the

    specifications of the module can be satisfied! is decided. %his design level is

    often called detailed design or logic design. 5etailed design essentially

    expands the system design to contain a more detailed description of the

     processing logic and data structures so that the design is sufficiently

    complete for coding.

    ?ecause the detailed design is an extension of system design! the system

    design controls the major structural characteristics of the system. %he system

    design has a major impact on the testability and modifiability of a system!

    and it impacts its efficiency. 0uch of the design effort for designingsoftware is spent creating the system design.

    %he input to the design phase is the specifications for the system to be

    designed. Hence! a reasonable entry criteria can be that the specifications are

    stable and have been approved! hoping that the approval mechanism will

    ensure that the specifications are complete! consistent! unambiguous! etc.

    %he output of the top-level design phase is the architectural design or the

  • 8/9/2019 Payroll 12

    47/124

    system design for the software system to be built. %his can be produced with

    or without using a design methodology. # reasonable exit criteria for the

     phase could be that the design has been verified against the input

    specifications and has been evaluated and approved for 3uality.

    # design can be object-oriented or function-oriented. In function-oriented

    design! the design consists of module definitions! with each module

    supporting a functional abstraction. In object-oriented design! the modules in

    the design represent data abstraction Bthese abstractions are discussed in

    more detail later. In the function-oriented methods for design and describe

    one particular methodology the structured design methodology in some

    detail. In a function- oriented design approach! a system is viewed as a

    transformation function! transforming the inputs to the desired outputs. %he

     purpose of the design phase is to specify the components for this

    transformation function! so that each component is also a transformation

    function. Hence! the basic output of the system design phase! when afunction oriented design approach is being followed! is the definition of all

    the major data structures in the system! all the major modules of the system!

    and how the modules interact with each other.

    ,nce the designer is satisfied with the design he has produced! the

    design is to be precisely specified in the form of a document. %o specify the

    design! specification languages are used. Producing the design specification

    is the ultimate objective of the design phase. %he purpose of this design

    document is 3uite different from that of the design notation. Whereas a

    design represented using the design notation is largely to be used by the

    designer! a design specification has to be so precise and complete that it can

     be used as a basis of further development by other programmers. $enerally!

    design specification uses textual structures! with design notation helping in

    understanding.

     

  • 8/9/2019 Payroll 12

    48/124

    S"5e+'!

    *cheduling of a software project does not differ greatly from scheduling of 

    any multi- task engineering effort. %herefore! generalied project scheduling

    tools and techni3ues can be applied with little modification to software

     projects.

    Program evaluation and review techni3ue BP2% and critical path method

    BCP0 are two project scheduling methods that can be applied to software

    development. ?oth techni3ues are driven by information already developed

    in earlier project planning activities.

    E*%#m%e* of Effor%

    # decomposition of the product function

    %he selection of the appropriate process model and task set

    5ecomposition of tasks

    Interdependencies among tasks may be defined using a task network. %asks!

    sometimes called the project Work ?reakdown *tructure BW?* are defined

    for the product as a whole or for individual functions.

    ?oth P2% and CP0 provide 3uantitative tools that allow the software

     planner to B( determine the critical path-the chain of tasks that determines

    the duration of the projectO B) establish Qmost likelyQ time estimates for individual tasks by applying statistical modelsO and B+ calculate Qboundary

    timesQ that define a time windowQ for a particular task.

    ?oundary time calculations can be very useful in software project

    scheduling. *lippage in the design of one function! for example! can retard

    further development of other functions. It describes important boundary

    times that may be discerned from a P2% or CP0 networkF BI the earliest

    time that a task can begin when preceding tasks are completed in the shortest

     possible time! B) the latest time for task initiation before the minimum

     project completion time is delayed! B+ the earliest finish-the sum of the

    earliest start and the task duration! B4 the latest finish- the latest start timeadded to task duration! and B6 the total float-the amount of surplus time or 

    leeway allowed in scheduling tasks so that the network critical path

    maintained on schedule. ?oundary time calculations lead to a determination

    of critical path and provide the manager with a 3uantitative method for 

    evaluating progress as tasks are completed.

  • 8/9/2019 Payroll 12

    49/124

    ?oth P2% and CP0 have been implemented in a wide variety of automated

    tools that are available for the personal computer. *uch tools are easy to use

    and take the scheduling methods described previously available to every

    software project manager.

  • 8/9/2019 Payroll 12

    50/124

  • 8/9/2019 Payroll 12

    51/124

    //**********************************************************// &+%3T &4+%//**********************************************************

    //**********************************************************// $5DD D+ S//**********************************************************

    #include 6io'trea7.h8#include 6f'trea7.h8

    #include 6proce''.h8#include 6'tring.h8#include 6'tdli9.h8#include 6'tdio.h8#include 6ctype.h8#include 6conio.h8#include 6do'.h8

    //*************************************************

    *********// TS SS %$T$S T D+"$: 5$T%$S//**********************************************************

    cla'' $S

    pu9lic <void $_%+(int, int, int, char) ;void $_-+(int, int, int, char) ;void %=(int,int,int,int,char) ;void +5&(void) ;void +D%"$(void) ;

    > ;

  • 8/9/2019 Payroll 12

    52/124

    //**********************************************************// TS SS %$T+% T 5$T%$S $ T 0$5//**********************************************************

    cla'' 0$5

    pu9lic <void 0$_0$5(void) ;

    private <void DT_0$5(void) ;void $T+%D5T%$(void) ;

    > ;

    //**********************************************************// TS SS %$T+% T 5$T%$S +TD T%0&%4//**********************************************************

    cla'' 0&%4

    pu9lic <

    void $"_0&%4(void) ;void 0%DT%$(void) ;void DT%$(void) ;void DS&4(void) ;void ST(void) ;void S+4_S&(void) ;

    private <void DD_+%+D(int, char?@, char?@,

    char?@, int, int, int, char?@, char, char, char,float, float) ;

    void 0%D4_+%+D(int, char ?@, char?@, char ?@, char ?@, char, char, char, float,float) ;

    void DT_+%+D(int) ;

  • 8/9/2019 Payroll 12

    53/124

    int ST%D(void) ;int %D%5$D(int) ;int +%+D$%(int) ;int %5$D_%D(int) ;void DS&4_+%+D(int) ;int -D_DT(int, int, int) ;

    int code, dd, 77, yy ;char na7e?AB@, addre''?C1@,

    phone?12@, de'ig?1B@ ;char grade, hou'e, conven'e ;float loan, 9a'ic ;

    > ;

    //**********************************************************// TS 5$T%$ %$T+% T 5$T%$S $ T0$ 0$5//**********************************************************

    void 0$5

  • 8/9/2019 Payroll 12

    54/124

    cout 66IC< ST % 0&%4SI ;gotoxy(C2,1J) ;cout 66IJ< S+4 S&I ;gotoxy(C2,1G) ;cout 66IG< DTI ;gotoxy(C2,1B) ;cout 66I2< K5TI ;gotoxy(C2,1E) ;cout 66I$T+ 4%5+ %

    el'eif (ch LL MCM)

    0&%4 ;.ST() ;

    >el'eif (ch LL MJM)

    0&%4 ;.S+4_S&() ;

    >el'eif (ch LL MGM)

    DT_0$5() ;>

  • 8/9/2019 Payroll 12

    55/124

    .+5&() ;>

    //**********************************************************// TS 5$T%$ %$T+% T 5$T%$S $ TDT 0$5//**********************************************************

    void 0$5

  • 8/9/2019 Payroll 12

    56/124

    >el'eif (ch LL MAM)

    0&%4 ;.0%DT%$() ;

    >>.+D%"$() ;

    >

    //**********************************************************

    // TS 5$T%$ D+"S T %++O%$T $//**********************************************************

    void $S

    >

    //**********************************************************// TS 5$T%$ D+"S T -+T $//**********************************************************

    void $S

  • 8/9/2019 Payroll 12

    57/124

    gotoxy(colu7n,ro1) ;cout 66c ;

    >>

    //**********************************************************// TS 5$T%$ D+"S T %=//**********************************************************

    void $S el'e

    c1Lc ;cALc ;cCLc ;cJLc ;l1 L c ;lA L c ;

    >gotoxy(colu7n1,ro1) ;cout 66c1 ;gotoxy(colu7nA,ro1) ;cout 66cA ;

  • 8/9/2019 Payroll 12

    58/124

    gotoxy(colu7n1,roA) ;cout 66cC ;gotoxy(colu7nA,roA) ;cout 66cJ ;colu7n1PP ;colu7nAQQ ;$_%+(colu7n1,colu7nA,ro1,l1) ;$_%+(colu7n1,colu7nA,roA,l1) ;colu7n1QQ ;colu7nAPP ;ro1PP ;roAQQ ;$_-+(ro1,roA,colu7n1,lA) ;$_-+(ro1,roA,colu7nA,lA) ;

    >

    //**********************************************************// TS 5$T%$ + T S+$ $ 4 $5&"+D//**********************************************************

    void $S >

    //**********************************************************// TS 5$T%$ + T S+$ $ 4 $D%"$"%+D//**********************************************************

  • 8/9/2019 Payroll 12

    59/124

    void $S

  • 8/9/2019 Payroll 12

    60/124

    >

    //**********************************************************// TS 5$T%$ 0%D4 T :-$ DT $ T// 0&%4MS //**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    61/124

    // TS 5$T%$ DT T +%+D $ T 0&%4// %+ T :-$ 0&%4 %D//**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    62/124

    //**********************************************************// TS 5$T%$ +T5+$S T ST 0&%4MS %D//**********************************************************

    int 0&%4

  • 8/9/2019 Payroll 12

    63/124

    found L 1 ;9reaN ;

    >>file.clo'e() ;return found ;

    >

    //**********************************************************// TS 5$T%$ +T5+$S +%+D $%. % T :-$%D//*************************************************

    *********

    int 0&%4

  • 8/9/2019 Payroll 12

    64/124

  • 8/9/2019 Payroll 12

    65/124

    cout 669a'ic ;>el'e

    gotoxy(FB,ro) ;cout 66IQI ;

    >if ( ro LL AC )

    flag L 1 ;ro L B ;gotoxy(1,AG) ;cout 66I&re'' any Ney to continue or

    &re'' 6S8 to exitI ;

    ch L getch() ;if (ch LL AF)9reaN ;

    clr'cr() ;gotoxy(C1,A) ;cout 66IST % 0&%4SI ;gotoxy(C2,C) ;cout 66II ;gotoxy(1,J) ;cout 66I%D $0

    &%$ D%3 DS:$T%$ :+DS+4I ;

    gotoxy(1,G) ;cout

    66II ;

    >el'e

    roPP ;>if (found)

    gotoxy(G,12) ;cout 66IUF+ecord' not foundI ;

    >if (flag)

  • 8/9/2019 Payroll 12

    66/124

    gotoxy(1,AG) ;cout 66I&re'' any Ney to continue...I ;getche() ;

    >file.clo'e () ;

    >

    //**********************************************************// TS 5$T%$ DS&4S T +%+D % T0&%4S//*************************************************

    *********

    void 0&%4

  • 8/9/2019 Payroll 12

    67/124

    gotoxy(G,1C) ;cout 66IDay < I 66dd ;gotoxy(G,1J) ;cout 66I0onth < I 6677 ;gotoxy(G,1G) ;cout 66I4ear < I 66yy ;gotoxy(G,1F) ;cout 66IDe'ignation < I 66de'ig ;gotoxy(G,1E) ;cout 66I:rade < I 66grade ;if (grade L MM)

    gotoxy(G,1H) ;cout 66Iou'e (y/n) < I 66hou'e

    ; gotoxy(G,A2) ;cout 66Ionven'e (y/n) < I

    66conven'e ;gotoxy(G,AA) ;cout 66Ia'ic Salary < I 669a'ic

    ;>gotoxy(G,A1) ;cout 66Ioan < I 66loan ;

    >>file.clo'e() ;

    >

    //**********************************************************// TS 5$T%$ :- DT T% DD $ T //**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    68/124

    char ena7e?AB@, eaddre''?C1@, ephone?12@,ede'ig?1B@, t1?12@ ;

    float tAL2.2, eloanL2.2, e9a'icL2.2 ;int d, 7, y, ecode, valid ;gotoxy(FA,A) ;cout 66I628L=TI ;gotoxy(AE,C) ;cout 66IDDT%$ % $" 0&%4I ;gotoxy(G,G) ;cout 66I7ployee ode # I ;gotoxy(G,B) ;cout 66II ;gotoxy(G,F) ;cout 66I$a7e < I ;

    gotoxy(G,E) ;cout 66Iddre'' < I ;gotoxy(G,H) ;cout 66I&hone no. < I ;gotoxy(G,11) ;cout 66I3%$$: DTI ;gotoxy(G,1A) ;cout 66II ;gotoxy(G,1C) ;cout 66IDay < I ;

    gotoxy(G,1J) ;cout 66I0onth < I ;gotoxy(G,1G) ;cout 66I4ear < I ;gotoxy(G,1F) ;cout 66IDe'ignation < I ;gotoxy(G,1E) ;cout 66I:rade < I ;gotoxy(G,A1) ;cout 66Ioan < I ;

    ecode L ST%D() P 1 ;if (ecode LL 1)

    DD_+%+D(ecode, InullI, InullI, InullI,2, 2, 2, InullI, MnM, MnM, MnM, 2.2, 2.2) ;

  • 8/9/2019 Payroll 12

    69/124

    DT_+%+D(ecode) ;>gotoxy(A1,G) ;cout 66ecode ;do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter the na7e of the 7ployeeI ;gotoxy(A2,F) ; clreol() ;get'(ena7e) ;'trupr(ena7e) ;if (ena7e?2@ LL M2M)

    return ;

    if ('trlen(ena7e) 6 1 !! 'trlen(ena7e) 8AG)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctly (+ange<

    1..AG)I ;getch() ;

    >> hile (valid) ;

    do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter ddre'' of the 7ployeeI ;gotoxy(A2,E) ; clreol() ;get'(eaddre'') ;'trupr(eaddre'') ;if (eaddre''?2@ LL M2M)

    return ;if ('trlen(eaddre'') 6 1 !!

    'trlen(eaddre'') 8 C2)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;

  • 8/9/2019 Payroll 12

    70/124

    cout 66IUFnter correctly (+ange<1..C2)I ;

    getch() ;>

    > hile (valid) ;do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter &hone no. of the 7ployee or

    &re'' 6$T+8 for noneI ;gotoxy(A2,H) ; clreol() ;get'(ephone) ;if (ephone?2@ LL M2M)

    return ;if (('trlen(ephone) 6 F VV 'trlen(ephone)8 2) !! ('trlen(ephone) 8 H))

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctlyI ;getch() ;

    >> hile (valid) ;

    if ('trlen(ephone) LL 2)'trcpy(ephone,IQI) ;

    char tday?C@, t7onth?C@, tyear?G@ ;int td ;do

    valid L 1 ;do

    gotoxy(G,AG) ; clreol() ;cout 66I$T+ D4 % 3%$$:I ;gotoxy(1C,1C) ; clreol() ;get'(tday) ;td L atoi(tday) ;d L td ;if (tday?2@ LL M2M)

  • 8/9/2019 Payroll 12

    71/124

    return ;> hile (d LL 2) ;do

    gotoxy(G,AG) ; clreol() ;cout 66I$T+ 0%$T % 3%$$:I ;gotoxy(1C,1J) ; clreol() ;get'(t7onth) ;td L atoi(t7onth) ;7 L td ;if (t7onth?2@ LL M2M)

    return ;> hile (7 LL 2) ;do

    gotoxy(G,AG) ; clreol() ;cout 66I$T+ 4+ % 3%$$:I ;gotoxy(1C,1G) ; clreol() ;get'(tyear) ;td L atoi(tyear) ;y L td ;if (tyear?2@ LL M2M)

    return ;> hile (y LL 2) ;

    if (d8C1 !! d61)valid L 2 ;

    el'eif (((yWJ)L2 VV 7LLA VV d8AE) !! ((y

    WJ)LL2 VV 7LLA VV d8AH))valid L 2 ;

    el'eif ((7LLJ !! 7LLB !! 7LLH !! 7LL11) VV

    d8C2)valid L 2 ;

    el'eif (y61HH2 !! y8A2A2)

    valid L 2 ;if (valid)

    valid L 2 ;

  • 8/9/2019 Payroll 12

    72/124

    gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctlyI ;getch() ;gotoxy(1C,1J) ; clreol() ;gotoxy(1C,1G) ; clreol() ;

    >> hile (valid) ;do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter De'ignation of the 7ployeeI

    ;gotoxy(A2,1F) ; clreol() ;

    get'(ede'ig) ;'trupr(ede'ig) ;if (ede'ig?2@ LL M2M)

    return ;if ('trlen(ede'ig) 6 1 !! 'trlen(ede'ig) 8

    1G)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctly (+ange<

    1..1G)I ;getch() ;

    >> hile (valid) ;do

    gotoxy(G,AG) ; clreol() ;cout 66Inter :rade of the 7ployee

    (,,,D,)I ;gotoxy(A2,1E) ; clreol() ;egrade L getche() ;egrade L toupper(egrade) ;if (egrade LL M2M)

    return ;> hile (egrade 6 MM !! egrade 8 MM) ;if (egrade L MM)

  • 8/9/2019 Payroll 12

    73/124

    gotoxy(G,1H) ;cout 66Iou'e (y/n) < I ;gotoxy(G,A2) ;cout 66Ionven'e (y/n) < I ;gotoxy(G,AA) ;cout 66Ia'ic Salary < I ;do

    gotoxy(G,AG) ; clreol() ;cout 66I$T+ %5S %"$ S

    %TD T% 0&%4 %+ $%TI ;gotoxy(AA,1H) ; clreol() ;ehou'e L getche() ;

    ehou'e L toupper(ehou'e) ;if (ehou'e LL M2M)return ;

    > hile (ehou'e L M4M VV ehou'e L M$M) ;do

    gotoxy(G,AG) ; clreol() ;cout 66I$T+ %$-$ %"$ S

    %TD T% 0&%4 %+ $%TI ;gotoxy(AA,A2) ; clreol() ;

    econv L getche() ;econv L toupper(econv) ;if (econv LL M2M)

    return ;> hile (econv L M4M VV econv L M$M) ;

    >do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66I$T+ %$ 0%5$T SS5DI ;gotoxy(AA,A1) ; clreol() ;get'(t1) ;tA L atof(t1) ;eloan L tA ;if (eloan 8 G2222)

  • 8/9/2019 Payroll 12

    74/124

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFS%5D $%T :+T+ T$

    G2222I ;getch() ;

    >> hile (valid) ;if (egrade L MM)

    do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;

    cout 66I$T+ S S+4 % T0&%4I ;gotoxy(AA,AA) ; clreol() ;get'(t1) ;tA L atof(t1) ;e9a'ic L tA ;if (t1?2@ LL M2M)

    return ;if (e9a'ic 8 G2222)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFS%5D $%T :+T+ T$

    G2222I ;getch() ;

    >> hile (valid) ;

    >gotoxy(G,AG) ; clreol() ;do

    gotoxy(G,AJ) ; clreol() ;cout 66IDo you ant to 'ave (y/n) I ;ch L getche() ;ch L toupper(ch) ;if (ch LL M2M)

  • 8/9/2019 Payroll 12

    75/124

    return ;> hile (ch L M4M VV ch L M$M) ;if (ch LL M$M)

    return ;DD_+%+D(ecode, ena7e, eaddre'', ephone, d,

    7, y, ede'ig, egrade, ehou'e, econv, eloan, e9a'ic);>

    //**********************************************************// TS 5$T%$ :- %D %+ T DS&4 % T+%+D

    //**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    76/124

    gotoxy(G,AG) ;cout 66I&re'' any Ney to continue...I ;getch() ;

    >

    //**********************************************************// TS 5$T%$ :- DT %+ T 0%DT%$ %T// 0&%4 +%+D//**********************************************************

    void 0&%4 gotoxy(FA,A) ;

  • 8/9/2019 Payroll 12

    77/124

    cout 66I628L=TI ;gotoxy(AA,C) ;cout 66I0%DT%$ % T 0&%4 +%+DI ;DS&4_+%+D(ecode) ;do

    gotoxy(G,AJ) ; clreol() ;cout 66IDo you ant to 7odify thi' record

    (y/n) I ;ch L getche() ;ch L toupper(ch) ;if (ch LL M2M)

    return ;> hile (ch L M4M VV ch L M$M) ;

    if (ch LL M$M)return ;clr'cr() ;f'trea7 file ;file.open(I0&%4.DTI, io'

  • 8/9/2019 Payroll 12

    78/124

    cout 66Iddre'' < I ;gotoxy(G,H) ;cout 66I&hone no. < I ;gotoxy(G,12) ;cout 66IDe'ignation < I ;gotoxy(G,11) ;cout 66I:rade < I ;gotoxy(G,1J) ;cout 66Ioan < I ;do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter the na7e of the 7ployee or

    6$T+8 %+ $% $:I ;gotoxy(A2,F) ; clreol() ;get'(ena7e) ;'trupr(ena7e) ;if (ena7e?2@ LL M2M)

    return ;if ('trlen(ena7e) 8 AG)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;

    cout 66IUFnter correctly (+ange<1..AG)I ;

    getch() ;>

    > hile (valid) ;if ('trlen(ena7e) LL 2)

    'trcpy(ena7e,na7e) ;gotoxy(A2,F) ;cout 66ena7e ;

    >do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;

  • 8/9/2019 Payroll 12

    79/124

    cout 66Inter ddre'' of the 7ployee or6$T+8 %+ $% $:I ;

    gotoxy(A2,E) ; clreol() ;get'(eaddre'') ;'trupr(eaddre'') ;if (eaddre''?2@ LL M2M)

    return ;if ('trlen(eaddre'') 8 C2)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctly (+ange<

    1..C2)I ;getch() ;

    >> hile (valid) ;if ('trlen(eaddre'') LL 2)

    'trcpy(eaddre'',addre'') ;gotoxy(A2,E) ;cout 66eaddre'' ;

    >do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter &hone no. of the 7ployee or

    or 6$T+8 %+ $% $:I ;gotoxy(A2,H) ; clreol() ;get'(ephone) ;if (ephone?2@ LL M2M)

    return ;if (('trlen(ephone) 6 F VV 'trlen(ephone)

    8 2) !! ('trlen(ephone) 8 H))

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctlyI ;getch() ;

    >

  • 8/9/2019 Payroll 12

    80/124

    > hile (valid) ;if ('trlen(ephone) LL 2)

    'trcpy(ephone,phone) ;gotoxy(A2,H) ;cout 66ephone ;

    >do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66Inter De'ignation of the 7ployee

    or 6$T+8 %+ $% $:I ;gotoxy(A2,12) ; clreol() ;

    get'(ede'ig) ;'trupr(ede'ig) ;if (ede'ig?2@ LL M2M)

    return ;if ('trlen(ede'ig) 8 1G)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFnter correctly (+ange<

    1..1G)I ;

    getch() ;>

    > hile (valid) ;if ('trlen(ede'ig) LL 2)

    'trcpy(ede'ig,de'ig) ;gotoxy(A2,12) ;cout 66ede'ig ;

    >do

    gotoxy(G,AG) ; clreol() ;cout 66Inter :rade of the 7ployee

    (,,,D,) or 6$T+8 %+ $% $:I ;gotoxy(A2,11) ; clreol() ;egrade L getche() ;

  • 8/9/2019 Payroll 12

    81/124

    egrade L toupper(egrade) ;if (egrade LL M2M)

    return ;if (egrade LL 1C)

    egrade L grade ;gotoxy(A2,11) ;cout 66grade ;

    >> hile (egrade 6 MM !! egrade 8 MM) ;if (egrade L MM)

    gotoxy(G,1A) ;cout 66Iou'e (y/n) < I ;

    gotoxy(G,1C) ;cout 66Ionven'e (y/n) < I ;gotoxy(G,1G) ;cout 66Ia'ic Salary < I ;do

    gotoxy(G,AG) ; clreol() ;cout 66I%TD %5S %"$ X or

    6$T+8 %+ $% $:I ;gotoxy(AA,1A) ; clreol() ;

    ehou'e L getche() ;ehou'e L toupper(ehou'e) ;if (ehou'e LL M2M)

    return ;if (ehou'e LL 1C)

    ehou'e L hou'e ;gotoxy(AA,1A) ;cout 66ehou'e ;

    >> hile (ehou'e L M4M VV ehou'e L M$M) ;do

    gotoxy(G,AG) ; clreol() ;cout 66I%TD %$-$ %"$ or

    6$T+8 %+ $% $:I ;

  • 8/9/2019 Payroll 12

    82/124

    gotoxy(AA,1C) ; clreol() ;econv L getche() ;econv L toupper(econv) ;if (econv LL M2M)

    return ;if (econv LL 1C)

    econv L conven'e ;gotoxy(AA,1C) ;cout 66econv ;

    >> hile (econv L M4M VV econv L M$M) ;

    >do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66I$T+ %$ 0%5$T or 6$T+8 %+

    $% $:I ;gotoxy(AA,1J) ; clreol() ;get'(t1) ;tA L atof(t1) ;eloan L tA ;if (eloan 8 G2222)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFS%5D $%T :+T+ T$

    G2222I ;getch() ;

    >> hile (valid) ;if ('trlen(t1) LL 2)

    eloan L loan ;gotoxy(AA,1J) ;cout 66eloan ;

    >if (egrade L MM)

  • 8/9/2019 Payroll 12

    83/124

    do

    valid L 1 ;gotoxy(G,AG) ; clreol() ;cout 66I$T+ S S+4 or 6$T+8

    %+ $% $:I ;gotoxy(AA,1G) ; clreol() ;get'(t1) ;tA L atof(t1) ;e9a'ic L tA ;if (t1?2@ LL M2M)

    return ;if (e9a'ic 8 G2222)

    valid L 2 ;gotoxy(G,AG) ; clreol() ;cout 66IUFS%5D $%T :+T+ T$

    G2222I ;getch() ;

    >> hile (valid) ;if ('trlen(t1) LL 2)

    e9a'ic L 9a'ic ;

    gotoxy(AA,1G) ;cout 66e9a'ic ;

    >>gotoxy(G,AG) ; clreol() ;do

    gotoxy(G,1E) ; clreol() ;cout 66IDo you ant to 'ave (y/n) I ;ch L getche() ;ch L toupper(ch) ;if (ch LL M2M)

    return ;> hile (ch L M4M VV ch L M$M) ;if (ch LL M$M)

    return ;

  • 8/9/2019 Payroll 12

    84/124

    0%D4_+%+D(ecode,ena7e,eaddre'',ephone,ede'ig,egrade,ehou'e,econv,eloan,e9a'ic) ;

    gotoxy(G,AC) ;cout 66IUF+ecord 0odifiedI ;gotoxy(G,AG) ;cout 66I&re'' any Ney to continue...I ;getch() ;

    >

    //**********************************************************// TS 5$T%$ :- %D $%. %+ T DT%$ %

    T// 0&%4 +%+D//**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    85/124

    >gotoxy(FA,A) ;cout 66I628L=TI ;gotoxy(AJ,C) ;cout 66IDT%$ % T 0&%4 +%+DI ;DS&4_+%+D(ecode) ;do

    gotoxy(G,AJ) ; clreol() ;cout 66IDo you ant to delete thi' record

    (y/n) I ;ch L getche() ;ch L toupper(ch) ;if (ch LL M2M)

    return ;> hile (ch L M4M VV ch L M$M) ;if (ch LL M$M)

    return ;DT_+%+D(ecode) ;$S ;.+D%"$() ;gotoxy(G,AC) ;cout 66IUF+ecord DeletedI ;gotoxy(G,AG) ;

    cout 66I&re'' any Ney to continue...I ;getch() ;

    >

    //**********************************************************// TS 5$T%$ +T5+$ 2 T :-$ DT S$-D//**********************************************************

    int 0&%4

  • 8/9/2019 Payroll 12

    86/124

    valid L 2 ;el'eif (((y1WJ)L2 VV 71LLA VV d18AE) !! ((y1WJ)LL2

    VV 71LLA VV d18AH))valid L 2 ;

    el'eif ((71LLJ !! 71LLB !! 71LLH !! 71LL11) VV

    d18C2)valid L 2 ;

    return valid ;>

    //*************************************************

    *********// TS 5$T%$ &+$TS T S+4 S& %+ T0&%4//**********************************************************

    void 0&%4

  • 8/9/2019 Payroll 12

    87/124

    return ;>f'trea7 file ;file.open(I0&%4.DTI, io'

  • 8/9/2019 Payroll 12

    88/124

    .%=(B,H,FG,AA,A1E) ;.$_%+(12,F1,A2,1HB) ;int day', hour' ;if (grade LL MM)

    do

    valid L 1 ;gotoxy(12,A1) ;cout 66I$T+ $%. % D4S "%+YD $

    T 0%$T I ;gotoxy(12,11) ;cout 66I$o. of Day' < I ;get'(t1) ;

    tA L atof(t1) ;day' L tA ;if (-D_DT(day',71,y1))

    valid L 2 ;gotoxy(12,A1) ;cout 66IUF$T+ %++T4

    I ;getch() ;gotoxy(12,11) ;

    cout 66I I ;>

    > hile (valid) ;do

    valid L 1 ;gotoxy(12,A1) ;cout 66I$T+ $%. % %5+S "%+YD %-+

    T0 I ;gotoxy(12,1C) ;cout 66I$o. of hour' < I ;get'(t1) ;tA L atof(t1) ;hour' L tA ;if (hour' 8 E !! hour' 6 2)

  • 8/9/2019 Payroll 12

    89/124

    valid L 2 ;gotoxy(12,A1) ;cout 66IUF$T+ %++T4

    I ;getch() ;gotoxy(12,1C) ;cout 66I I ;

    >> hile (valid) ;gotoxy(12,A1) ;cout 66I

    I ;gotoxy(12,11) ;cout 66I I ;

    gotoxy(12,1C) ;cout 66I I ;>gotoxy(12,12) ;cout 66Ia'ic Salary < +'.I ;gotoxy(12,1A) ;cout 66I%"$I ;if (grade L MM)

    gotoxy(1A,1C) ;

    cout 66I+ < +'.I ;gotoxy(1A,1J) ;cout 66I < +'.I ;gotoxy(1A,1G) ;cout 66ID < +'.I ;

    >el'e

    gotoxy(1A,1C) ;cout 66I%T < +'.I ;

    >gotoxy(12,1F) ;cout 66IDD5T%$SI ;gotoxy(1A,1E) ;cout 66ID < +'.I ;if (grade L MM)

  • 8/9/2019 Payroll 12

    90/124

    gotoxy(1A,1H) ;cout 66I& < +'.I ;

    >gotoxy(12,A1) ;cout 66I$T S+4 < +'.I ;gotoxy(B,AJ) ;cout 66IS+I ;gotoxy(BE,AJ) ;cout 66I0&%4I ;float +L2.2, L2.2, DL2.2, &L2.2, DL2.2,

    %TL2.2, alloance, deduction, net'alary ;if (grade L MM)

    if (hou'e LL M4M)+ L (G*9a'ic)/122 ;if (conven'e LL M4M)

    L (A*9a'ic)/122 ;D L (G*9a'ic)/122 ;& L (A*9a'ic)/122 ;D L (1G*loan)/122 ;alloance L +PPD ;deduction L &PD ;

    >

    el'e

    9a'ic L day' * C2 ;D L (1G*loan)/122 ;%T L hour' * 12 ;alloance L %T ;deduction L D ;

    >net'alary L (9a'icPalloance)Qdeduction ;gotoxy(CB,12) ;cout 669a'ic ;if (grade L MM)

    gotoxy(AA,1C) ;cout 66+ ;gotoxy(AA,1J) ;

  • 8/9/2019 Payroll 12

    91/124

    cout 66 ;gotoxy(AA,1G) ;cout 66D ;gotoxy(AA,1H) ;cout 66& ;

    >el'e

    gotoxy(AA,1C) ;cout 66%T ;

    >gotoxy(AA,1E) ;cout 66D ;gotoxy(CC,1G) ;

    cout 66I+'.I 66alloance ;gotoxy(CC,1H) ;cout 66I+'.I 66deduction ;gotoxy(CB,A1) ;cout 66net'alary ;gotoxy(A,1) ;getch() ;

    >

    //**********************************************************// 0$ 5$T%$ $: 0$ 0$5//**********************************************************

    void 7ain(void)

    0$5 7enu ;7enu.0$_0$5() ;

    >

  • 8/9/2019 Payroll 12

    92/124

  • 8/9/2019 Payroll 12

    93/124

    TESTING

    In a software development project, errors can be injected at any

    stage during development. There are different techniques for detecting and eliminating errors that originate in that phase. However,

    no technique is perfect, and it is expected that some of the errors of the earlier phases will finally manifest themselves in the code. This is

    particularly true because in the earlier phases and most of the

    verification techniques are manual because no executable codeexists. Ultimately, these remaining errors will be reflected in the code.

    Hence, the code developed during the coding activity is liely to havesome requirement errors and design errors, in addition to errors

    introduced during the coding activity. !ehavior can be observed,

    testing is the phase where the errors remaining from all the previousphases must be detected. Hence, testing performs a very critical role

    for quality assurance and for ensuring the reliability of software.

    "uring testing, the program to be tested is executed with a set of test

    cases, and the output of the program for the test cases is evaluated

    to determine if the program is performing as expected. "ue to itsapproach, dynamic testing can only ascertain the presence of errorsin the program# the exact nature of the errors is not usually decided

    by testing. Testing forms the first step in determining the errors in a

    program. $learly, the success of testing in revealing errors inprograms depends critically on the test cases.

    Testing a large system is a very complex activity, and lie any

    complex activity it has to be broen into smaller activities. "ue to this,

    for a project, incremental testing is generally performed, in whichcomponents and subsystems of the system are tested separately

    before integrating them to form the system for system testing. Thisform of testing, though necessary to ensure quality for a large

    system, introduces new issues of how to select components for 

    testing and how to combine them to form subsystems and systems.

  • 8/9/2019 Payroll 12

    94/124

      op-Down and Bottom-Up Approaches

    %enerally, parts of the program are tested before testing the entireprogram. !esides, partitioning the problem of testing, another reason

    for testing parts separately is that if a test case detects an error in alarge program, it will be extremely difficult to pinpoint the source of the error. That is, if a huge program does not wor, determining whichmodule has errors can be a formidable tas. &urthermore, it will beextremely difficult to construct test cases so that different modulesare executed in a sufficient number of different conditions so that wecan feel fairly confident about them. In many cases, it is even difficultto construct test cases so that all the modules will be executed. Thisincreases the chances of a module's errors going undetected. Hence,it is clear that for a large system, we should first test different parts of 

    the system independently, before testing the entire system.

    In incremental testing, some parts of the system are first testedindependently. Then, these parts are combined to form a (sub)system, which is then tested independently. This combination can bedone in two ways* either only the modules that have been testedindependently are combined or some new untested modules arecombined with tested modules. !oth of these approaches require thatthe order in which modules are to be tested and integrated beplanned before commencing testing.

    +e assume that a system is a hierarchy of modules. &or suchsystems, there are two common ways modules can be combined, asthey are tested, to form a woring program* topdown and bottomup.In topdown strategy, we start by testing the top of the hierarchy, andwe incrementally add modules that it calls and then test the newcombined system. This approach of testing requires stubs to bewritten. - stub is a dummy routine that simulates a module. In the topdown approach, a module (or a collection) cannot be tested inisolation because they invoe some other modules. To allow the

    modules to be tested before their subordinates have been coded,stubs simulate the behavior of the subordinates.

    The bottomup approach starts from the bottom of the hierarchy. &irst,the modules at the very bottom, which have no subordinates, aretested. Then these modules are combined with higherlevel modulesfor testing. -t any stage of testing, all the subordinate modules exist

  • 8/9/2019 Payroll 12

    95/124

    and have been tested earlier. To perform bottomup testing, driversare needed to set up the appropriate environment and invoe themodule. It is the job of the driver to invoe the module under testingwith the different set of test cases.

    otice that both topdown and bottomup approaches areincremental, starting with testing single modules and then addinguntested modules to those that have been tested, until the entiresystem is tested. In the first case, stubs must be written to performtesting, and in the other, drivers need to be written. Topdown testingis advantageous, if major flaws occur toward the top of the hierarchy,while bottomup is advantageous if the major flaws occur toward thebottom. /ften, writing stubs can be more difficult than writing drivers,because one may need to now beforehand the set of inputs for themodule being simulated by the stub and to determine proper responses for these inputs. In addition, as the stubs often simulatethe behavior of a module over a limited domain, the choice of testcases for the superordinate module is limited, and deciding testcases is often very difficult.

    It is often best to select the testing method to conform with thedevelopment method. Thus, if the system is developed in a topdownmanner, topdown testing should be used, and if the system isdeveloped in a bottomup manner, a bottomup testing strategyshould be used. !y doing this, as parts of the system are developed,they are tested, and errors are detected as development proceeds. Itshould be pointed out that we are concerned with actual programdevelopment here, not the design method. The development can bebottomup even if the design was done in a topdown manner.

  • 8/9/2019 Payroll 12

    96/124

    TYPES OF TESTING:

    Functional Testing:In functional testing the structure of the program is not considered.

    Test cases are decided solely on the basis of requirements or specifications of the program or module and the internals of the

    module or the program are not considered for selection of test cases."ue to its nature, functional testing is often called 0blac box testing1.

    2quivalence partitioning is a technique for determining which classesof input data have common properties. - program should behave in a

    comparable way for all members of an equivalence partition. Howthere are both input and output equivalence partitions# correct andincorrect inputs also form partitions.

    The equivalence partitions may be identified by using the programspecification or user documentation and by the tester usingexperience, to predict which classes of input value are liely to detecterrors. &or example, if an input specification states that the range of some input values must be a 3digit integer, that is, between 45555and 66666, equivalence partitions might be those values less than

    45555, values between 45555 and 66666 and values greater than66666. 7imilarly, if four to eight values are to be input, equivalencepartitions are less than four, between four and eight and more thaneight.

    In functional testing, the structure of the program is not considered.Test cases are decided solely on the basis of the requirements or specifications of the program or module, and the internals of themodule or the program are not considered for selection of test cases."ue to its nature, functional testing is often called 8blac box testing.8

    In the structural approach, test cases are generated based on theactual code of the program or module to be tested. This structuralapproach is sometimes called 8glass box testing.8

    The basis for deciding test cases in functional testing is therequirements or specifications of the system or module. &or the entiresystem, the test cases are designed from the

  • 8/9/2019 Payroll 12

    97/124

    requirements specification document for the system. &or modulescreated during design, test cases for functional testing are decidedfrom the module specifications produced during the design.

    The most obvious functional testing procedure is exhaustive testing,

    which as we have stated, is impractical. /ne criterion for generatingtest cases is to generate them randomly. This strategy has littlechance of resulting in a set of test cases that is close to optimal (i.e.,that detects the maximum errors with minimum test cases). Hence,we need some other criterion or rule for selecting test cases. Thereare no formal rules for designing test cases for functional testing. Infact, there are no precise criteria for selecting test cases. However,there are a number of techniques or heuristics that can be used toselect test cases that have been found to be very successful indetecting errors. Here we mention some of these techniques.

    Equivalence Class Partitioning

    &unctional testing is an approach to testing where the specification of the component being tested is used to derive test cases. Thecomponent is a 0blac box1 whose behavior can only be determinedby studying its inputs and the related outputs. Illustrates the model of a component, which is assumed in functional testing. otice thismodel of a component is the same as that used for reliability testing.

    The ey problem for the tester whose aim is to discover defects is toselect inputs, which have a high probability of being members of theset. 2ffective selection is dependent on the sill and experience of the tester but there are some structured approaches, which can beused to guide the selection of test data.

    However, without looing at the internal structure of the program, it isimpossible to determine such ideal equivalence classes (even withthe internal structure, it usually cannot be done). The equivalenceclass partitioning method tries to approximate this ideal. "ifferent

    equivalence classes are formed by putting inputs for which thebehavior pattern of the module is specified to be different into similar groups and then regarding these new classes as forming equivalenceclasses. The rationale of forming equivalence classes lie this, is theassumption that if the specifications require exactly the samebehavior for each element in a class of values, then the program isliely to be constructed so that it either succeeds or fails for each of 

  • 8/9/2019 Payroll 12

    98/124

    the values in that class. &or example, the specifications of a modulethat determine the absolute value for integers specify one behavior for positive integers and another for negative integers. In this case,we will form two equivalence classesone consisting of positiveintegers and the other consisting of negative integers.

    &or robust software, we must also test for incorrect inputs bygenerating test cases for inputs that do not satisfy the inputconditions. +ith this in mind, for each equivalence class of validinputs we define equivalence classes for invalid inputs.

    2quivalence classes are usually formed by considering eachcondition specified on an input as specifying a valid equivalence classand one or more invalid equivalence classes. &or example, if an inputcondition specifies a range of values (say, 5 9 count 9 max), then

    forms a valid equivalence class with that range and two invalidequivalence classes, one with values less than the lower bound of therange (i.e., count 9 5) and the other with values higher than thehigher bound (count: max). If the input specifies a set of values andthe requirements specify different behavior for different elements inthe set, then a valid equivalence class is formed for each of theelements in the set and an invalid class for an entity not belonging tothe set.

    2ssentially, if there is reason to believe that the entire range of an

    input will not be treated in the same manner, then the range shouldbe split into two or more equivalence classes. -lso, for each validequivalence class, one or more invalid equivalence classes should beidentified. &or example, an input may be specified as a character.However, we may have reason to believe that the program willperform different actions if a character is an alphabet, a number, or aspecial character. In that case, we will split the input into three validequivalence classes.

    It is often useful to consider equivalence classes in the output. &or an

    output equivalence class, the goal is to generate test cases such thatthe output for that test case lies in the output equivalence class."etermining test cases for output classes may be more difficult, butoutput classes have been found to reveal errors that are not revealedby just considering the input classes.

  • 8/9/2019 Payroll 12

    99/124

    Boundary Value Analysis

    It has been observed that programs that wor correctly for a set of values in an equivalence class fail on some special values. Thesevalues often lie on the boundary of the equivalence class. Test cases,that have values on the boundaries of equivalence classes are,therefore, liely to be 8highyield8 test cases, and selecting such testcases is the aim of the boundary value analysis. In boundary valueanalysis, we choose an input for a test case from an equivalenceclass, such that the input lies at the edge of the equivalence classes.!oundary values for each equivalence class, including theequivalence classes of the output, should be covered. !oundaryvalue test cases are also called 8extreme cases.8 Hence, we can saythat a boundary value test case is a set of input data that lies on theedge or boundary of a class of input data or that generates outputthat lies at the boundary of a class of output data.

    In case of ranges, for boundary value analysis it is useful to select theboundary elements of the range and an invalid value just beyond thetwo ends (for the two invalid equivalence classes). 7o, if the range is5.5 9 x 9 4.5, then the test cases are 5.5, 4.5 (valid inputs), and 5.4,

    and 4.4 (for invalid inputs). 7imilarly, if the input is a list, attentionshould be focused on the first, and last elements of the list. +eshould also consider the outputs for boundary value analysis. If anequivalence class can be identified in the output, we should try togenerate test cases that will produce the output that lies at theboundaries of the equivalence classes. &urthermore, we should try toform test cases that will produce an output that does not lie in theequivalence class.

    Cause-Eect Gra!"ing

    /ne weaness with the equivalence class partitioning and boundaryvalue methods is that they consider each input separately. That is,both concentrate on the conditions and classes of one input. They donot consider combinations of input circumstances that may forminteresting situations that should be tested. /ne way to exercisecombinations of different input conditions is to consider all valid

  • 8/9/2019 Payroll 12

    100/124

    combinations of the equivalence classes of input conditions. Thissimple approach will result in an unusually large number of testcases, many of which will not be useful for revealing any new errors.&or example, if there are n different input conditions, such that anycombination of the input conditions is valid, we will have ; test cases.

    $auseeffect graphing is a technique that aids in selectingcombinations of input conditions in a systematic way, such that thenumber of test cases does not become unmanageably large. Thetechnique starts with identifying causes and effects of the systemunder testing. - cause is a distinct input condition, and an effect is adistinct output condition. 2ach condition forms a node in the causeeffect graph. The conditions should be stated such that they can beset to either true or false. &or example, an input condition can be 8file

    is empty,8 which can be set to true by having an empty input file, andfalse by a nonempty file. -fter identifying the causes and effects, for each effect we identify the causes that can produce that effect andhow the conditions have to be combined to mae the effect true.$onditions are combined using the !oolean operators 8and,8 8or,8 and8not,8 which are represented in the graph by . Transaction?amt. is valid

    Eects:

    el. @rint 8invalid command8

    e;. @rint 8invalid employeenumber8

    e=. @rint 8"ebit amount not valid8

    e>. display

  • 8/9/2019 Payroll 12

    101/124

      e. generate payslip

    #IST OF CA$SES AN% EFFECTS

    Aet us illustrate this technique with a small example. 7uppose that for a ban database there are two commands allowed*

    credit acctnumber transaction?amount

    debit acctnumber transaction?amount

    The requirements are that if the command is credit and the acctnumber is valid, then the account is credited. If the command is debit,the acctnumber is valid, and the transaction?amount is valid (lessthan the balance), then the account is debited. If the command is notvalid, the account number is not valid, or the debit amount is notvalid, a suitable message is generated. +e can identify the following

    causes and effects from these requirements.The cause effect of thisis shown in &igure. In the graph, the causeeffect relationship of thisexample is captured. &or all effects, one can easily determine thecauses each effect depends on and the exact nature of thedependency. &or example, according to this graph, the effect 23depends on the causes c;, c=, and c> in a manner such that the effect23 is enabled when all c;, c=, and c> are true. 7imilarly, the effect 2; isenabled if c= is false.

    &rom this graph, a list of test cases can be generated. The basic

    strategy is to set an effect to I and then set the causes that enablethis condition. The condition of causes forms the test case. - causemay be set to false, true, or don't care (in the case when the effectdoes not depend at all on the cause). To do this for all the effects, it isconvenient to use a decision table. The decision table for thisexample is shown in &igure

    This table lists the combinations of conditions to set different effects.2ach combination of conditions in the table for an effect is a testcase. Together, these condition combinations chec for various