Sie sind auf Seite 1von 82

PROBLEM STATEMENT

Software has to be developed for automating the manual library system of the university. The system should be stand alone in nature. It should be designed to provide functionalities as explain below: 1. Issue of Books (a) Student of any course should be able to get the books issued. (b) Books from general section are issues to all but Book bank books are issued only for their respective students. (c) A limitation is imposed on the number of books a student can issue. (d) A maximum 4 books from book bank and 3 books from general section per student is allowed. (e) The books from book bank are issued for entire semester while books for general section are issued for 6 days only. (f) The software takes the current system date as the date of issue and calculates the corresponding date of return. (g) A bar code detector is used to save the student information as well as book information. (h) The due date for return of the book is stamped on the book. 2. Return of books (a) Any person can return the issued books. (b) The student information is displayed using the bar code reader. (c) The system displays the student details on whose name the books were issued as well as the date of issue and return of the book, (d) The system operator verifies the duration for the issue and if the book is being returned after the specified due date, a fine of Re2 is charged for each day. (e) The information is saved and the corresponding updations take place in the database. 3. Query processing (a) The system should be able to provide information like: (i) Availability of a particular book. (j) Availability of books of ant particular author. (k) Number of copies available of the desired book. (b) The system should be able to reserve a book for a particular student for 24 hours if that book is not currently available.

The system should also be able to generate reports regarding the details of the books available in the library at any given time. The corresponding printouts for each entry (issue/return) made in the system should be generated. Security provisions like the login authenticity should be provided each user should have a user id and a password. Record of the users of the system should be kept in the log file. Provisions should be made for full backup of the system.

SOFTWARE MODEL USED


PROTOTYPE MODEL is used for this Library Management System Prototype Model is defined as the model which uses a prototype before designing the whole system. In this prototype model, the working prototype is developed as per current available requirements. A quick design then occurs, which focuses on a REPRESETION of those aspects of the software that will be visible to the customer/user. The quick design leads to the construction of a prototype. The prototype is evaluated by the customer/user and used to refine requirements for the software to be developed. Prepare the final specification document. The evaluation gives feedback to the developers that helps to remove uncertainties in the requirements of the software, and starts an iteration of refinement in order to further clarify requirements. The developers should develop prototype as early as possible to speed up the software development process. After the finalization of software requirement and specification document, the prototype is discarded and the actual system is then developed using waterfall approach. This model uses extensive participation and involvement of the user, which is not always possible.

Advantages:
(1) One of the key advantages of a prototype modeled software has is the time frame of development. Instead of concentrating on documentation, more effort is placed in creating the actual software (2) Another advantage of having prototype modeled software is that the software is created using lots of user feedbacks. (3) Users could give their honest opinion about the software. If something is unfavorable, it can be changed. (4) The work will even be faster and efficient if developers will collaborate more regarding the status of a specific function and develop the necessary adjustments in time for the integration

Disadvantages:
(5) Since its being built out of concept, most of the models presented in the early stage are not complete. Usually they lack flaws that developers still need to work on them again and again. (6) Since the prototype changes from time to time, its a nightmare to create a document for this software. There are many things that are removed, changed and added in a single update of the prototype and documenting each of them has been proven difficult. (7) There is also a great temptation for most developers to create a prototype and stick to it even though it has flaws. (8) Since prototypes are not yet complete software programs, there is always a possibility of a designer flaw. When flawed software is implemented, it could mean losses of important resources. (9) Integration could be very difficult for a prototype model. This often happens when other programs are already stable.

PROTOTYPE MODEL is used for this project for the following reasons: It is a short duration project. We will get the feedback from the customer after every stage of SDLC. It is easy for maintaining the whole cycle as the changes in requirements of the customer can be easily made.

REQUIREMENT ELICITATION FOR LIBRARY MANAGEMNT SYSTEM


In the project development, the developer begins by talking to the potential sponsor to discover exactly what the sponsors problem are and what sort of solution is envisioned. The data required for this stage of our software development was gathered in the following ways: The meetings were conducted with the college library staff, the staff was questioned about their requirements and expectations from the automated system Customers were asked about the major problems they are facing with their current manual system. Numbers of questionnaires were prepared to gather the information necessary for our system.

INITIATING THE PROCESS


Stage 1 : Context Free Questions
These questions are asked to the user in the initial stages of the project and this leads to basic understanding of the problem, the people who want the solution and the nature of the solution that is desired. The questions and answers related to our project are: Q. Who is behind the request for this work? A. People who manage the library activities i.e. librarians, Library employees and students. Q. Who will use the solution? A. The system will be used by librarian and operator for searching books in the library and issuing them and to supervise the library. Q. Is there any source for the solution that you need? A. The libraries which are already automated could provide us with the answers to some of the requirements and the librarians who are facing the problem with the manual system. Q. What will be the economic benefit of a successful solution? A. This product is easily understandable and no manual work is required to be done by the people, which make the system very cost effective, convenient and user friendly.

Stage 2 : Better Understanding


The stage 2 questions help the analyst in gaining a better understanding of the problem. The questions and answers related to our projects: Q. How would you characterize good that would be generated by a successful solution? A. Inputted information should be properly manipulated and validated according to the basic requirement of function and output should be easily understandable to layman. Q. What problem(s) will this solution address? A. This solution will help you to skip labor-intensive register maintaining and will make the activities of library much unsophisticated to handle. Q. Can you describe the environment in which the solution will be used? A. The solution will help in making the things easier in the environments where there is a lot of paper work done and a large work force is required even to do a very minute task. Q. Will special performance issues or constraints affect the way the solution is approached? A. No, special performance issues or constraints will not affect the way the solution is approached, system will always generate the same solution under given circumstances and will not depend on the internal or external factors.

FACILITATED APPLICATION SPECIFICATION TECHNIQUE (FAST)


FAST approach encourages the creation of a joint team of customers and developers who work together to identify the problem, propose elements of the solution, negotiate different approaches and specify a preliminary set of solution requirements. While reviewing the request the following lists were prepared:

List of Objects:
Students Bar code reader Librarian Operator

List of Services:
Login Issue book Return book Query book Maintain catalog Generate report Maintain login Maintain student details

List of Constraints:
Help for users friendliness. Cost of developing the system should be manageable. Only authenticated users can login the system due to security reasons.

Performance Criteria:
Software works within operable and acceptable speed and can work efficiently even if the database grows rapidly. Use modern OOPS concepts and heavily relies on Databases. System is secure and uses strong and modern encryption techniques for storing passwords of the authenticated users. Return date should be calculated instantaneously. For a particular set of inputs the outputs should be correctly produced by the system. Support for GUI (Graphical User Interface).

QUESTIONAIRE TO BE GIVEN TO STUDENTS


Ques1) Do you visit library or not? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques2) How often do you visit library? Ans. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques3) Do you use the catalogue to reserve the books and to find the books? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques4) Do you find any problem in the system? If any please specify. Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques5) In case of problems whom do you consult? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques6) Did the advices of library staff helped you? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques7) Is the procedure to get the information of the book is easy? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques8) Is there any other source for the solution that you need? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques9) How would you characterize the good system? Ans.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques10) What special performances do you expect in the system? Ans. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ques11) What other improvements do you expect in the system? Ans. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

QUALITY FUNCTION DEPLOYMENT


Quality Function Deployment is a technique that translates the needs of the customer into technical requirements for software. It concentrates on maximizing customer satisfaction from the software engineering process. With respect to our project the following requirements are identified by a QFD:

NORMAL REQUIREMENTS
Normal requirements consist of objectives and goals that are stated during the meetings with the customers. Normal requirements of our project are: Automatic computation of return date. Help feature to explain what they are looking for. Correct validation of date. Graphical menus. Efficiency

EXPECTED REQUIREMENTS
These requirements are implicit to the system and may be so fundamental that the customer does not explicitly state them. Their absence will be a cause for dissatisfaction. Ease of interaction i.e. user friendly Installation ease Reliability Operational correctness

EXCITING REQUIREMENTS
These requirements go beyond the customers expectation and prove to be very satisfying when present. Our exciting requirements are: Page layout capability Good graphical presentations

10

LIBRARY MANAGEMENT SYSTEM USE CASE DIAGRAM

11

USE CASE DISCRIPTION

12

13

14

15

16

17

18

19

REQUIREMENT ANALYSIS
Information is transformed as it flows through a computer-based system. The system accepts variety of input and produces the appropriate output. It uses a combination of text and diagrammatic form to depict requirements for data, function and behavior in a way that is relatively easy to understand and review. The following tools have been used to model the system. Entity Relationship Diagram (ERD) specifies the relationships between data objects and attribute of each data object can be described using a data object description. Data Flow Diagram (DFD) provides an indication of how data are transformed as they move through the system. Also depicts the function that transforms the data flow. Data dictionary has been used as a repository that contains description of all data objects consumed or produced by the software.

20

E-R DIAGRAM OF THE PROPOSED SYSTEM

21

CONTEXT LEVEL DFD

22

LEVEL 1 DFD

23

DATA DICTIONARY
The data dictionary is an organized listing of all data elements that are pertinent to the system, with precise, rigorous definitions so that both user and system analyst will have a common understanding of inputs, outputs, components of stores and [even] intermediate calculations. The data dictionary for the two of the data flows is as follows: 1. STUDENT DATA Name : Student Data Alias : None Where used/How Used : By Library Staff entering student info. Description: Student Data = Name + Class + Roll Number Name = First Name + (Middle Name) + Last Name Class = Course Name + Course Sem Course Sem= 1,2,3,4,5,6,7,8 Roll Number = Enrollment Number + Admission Year Enrollment Number = *A 11-digit number given to student at the time of his admission* Admission Year = *A 4-number string i.e. the year in which the student enrolled.* Course Name = *A string of maximum allowable length 10* First Name Middle Name = * any string of maximum allowable length 10 each* Last Name

24

2. BOOK INFORMATION Name : Book Information Alias : Book Details Where used/How Used: For searching purpose (Input) ,Book Type, Information Processing (Output) Description: Book Details = Title + Author Name + Publisher + Edition + Price + ISBN Number + Book Status Title = *Any string specifying book name* Author Name = *Any String denoting the Author Information* Publisher = *Any String denoting publisher necessary information* Edition = *Any Number* Price = Currency Unit + Amount Currency Unit = [ Rs. | $ | | \ ] Amount = *A number specifying the actual book M.R.P* ISBN Number = 81 + First Number + Second Number + Ed. Number First Number = *Any 4-digit Number* Second Number = *Any 3-digit Number* Ed. Number = *Any 1-digit Number equal to Edition* Book Status = *A two bit sequence whose different bit patterns specify current status of book*

25

SOFTWARE REQUIREMENT SPECIFICATION (SRS)


1. Introduction 1.1 Purpose The main objective of this document is to illustrate the requirements of the project Library Management system. The document gives the detailed description of the both functional and non functional requirements proposed by the client. The document is developed after a number of consultations with the client and considering the complete requirement specifications of the given Project. The final product of the team will be meeting the requirements of this document. The intended audiences for this document are development team, testing team and end users of this product. This document will be reviewed frequently by the above audiences to check if the different phases of the project are being completed by meeting the given requirements. If there are any changes in the requirements in the course of the project they must be included in this document by making the necessary changes. 1.2 Project Scope The system accepts the General Library Transactions of book like issue, return and renewals for the members. The different areas where we can use this application are: Any education institute can make use of it for providing information about author, content of the available books. It can be used in offices and modifications can be easily done according to requirements. 1.3 Definitions, Acronyms and Abbreviations Bar code reader-A barcode reader is an electronic device for reading printed barcodes. Data flow diagram: It shows the dataflow between the entities. Use Case: A broad level diagram of the project showing a basic overview 1.4 References IEEE recommended practice for software requirement specification. 1.5 Overview The rest of this SRS document describes the various system requirement, interfaces, features and functionalities in detail

26

2. Overall description 2.1 Product Perspective The automated Library Management System is a package to be used by Libraries to improve the efficiency of Librarians, Library employees and Users. The automated Library System to be developed benefits greatly the members and the Librarian of institute. The system provides books catalog and information to members and helps them decide on the books to borrow from the library. The Librarian can keep the books catalog updated all the time so that the members (students and the professors) get the updated information all the time 2.1.1 System interfaces. None 2.1.2 User interfaces The design or layout of every form will be very clear and very interactive to the user. When the user open the software the welcome window will appear. In the login window the user can easily entered the desired password and login name. Then it will give the successfully login message. From each and every window the user can easily go to any desired window that is there will be a absolute and relative linking. In every window & Mac there is help and support option is present for the ease of user. There will be a proper collection of GUI interface, which will provide better look and feel. In the screen layout the background color is very light and the graphics and font style will be in proper manner and well organized If the user will print any error statement then it will give the proper error message display. In each and every window there will be alert, confirm etc m e s s a g e b o x f o r d i s p l a yi n g message. The user will be able to search any data from the record by using proper guideline shown in the window & Mac. In the opening of the software there will be a menu window where the overall table contents of the software will be present through which the user can move to any desired window &Mac. This will provide the better security data because the menu window will be displaying according to the login (admin or normal user). User can easily save its data in to the database and keep track of the records of purchase, vendor and inventory etc. This software will be easily understandable and operable by the user.

27

2.1.3 Hardware interfaces Server Side: Operating System: Windows 9x/xp ,Windows ME Processor: Pentium 3.0 GHz or higher RAM: 256 Mb or more Hard Drive: 10 GB or more

Client side: Operating System: Windows 9x or above, MAC or UNIX. Processor: Pentium III or 2.0 GHz or higher. RAM: 256 Mb or more

2.1.4 Software interfaces Database: SQL Server. Application: ASP (Active Server Pages) Web Server: IIS (Internet Information Services (IIS) is a powerful Web server that provides a highly reliable, manageable, and scalable Web application infrastructure) 2.1.5 Communication interfaces None 2.1.6 Memory constraints At least 256 MB RAM and 10 GB hard disk will be required for running the application. 2.1.7 Site adaptation requirements The terminals at client side will have to support the hardware and software interfaces specified in above sections. 2.2 Product functions There are two different users who will be using this product: Librarian of the college library Operator of the college library

28

The features that are available to the operator are : A operator can issue a book to the student Can view the different categories of books available in the Library Can view the List of books available in each category Can take the book returned from students Add books and their information of the books to the database Can maintain and access all the accounts of the students. The features available to the Librarian are: Maintain the login details Generating the reports 2.3 User characteristics a) Education level: at least graduate should be comfortable with English language. b) Experience : should be well informed about the books for respective courses kept in library. c) Technical expertise: should be comfortable using general-purpose application on a computer. 2.4 Constraints User at college will have to implement a security policy to safeguard the books and student related information from being modified by unauthorized user. 2.5 Assumptions and dependencies (i) The fine system ie.Re2 per book after a due date does not change. (ii) The books referred by the University for the Respective Courses in the college do not change. 2.6. Apportioning of requirements None 3.1 External interface requirements 3.1.1 User interfaces The following screens will be provided: Login screen This will be the first screen that will be displayed. It will allow user to access different screens based upon the users role. Various fields available on this screen will be (i) USER ID : Alphanumeric length up to 12 characters

29

(ii) (iii)

Password : Alphanumeric length up to 15 characters Role: Will have the following values: Librarian, Operator.

Adding new book screen This screen will be accessible to the user with role Operator and Librarian. It will allow the user to add new books with the following information about the book : (i) Book Id (ii) Book Name (iii) Book Author (iv) Title Number (v) Book Titles Search book screen This screen will be accessible to the user with role Operator and Librarian. It will allow the user to search books using Book name. Display complete information screen This screen will allow the user to display the complete details of the book and members including: (i) Book Id (ii) Book Name (iii) Book Author (iv) Title No (v) Book Title (vi) Member id (vii) Member name (viii) Department (ix) Phone number Display books of an Author screen This screen will allow the user to display the complete details of the book of a particular author. Title display screen This screen will allow the user to display the book name and title of the book allotted to book. Book count screen

30

This screen will allow the user to display the total count of the books available in the Library. Issue book screen This screen will allow the user to issue books to the members of the library. User will have to enter the member id along with book name. Return book screen This screen will allow the user to return books that were issued to the members of the library. User will have to enter the member id along with book name. Adding new member screen This screen will be accessible to the user with role Operator and Librarian. It will allow the user to add new members with the following information about the member : (i) Member Id (ii) Member Name (iii) Department (iv) Phone Number Fine display screen This screen will allow the user to check the fine of a particular member to whom books were issued but not returned within 6 days.

3.1.2 Hardware interface As stated in 2.1.3 3.1.3 Software interface As stated in 2.1.4 3.1.4 Communications interface None

31

3.2 System Features 3.2.1 Member Information Maintenance

Description The system will maintain information about various members of the library. The following information would be maintained for each member: Member Id, Member Name, Department, Phone number. Validity checks (i) Only user with role Librarian or Operator will be authorized to maintain the members information. (ii) Each member will have unique member id and phone number. (iii) Each member will be allowed to issue only 3 books. (iv) Fine associated with each member will be maintained in the system database. Sequencing information The details of the member will have to be entered in the system before the books are issued. Error handling/response to abnormal situations If any of the above validations/sequencing flow does not hold true, appropriate error messages will be prompted to the user for doing the needful. 3.2.2 Book Information Maintenance

Description The system will maintain information about various books available in the library. The following information would be maintained for each book : Book Id, Book Name, Book Author, Title Number, Book Titles. The system will be able to : (i) Search a book from a book name. (ii) Display complete information about the book. (iii) Display books of a particular author. (iv) Display the title of a particular book. (v) Display the count of the book. (vi) Display the fine associated with each book. Validity checks (i) Only user with role Librarian or Operator will be authorized to maintain the books information. (ii) Each book will have unique book id.

32

(iii) (iv) (v)

No two books with the same title will be issued to the same member. Each book can be issued for only 6 days after which a fine would be charged at R.s 2/- per day. During examination, books will be issued till the examination gets over. No fine would be charged for subsequent days.

Sequencing information The details of the books will have to be entered in the system before the books are issued to the members. Error handling/response to abnormal situations If any of the above validations/sequencing flow does not hold true, appropriate error messages will be prompted to the user for doing the needful. 3.2.3 Fine Information Maintenance

Description The system will maintain information about the fine associated with a each member. Validity checks (i) Only user with role Librarian or Operator will be authorized to check the fine associated with each member. (ii) Each book issued would be charged at R.s 2/- per day as a fine if the book is not returned within 6 days from the date of issue. (iii) No fine would be charged if the book is issued for examination during examination d (iv) ays. 3.2.4 Report Generation

Description The system will generate reports for books available in the library.

33

Books available report will have the following format: Name of College Book Category < name > Books Available Course Code : ____________________________ Course Name : ____________________________ S.No. Accession No. Book Title Author 1. 2. 3. 4. 5. 6. 7. 8. Report format for students enrolled in particular year : Publisher Price

Name of College Name of Program List of students enrolled in year xxxx S.No. 1. 2. 3. 4. 5. 6. 7. 8. Student Enrollment No. Student Name Price

34

Report format for Books issued/returned for General Account :

Name of College Books Issued/Returned for General Account S.No. 1. 2. 3. 4. 5. 6. 7. 8. Accession No. Book Title Author Issued to Issue Date Return Date

Report format for Books issued/returned for Book Bank Account :

Name of College Books Issued/Returned for Book Bank Account S.No. 1. 2. 3. 4. 5. 6. 7. 8. Accession No. Book Title Author Issued to Semester Issue Date Return Date

35

Report format for Fine associated with each member :

Name of College Fine Report S.No. 1. 2. 3. 4. 5. 6. 7. 8. Enrollment No. Name Book Acc no. Book Title Due date of return Fine

3.3 Performance requirements This software is not breakdown suddenly in any disaster like power failure. The development of the software will be based on the object oriented model. The timeline of this software must be in our mind. The performance of the functions and every module must be well. At every step the output of the one phase is the input of the other phase and it will be reliable and accurate The risk factor must be taken at initial step for better performance of the software. For individual function the performance will be well. For login to the software password and user name will be matched to the password and name saved in the database and thus only authenticated users are allowed to the login. There will be various ways of retrieving data and it takes less time. There will be ambiguity in the data and the record

3.4 Design constraints None 3.5 Software system attributes Our software has many quality attribute that are given belowAdaptability - This software is adaptable by any organization. Availability - The availability of the software is easy and for everyone.

36

Correctness - The results of the function are pure and accurate. Flexibility - The operation may be flexible and reports can be presented in many ways. Maintainability- After the deployment of the project if any error occurs then it can be easily maintain by the software developer. Portability- The software can be deployed at any machine. Reliability- The performance of the software is better which will increase the reliability of the software. Reusability- The data and record that are saved in the database can be reused if needed.

3.6 Logical database requirements Proposed Database is intended to store, retrieve, update, and manipulate information related to university which include Books availability Staff information Student details Calculation of fines 3.7 Other requirements None

37

PROGRAM FOR LIBRARY MANAGEMENT SYSTEM


#include<stdio.h> #include<ctype.h> #include<string.h> #include<stdlib.h> #include<conio.h> //defining the properties of the fields used in the program #define IN 1 #define OUT 0 void Addbook(); void Searchbook(); void Displaybook(); void Author(); void Titlelist(); void Stock(); void Issue(); void bookret(); void Addmembr(); void Exit(); void fine(); char info[500]; struct { int bid; char bname[25] ; char author[25]; int nooftitles; char titles[500]; int status; }book; struct { int mid; char mname[25] ; char department[25]; int availibcard; int phno;

38

}membr; //initializing the files used in the program FILE *librecord; FILE *membrrecord; FILE *fp1; FILE *fp2; FILE *temp1; FILE *temp2; void main() { char id[12]; char role[15]; char passo[]="oper102"; char passl[]="lib102"; char pass[15]; int choice=0,i; int flag =0; clrscr(); printf("\n\t\t<<LIBRARY MANAGEMENT SYSTEM>>"); printf("\nENTER YOUR ID : "); scanf("%s",&id); printf("ENTER YOUR ROLE ( LIBRARIAN / OPERATOR ) : "); scanf("%s",&role); printf("ENTER PASSWORD : "); scanf("%s",&pass);

if(((strcmp(id,"l101")==0)||(strcmp(id,"L101")==0))&&(((strcmp(role,"librarian")==0)||(strcm p(role,"LIBRARIAN")==0))&&(strcmp(pass,passl)==0))) { printf("\nWELCOME"); flag=1; } else

39

if(((strcmp(id,"o101")==0)||(strcmp(id,"O101")==0))&&(((strcmp(role,"operator")==0)||(strc mp(role,"OPERATOR")==0))&&(strcmp(pass,passo)==0))) { printf("\nWELCOME"); flag=1; } else { printf("\n\nSORRY....INVALID PASSWORD... "); getch(); exit(0); } if(flag==1) { clrscr(); printf("\n\t\t<<LIBRARY MANAGEMENT SYSTEM>>\n"); do{ printf("\n\t~~MENU~~\n 1> Add A New Book"); printf("\n 2> Search a book "); printf("\n 3> Display Complete Information"); printf("\n 4> Display All Books of An Author"); printf("\n 5> List Titles of a Book"); printf("\n 6> List Count of Books (Issued & On Stock)"); printf("\n 7> To Issue a Book"); printf("\n 8> To Return a Book"); printf("\n 9> Add A New Member"); printf("\n10> Fine"); printf("\n11> Exit the program\n\n\t Enter your choice <1-10>: "); scanf("%i",&choice); switch (choice) { case 1: Addbook(); break; case 2: Searchbook(); break; case 3: Displaybook(); break;

40

case 4: Author(); break; case 5: Titlelist(); break; case 6: Stock(); break; case 7: Issue(); break; case 8: bookret(); break; case 9: Addmembr(); break; case 10: fine(); break; case 11: Exit(); default: printf(" ! Invalid Input...\n"); } }while(choice!=10); getch(); } } void Addbook() { int i;book.status=IN; //opening the librecord file clrscr(); librecord = fopen("librecord.txt","a+"); printf("Enter The uniqueid of The Book :(Integer) \n"); scanf("%d",&book.bid); printf("Enter The Name of The Book :\n"); scanf("%s",book.bname); printf("Enter The Name of Author :\n"); scanf("%s",book.author); printf("Enter The Number of Titles Of The Book:(Integer)\n");

41

scanf("%d",&book.nooftitles); fprintf(librecord,"\n%d\t%s\t%s\t%d\t%d\t",book.bid,book.bname,book.author,book.status,bo ok.nooftitles); printf("Enter The Titles Of The Book : \n"); for(i=0;i<book.nooftitles;i++) { scanf("%s",book.titles); fprintf(librecord,"%s\t",book.titles); } fclose(librecord); printf(" (' ' ) A New Book has been Added Successfully...\n"); } void Displaybook() { clrscr(); librecord = fopen("librecord.txt","a+"); printf("\nBookid\tName\tAuthor\tStatus\tNo.\tTitles\n",info); do { fgets(info,500,librecord); printf("%s\n",info); }while(!feof(librecord)); fclose(librecord); membrrecord = fopen("membrrecord.txt","a+"); printf("\nMid\tName\tDept\tPh.no\tAvailablecards\n"); do { fgets(info,500,membrrecord); printf("%s\n",info); }while(!feof(membrrecord)); fclose(membrrecord); } void Searchbook() { int i; char Target[25],stats[3]; int Found=0; clrscr(); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The File is Empty...\n\n"); else

42

{ printf("\nEnter The Name Of Book : "); scanf("%s",Target); while(!feof(librecord)&& Found==0) { fscanf(librecord,"%d %s %s %d %d", &book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(strcmp(Target,book.bname)==0) Found=1; for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } if(Found) { if(book.status==IN) strcpy(stats,"IN"); else strcpy(stats,"OUT"); printf("\nThe Unique ID of The Book: %d\nThe Name of Book is: %s\nThe Author is: %s\nThe Book Status:%s\n\n",book.bid,book.bname,book.author,stats); } else if(!Found) printf("! There is no such Entry...\n"); fclose(librecord); } } void Author() { int i; char Target[500]; int Found=0; clrscr(); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty... \n\n"); else { printf("\nEnter The Name Of Author : "); scanf("%s",Target); printf("\nBooks:"); while(!feof(librecord)) { fscanf(librecord,"%d %s %s %d %d",&book.bid,book.bname,book.author,&book.status,&book.nooftitles);

43

if(strcmp(Target,book.author)==0) { Found=1; printf("\n\t%s",book.bname); } for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } if(!Found) printf(" ! There is no such Entry...\n"); fclose(librecord); } } void Titlelist() { int i; char Target[500]; int Found=0; clrscr(); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { printf("\nEnter The Book Name :"); scanf("%s",Target); while(!feof(librecord)&& Found==0) { fscanf(librecord,"%d %s %s %d %d",&book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(strcmp(Target,book.bname)==0) { Found=1; break; } for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } if(Found) { //printf("The Name of book is: %s\n",book.bname); printf("\nThe Titles:\n"); for(i=0;i<book.nooftitles;i++) { fscanf(librecord,"%s",book.titles); printf("%d.%s......\n",i+1,book.titles);

44

} } else if(!Found) printf(" ! There is no such Entry...\n"); fclose(librecord); } } void Stock() { int i,issuecount=0,stockcount=0; char Issued[100][20]; int Found=0; clrscr(); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(librecord)) { fscanf(librecord,"%d %s %s %d %d",&book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(book.status==IN) { stockcount++; } else { issuecount++; } for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } fclose(librecord); printf("\nCount of issued Books:%d\nCount of Books in Stock:%d\n",issuecount,stockcount-1); } } void Addmembr() { int i; clrscr(); membrrecord = fopen("membrrecord.txt","a+");

45

printf("Enter The userid of the Member(Integer) :\n"); scanf("%d",&membr.mid); printf("Enter The Name of the Member :\n"); scanf("%s",membr.mname); printf("Enter The Department\n"); scanf("%s",membr.department); printf("Enter The phone number of the member:\n"); scanf("%d",&membr.phno); membr.availibcard=5; fprintf(membrrecord,"\n%d\t%s\t%s\t%d\t%d\t",membr.mid,membr.mname,membr.departme nt,membr.phno, membr.availibcard); fclose(membrrecord); printf("\n (' ') Added A New member Successfully...\n"); } void Issue() { int mid,i,Found1=0,Found2=0;char issubookname[20]; //temp1=librecord;temp2=membrrecord; clrscr(); printf("\nEnter The userid of the Member : \n"); scanf("%d",&mid); if((membrrecord=fopen("membrrecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(membrrecord)&& Found1==0) { fscanf(membrrecord,"%d %s %s %d %d ",&membr.mid,membr.mname,membr.department,&membr.phno,&membr.availibcard); if(mid==membr.mid) { Found1=1; } } if(Found1) { if(membr.availibcard<1) { printf(" ! Library card not available...\n"); }

46

else { printf("\nEnter The Name of book :"); scanf("%s",issubookname); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(librecord)&& Found2==0) { fscanf(librecord,"%d %s %s %d %d", &book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(strcmp(issubookname,book.bname)==0) Found2=1; for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } if(Found2) { if(book.status==0) { printf(" ! Book already issued...\n"); } else { fp2=fopen("fp2.txt","w"); if((temp2=fopen("membrrecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(temp2)) { fscanf(temp2,"%d %s %s %d %d ",&membr.mid,membr.mname,membr.department,&membr.phno,&membr.availibcard); if(mid==membr.mid) { membr.availibcard--; fprintf(fp2,"\n %d\t%s\t%s\t%d\t%d\t",membr.mid,membr.mname,membr.department,membr.phno, membr.availibcard); } else{

47

fprintf(fp2,"\n %d\t%s\t%s\t%d\t%d\t",membr.mid,membr.mname,membr.department,membr.phno,membr.a vailibcard);} if(feof(temp2)) break; } } fclose(temp2); fclose(fp2); fp1=fopen("fp1.txt","w"); if((temp1=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(temp1)) { fscanf(temp1,"%d %s %s %d %d", &book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(feof(temp1)) break; if(strcmp(issubookname,book.bname)!=0) { fprintf(fp1,"\n%d\t%s\t%s\t%d\t%d \t",book.bid,book.bname,book.author,book.status,book.nooftitles); } else { fprintf(fp1,"\n%d\t%s\t%s\t%d\t%d\t",book.bid,book.bname,book.author,0,book.nooft itles); } for(i=0;i<book.nooftitles;i++) { fscanf(temp1,"%s",book.titles); fprintf(fp1,"%s\t",book.titles); } } } fclose(temp1); fclose(fp1); fclose(librecord); fclose(membrrecord); remove("librecord.txt"); rename("fp1.txt","librecord.txt");

48

remove("membrrecord.txt"); rename("fp2.txt","membrrecord.txt"); printf(" (' ') Book Successfully issued...\n"); } } else if(!Found2) printf(" ! There is no such Book...\n"); } } } else if(!Found1) printf(" ! Invalid User id...\n"); } } void bookret() { int mid,i,Found1=0,Found2=0,flag=0;char retbookname[20]; clrscr(); temp1=librecord; temp2=membrrecord; printf("\nEnter The userid of the Member :\n"); scanf("%d",&mid); if((membrrecord=fopen("membrrecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(membrrecord)&& Found1==0) { fscanf(membrrecord,"%d %s %s %d %d ",&membr.mid,membr.mname,membr.department,&membr.phno,&membr.availibcard); if(mid==membr.mid) { Found1=1; } } if(Found1) { if(membr.availibcard>=5) { printf(" ! Error...\n");

49

} else { printf("\nEnter The Name of book :"); scanf("%s",retbookname); if((librecord=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty\n\n"); else { while(!feof(librecord)&& Found2==0) { fscanf(librecord,"%d %s %s %d %d", &book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(strcmp(retbookname,book.bname)==0) Found2=1; for(i=0;i<book.nooftitles;i++) fscanf(librecord,"%s",book.titles); } if(Found2) { if(book.status==1) { printf(" ! Error:Book already in stock...\n"); } else { fp2=fopen("fp2.txt","w"); if((temp2=fopen("membrrecord.txt","a+"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(temp2)) { fscanf(temp2,"%d %s %s %d %d ",&membr.mid,membr.mname,membr.department,&membr.phno,&membr.availibcard); if(mid==membr.mid) { membr.availibcard++; fprintf(fp2,"\n %d\t%s\t%s\t%d\t%d\t",membr.mid,membr.mname,membr.department,membr.phno, membr.availibcard); } else {

50

fprintf(fp2,"\n %d\t%s\t%s\t%d\t%d\t",membr.mid,membr.mname,membr.department,membr.phno,membr.a vailibcard); } if(feof(temp2)) break; } } fclose(temp2); fclose(fp2); fp1=fopen("fp1.txt","w"); if((temp1=fopen("librecord.txt","r"))==NULL) printf(" ! The file is empty...\n\n"); else { while(!feof(temp1)) { fscanf(temp1,"%d %s %s %d %d", &book.bid,book.bname,book.author,&book.status,&book.nooftitles); if(feof(temp1)) break; if(strcmp(retbookname,book.bname)!=0) { fprintf(fp1,"\n%d\t%s\t%s\t%d\t%d \t",book.bid,book.bname,book.author,book.status,book.nooftitles); } else { fprintf(fp1,"\n%d\t%s\t%s\t%d\t%d\t",book.bid,book.bname,book.author,1,book.nooft itles); } for(i=0;i<book.nooftitles;i++) { fscanf(temp1,"%s",book.titles); fprintf(fp1,"%s\t",book.titles); } } } fclose(temp1); fclose(fp1); fclose(librecord); fclose(membrrecord); printf("('') Book Successfully Returned...\n");

51

remove("librecord.txt"); rename("fp1.txt","librecord.txt"); remove("membrrecord.txt"); rename("fp2.txt","membrrecord.txt"); } } else if(!Found2) printf("! There is no such Book...\n"); } } } else if(!Found1) printf("! Invalid User id...\n"); } } void fine() { int days, fine; printf("\nEnter your mamber id"); scanf("%d",&membr.mid); printf("\nEnter the number of days you kept the book"); scanf("%d",&days); if(days>6) { fine=((days-6)*2); printf("\n\nFine for member id %d for %d days is Rs. %d",membr.mid,days,fine); } else { printf("\n\nNO FINE"); } } void Exit() { exit(0); }

52

DISPLAY SCREENS

53

54

55

56

ESTIMATION THROUGH FPA


Function Count Measuring software size in terms of lines of code is analogous to measuring a car stereo by the number of resistors, capacitors and integrated circuits involved its production. Function points measures functionality from the users point of view, that is, on the basis of what the user requests and receives in return from the system. The principle of Albrechts function point analysis (FPA) is that a system is decomposed into functional units Inputs Outputs Enquiries Internal logical files External interface files : : : : : information entering the system. information leaving the system. requests for instant access to information. information held within the system. information held by other systems that is used by the System

The five functional system units are divided in two categories: (1) Data function types Internal Logical files (ILF): A user identifiable group of logically related data or control information maintained within the systems. External Interface files (EIF): A user identifiable group of logically related data or contRol information referenced by the system, but maintained within another system. This means that EIF counted for one system, may be an ILF in another system. (2) Transactional function types External Input (EI): An EI processes data or control information that comes from outside the system. The EI is an elementary process, which is the smallest unit of activity that is meaningful to the end user in business. External Output (EO): An EO is an elementary process that generates data or control information to be sent outside the system. External Inquiry (EQ): An EO is an alimentary process that is made up of an inputoutput combination that results in data retrieval. Special features Function point approach is independent of the language, tools, or methodologies used for implementation; i.e., they do not take into consideration programming languages, data base management systems, processing hardware or any other data base technology.

57

Function points can be estimated from requirement specification or design specifications, thus making it possible to estimate development effort in early phases of development. Function points are directly linked to the statement of requirements; any change of requirements can easily be followed by a re-estimate Function points are based on the system users external view of the software system have a better understanding of what function points are measuring.

This method resolves many of the inconsistencies that arise when using lines of code as a software size measure. Counting function points The five functional units are ranked according to their complexity i.e, Low, Average, or, High, using a set of prescriptive standards. Organizations that use FP methods develop criteria for determining whether a particular entry is Low, Average, or High. The weighting factors are identified for all functional units and multiplied with the functional units accordingly. The procedure for the calculation of Unadjusted Function Point (UFP). The procedure for the calculation of UFP in mathematical form is given below:

UFP= ZijWij
Where i indicate the row and j indicates the column. Wij : It is the entry of the ith row and jth column. Zij : It is the count of the number of functional units of Type i that have been classified as having the complexity corresponding to column j. Organizations that use function point methods develop a criterion for determining whether a particular entry is Low, Average or High. Nonetheless, the determination of complexity is somewhat subjective. The final number of function points is arrived at by multiplying the UFP by an adjustment factor that is determined by considering 14 aspects of processing complexity which are given in Table. This adjustment factor allows the UFP count to be modified by at most 35%. The final adjusted FP count is obtained by using the following relationship.

FP= UFP * CAF


Where CAF is complexity adjustment factor and is equal to [0.65 + 0.01 Fi].

Calculation of Function point for the Library Management System: Following functional units are:

58

Number of user inputs= Number of user outputs= Number of user enquiries= Number of internal files= Number of External Files=

7 4 4 5 2

Assume all the complexity adjustment factors and weighting factors are moderate. Compute the function points for the project. Ans. UFP = 5 3 Zij Wij i=1 j=1 7*3 + 4*4 + 4*3 +7*5 + 2*5 21 + 16 + 12 + 35 + 10 94. (0.65 + 0.01fi) (0.65 + 0.01(14*2)) 0.65 + 0.01(28) 0.65 + 0.28 0.93 UFP*CAF 94*0.93 87.42

UFP = = = CAF = = = = = = = =

FP

59

ESTIMATION THROUGH COCOMO-I (Intermediate)

60

Mode Organic

Semi detached

Embedded

Nature of Project Typically Small size 2-50 KLOC project, experienced developers in the familiar environment. For example, pay roll, inventory projects etc. Typically Medium size 50-300 project, KLOC Medium size team, Average previous Experience on similar project. For example: Utility systems like compilers, database systems, editors etc Typically Large over project, Real 300 KLOC time systems, Complex interfaces, Very little previous experience. For example: ATMs, Air Traffic Control etc.

Project size

Innovation Little

Deadline of Development the project Environment Familiar & In Not tight house

Medium

Medium

Medium

Significant

Tight

Complex Hardware/ customer Interfaces required

61

Basic COCOMO model takes the form Basic Model E =ab (KLOC)bb D =c (E)dd Where E is effort applied in Person-Months, and D is the development time in months Software project ab Organic Semidetached Embedded 2.4 3.0 3.6 bb 1.05 1.12 1.20 cb 2.5 2.5 2.5 dd 0.38 0.35 0.32

When effort and development time are known, the average staff size to complete the project may be calculated as: Average staff size (SS) = E/D persons When project size is known, the productivity level may be calculated as: Productivity (P) =KLOC/E KLOC/PM

Q. A new project with estimated 50 KLOC organic system has to be developed. The scale factor has very high Analyst capability, very high Programmer capability and other factors are nominal. Calculate the effort and development time. Ans. The basic COCOMO equations take the form: E = ai (KLOC)bi * EAF. D = ci (E)di. This is the case of organic mode and model is intermediate COCOMO. E = 3.2(50)1.05 * EAF EAF = 0.71*0.70*1.00*1.00*1.00 = 0.497 E = 3.2(50)1.05 * 0.497 Taking Log. = [ log 3.2 + 1.05 log 50] * 0.497 = [ log 3.2 + 1.05 log 50] * 0.497 = [ 0.5051 + 1.05*1.6990] * 0.497 = [ 0.5051 + 1.78395] * 0.497 = 2.28905 * 0.497 = 1.1376 Antilog Antilog(1.1376)

62

= = D

.1370 137.

= ci(E)di = 2.5(137)0.38 Taking log = log 2.5 + 0.38 log 137 = 0.3979 + 0.38 * 2.1367 = 0.3979 + 0.8119 = 1.2098 Antilog. Antilog(1.2098) = 162.1 = 162.

63

CLASS DIAGRAM

64

TOKEN COUNT
The size of the vocabulary of a program, which consists of the number of unique tokens used to build a program is defined as: n= n1+ n2 n: vocabulary of a program Where n1: number of unique operators n2: number of unique operands The length of the program in the terms of the total number of tokens Used is N = N1+N2 N: program length Where N1: total occurrences of operators N2: total occurrences of operands V = N * log2 n Volume The unit of measurement of volume is the common unit for size bits. It is the actual size of a program if a uniform binary encoding for the vocabulary is used. Program Level The value of L ranges between zero and one, with L=1 representing a program written at the highest possible level (i.e., with minimum size) Program Difficulty D=1/L As the volume of an implementation of a program increases, the program level decreases and the difficulty increases. E=V/L=D*V Thus, programming practices such as redundant usage of operands, or the failure to use higher-level control constructs will tend to increase the volume as well as the difficulty. Effort The unit of measurement of E is elementary mental discriminations. Estimated Program Length N = n1 log2 n1 + n2 log2 n2 N=14 log2 14+ 10 log2 10 log210 The following alternate expressions have been published to estimate program length. NJ= Log (n1!) +log2 (n2!) NB= n1Log2 n2+ n2log n1 NC = n1 n1+ n2 n2 NS = (n log2 n)/2

65

Counting rules for C language


1. 2. 3. 4. Comments are not considered. The identifier and function declarations are not considered. All the variables and constants are considered operands. Global variables used in different modules of the same program are counted as multiple occurrences of the same variable. 5. Local variables with the same name in different functions are counted as unique operands. 6. Functions calls are considered as operators. 7. All looping statements e.g., do {} while ( ), while ( ) {}, for ( ) {}, all control statements e.g., if ( ) {}, if ( ) {} else {}, etc. are considered as operators. 8. In control construct switch ( ) {case :}, switch as well as all the case statements are considered as operators. 9. The reserve words like return, default, continue, break, sizeof, etc., are considered as operators. 10. All the brackets, commas, and terminators are considered as operators. 11. GOTO is counted as an operator and the label is counted as an operand. 12. The unary and binary occurrence of + and - are dealt separately. Similarly * (multiplication operator) are dealt with separately. 13. In the array variables such as array-name [index] array name and index are considered as operands and [ ] is considered as operator. 14. In the structure variables such as struct-name, member-name or struct-name -> member-name, struct-name, member-name are taken as operands and ., -> are taken as operators. Some names of member elements in different structure variables are counted as unique operands. 15. All the hash directive are ignored.

66

Potential Volume V*= (2+ n2 ) log2 (2+ n2 ) Estimated Program Level / Difficulty Halstead offered an alternate formula that estimate the program level. L=2 n2 /( n1N2) Where D=1/L= n1N2/2 n2 Effort and Time V / L V *D (n1 N2 N log2 ) / 2 T E / is normally set to 18 since this seemed to give best results in Halsteads earliest experiments, which compared the predicted times with observed programming times, including the time for design, coding, and testing. Language Level LXV*L2v Using this formula, Halstead and other researchers determined the language level for various languages

67

Consider a program for token count:


#include<stdio.h> #include<conio.h> #include<malloc.h> struct node { int info; struct node *next; }; typedef struct node NODE; NODE *start; Void createemptylist( NODE *start) { *start = NULL; } Void traversinorder(NODE *p) { While (p=!NULL) { printf(%d \n,p->info); P=p->next; } } Void insertatbegin(int item) { NODE *p; P=(NODE *)malloc(sizeof(NODE)); P->info=item; If(start==NULL) P->next=NULL; Else p->next=start; start=p; } Void insert_at_end( int item) { NODE *p , *loc; P=(NODE *)malloc(sizeof(NODE)); P->info=item; p->next=NULL; if(start==NULL) start=p;

68

else { loc=start; while(loc->next!=NULL) loc=loc->next; loc->next=ptr; } } Void dele_beg(void ) { NODE *p; If(start==NULL) Return; Else { P=start; Start=start->next; Printf(no deleted is=%d,p->info); Free(p); } } Void dele_end() { NODE *p, *loc; If(start==NULL) Return; Else if((start)->next==NULL) { p=start; Start=NULL; Printf(NO deleted is =%d,p->info); Free(p); } Else { loc=start; P=start->next; While(p->next=NULL) { loc=p; P=p->next; } Loc->next=NULL; Free(p); } }

69

Void insert_spe(NODE *start,int item) { NODE *p,*loc; Int temp,k; For(k=0;loc=start;k<temp;k++) { Loc=loc->next; If(loc==NULL) { Printf(node in the list at less than one\n); Return; } } P=(NODE *)malloc(sizeof(NODE)); p->info=item; p->next=loc->next; loc->next=p; } Dele_spe() { Node *p,*temp; Int I,loc; Printf(nter the postion); Scanf(%d,&loc); If(start==NULL) { Printf(Empty list); } Else { Ptr=start; For(i=1;i<=loc;i++) { Temp=ptr; Ptr=ptr->next; } Printf(no deletd is+%d,ptr->num); Temp->next=ptr->next; }

70

Void main() { Int choice,item,after; Char ch; Clrscr(); Createemptylist(start); Do { Printf(Insert at begin); Printf(Insert at end); Printf(Insert at specific position); Printf(traverse inorder); Printf(delete from begin); Printf(delete from last); Printf(delete at specific position); Printf(exit); Printf(enter ur choice); Scanf(%d,&choice); Switch(choice) { Case1:printf(Enter the item); Scanf(%d,&item); Insertatbegin(item); Break; Case2: printf(Enter the item); Scanf(%d,&item); Insert_at_end(item); Break; Case3: printf(Enter the item); Scanf(%d,&item); Insert_spe(start,item); Break; Case4: printf(traverse the list); Traverseinoder(start); Break; Case5: printf(delete the item); Dele_beg(); Break; Case6: printf(delete the item); Dele_end(start); Break; Case7: printf(delete the item); Dele_spe(start); Break; Case8:return; }

71

Fflush(stdin); Printf(do u want to continue); Scanf(do youwant to continue) Scanf(%c,&ch); } While((ch=y)||(ch=Y)); Getch(); }

72

TOKEN COUNT
Q. Consider the insertion and deletion of the node in the liked list program. List out the operators and operands and also calculate the values of software science measures like n.N,V,E,lambda() etc. Operators Int * {} ; {} , [] If = -> == <= != Else While Printf Scanf Elseif NULL Malloc Traverse Createemptylist Insertatbegin Insert_at_end Free Struct : & Del_node Occurrences 3 18 21 27 105 72 13 2 5 33 24 7 1 2 5 4 19 2 1 15 3 2 2 2 2 4 1 6 1 1 Operators Node P Num Item Loc Next \n Start Temp Next Ptr 1 0 NODE Loc | Choice After ch Occurrences 11 37 7 13 20 20 18 27 3 17 5 3 2 7 20 4 3 1 1

73

Del_beg Clrscr() Exit Break Del_spe n1=36

1 1 1 7 1 N1=413 n2=19 N2=219

Here N1=413 and N2=219. The program length N=N1+N2=632 Vocabulary of the program n=n1+n2=55 Volume V=N*log2n =632*log2(55) =1548 bits The estimated program length N of the program =36 log 2 36+19 log2 19 =36*1.848+19*0.926 =84.12 n2*=2 The potential volumeV* = 4 log2 4 = 10 L=V*/V =10/1548 =0.006 D=1/L = 1/0.006 = 166.6 Estimated program level L = (2*n2)/)n1*N2) = (2*19)/(36*219) = 0.004 V* = V*L = 1548*0.004 = 6.192
^ ^ ^ ^

74

E=V/L =1548/0.004 =387000 T=E/ =387000/18 =21500 sec.ss

75

TESTING
Testing is a process of executing a program with the intent of finding an error. A good test case is one that has a high probability of finding an as-yet undiscovered error. A successful test is one that uncovers an as-yet undiscovered error.

Test case It describes an input description and an expected output description Inputs are of two types : pre-conditions and actual inputs. Expected outputs are of two types: post-conditions and actual outputs. If expected and observed outputs are different, there is a failure and it must be recorded properly to identify the cause of failure, otherwise success. A good test case has a high probability of finding an error. The sets of test cases are called a test suite.

Test case template:


Test case ID: Section-I (Before execution) Purpose: Pre-condition (if any): Inputs: Expected outputs: Post-conditions: Written by: Date: Section-II (After execution) Execution history: Result: If fails, any possible reason(optional) Any other observation: Any suggestion: Run by: Date:

76

TEST CASE TEMPLATES:


Test case ID: 01 Section-I (Before execution) Purpose: Insert a node at a beginning of the link list. Pre-condition: Link list must be created first. Inputs: Nodes data Expected outputs: Node has been successfully inserted at the beginning of the list. Post-conditions: Link list updated Written by: Sumit Chhabra Date: 05-05-2012

Section-II (After execution) Execution history: 11 Result: Node has been successfully inserted at the beginning of the list. If fails, any possible reason(optional) Successful Any other observation: No Any suggestion: Check the whole list before insertion Run by: Sumit Chhabra Date: 05-05-2012

Test case ID: 02 Section-I (Before execution) Purpose: Delete node from the link list Pre-condition: Link list must be created first. Inputs: Nodes location

Section-II (After execution) Execution history: 13 Result: Node has been successfully deleted at the beginning of the list. If fails, any possible reason(optional) Successful

Expected outputs: Node has been Any other observation: No successfully deleted at the beginning of the list. Post-conditions: Link list updated Any suggestion: Deleted element cannot be retrieved if it deleted once so be careful Written by: Sumit Chhabra Date: 05-05-2012 Run by: Sumit Chhabra Date: 05-05-2012

77

Test case ID: 03 Section-I (Before execution) Purpose: Traverse inorder Pre-condition: Link list must be created first. Inputs: input 4 (select from option) Expected outputs: Display the whole list Post-conditions: Null Written by: Sumit Chhabra Date: 05-05-2012

Section-II (After execution) Execution history: 19 Result: Display the whole list If fails, any possible reason(optional) Successful Any other observation: No Any suggestion: If the list is empty it show no data Run by: Sumit Chhabra Date: 05-05-2012

78

TEST CASE MANUALS:


1. BOUNDARY VALUE ANALYSIS
Boundary value analysis states that test case closed to the boundary values have higher chances of detecting errors. By boundary condition, an input value may be on the boundary. Total number of test case in the analysis is 4n+1, where n is the number of inputs in the system.

TEST CASE 1. 2. 3. 4. 5. 0 1 50 99 100

INPUT X

EXPECTED OUPUT No creation Node created Node created, linked with first node Node created, linked with second node Node created, linked with third node

79

2. ROBUSTNESS TESTING It is just the extension of boundary value analysis. This testing is mainly concerned about the exceptional conditions. By exceptional condition, it means the extreme values extended with a value slightly greater than the maximum and a value slightly less than the minimum. Total number of the test case are 6n+1, where n is the number of inputs in the system.

TEST CASE 1. 2. 3. 4. 5. 6. 7. -1 0 1 50 99 100 101

INPUT X

EXPECTED OUPUT Invalid input No creation Node created Node created, linked with first node Node created, linked with second node Node created, linked with third node Invalid input

80

3. EQUIVALENCE CLASS TESTING: Equivalence class testing basically partitions the valid and invalid inputs in different classes. Input domain of a program is partitioned into a finite number of equivalence classes such that one can reasonably assume that the test of a representative value for each class is equivalent to a test of any other value. If one test fins error in a class, other test in that class would be expected to find same error. If a test case not detects an error, we would expect that no other test cases in a class would find an error. Two steps are required in implementing this method: 1. Equivalence classes are identified by taking each input condition and portioning it into valid and invalid classes. 2. Generate test cases using the equivalence classes identified in previous step. This is performed by writing test cases covering all the valid equivalence classes. Then a test case is written for each invalid equivalence class so that no test contains more than 1 invalid class. This is to ensure that no two invalid classes mask each other.

Test class of valid inputs: TEST CASE 1. 2. 3. 4. 1 50 99 100 INPUT X EXPECTED OUPUT Node created Node created, linked with first node Node created, linked with second node Node created, linked with third node

Test class for invalid inputs: TEST CASE 1. 2. 3. 0 -1 101 INPUT X EXPECTED OUPUT No creation Invalid input Invalid input

81

REFERENCES

BOOKS
1) Software Engineering (Third Edition)- K.K.Aggarwal, Yogesh Singh INTERNATIONAL PUBLISHERS) 2) Software engineering, A practitioners approach, 5th edition ROGER S. PRESSMAN, McGraw-Hill International Edition 3) Rational Rose software - UML diagramming and OOD tool. (NEW AGE

LINKS
1) http://www.scribd.com/doc/28494647/SRS-for-library-management-system 2) http://en.wikipedia.org/wiki/Data_dictionary 3) http://2k8618.blogspot.in/2009/10/library-management-system-c-program-s3.html

82

Das könnte Ihnen auch gefallen