Vous êtes sur la page 1sur 47

A Project Report on

BARCODE GENERATOR"
In partial fulfillment of the requirements for the award of the degree of

BACHELOR OF TECHNOLOGY In INFORMATION TECHNOLOGY Submitted By P.KARTHIKEYAN 09911A1214 R .KIREETI 09911A1215

Under the Esteemed Guidance of Mr. SURESH

Assistant professor,Dept of IT

Department of Information Technology

VIDYA JYOTHI INSTITUTE OF TECHNOLOGY (Affiliated to Jawaharlal Nehru Technological University, Hyderabad)

DEPARTMENT OF INFORMATION TECHNOLOGY VIDYA JYOTHI INSTITUTE OF TECHNOLOGY


Aziz Nagar Gate,C.B. Post.Moinabad,Hyderabad - 500 075

(Affiliated to Jawaharlal Nehru Technological University, Hyderabad)

CERTIFICATE

This is to certify that the project report on BARCODE GENERATOR is a bonafide work by P.KARTHIKEYAN(09911A1214),R .KIREETI(09911A1215) in partial fulfillment of the requirement for the award of the degree of Bachelor of Technology in INFORMATION TECHNOLOGY JNTU Hyderabad during the year 2012-2013

Project guide
Mr. M.Suresh M.TECH Associate Professor

Head of the department


Mr. B. Srinivasulu M.E Associate Professor

VIDYA JYOTHI INSTITUTE OF TECHNOLOGY


Aziznagar Gate, C.B.Post, Moinabad, Hyderabad-500 075.

2012-2013

EXTERNAL EXAMINER

DECLARATION
I Mr. KARTHIKEYAN.P(09911A1214), hereby declare that the project entitled Barcode generator , submitted in the partial fulfillment of the requirements for the award of Bachelor of Technology in Information Technology to Vidya Jyothi Institute of Technology, affiliated to JNTU, Hyderabad is an authentic work and has not been submitted to any other university or institution for award of the degree.

KARTHIKEYAN.P

09911A1214

VIDYA JYOTHI INSTITUTE OF TECHNOLOGY


Aziznagar Gate, C.B.Post, Moinabad, Hyderabad-500 075.

2012-2013

EXTERNAL EXAMINER

DECLARATION
I Mr.KIREETIRP(09911A1215), hereby declare that the project entitled Barcode generator , submitted in the partial fulfillment of the requirements for the award of Bachelor of Technology in Information Technology , to Vidya Jyothi Institute of Technology, affiliated to JNTU, Hyderabad is an authentic work and has not been submitted to any other university or institution for award of the degree.

KIREETI.R

09911A1215

ABSTRACT
A bar code is an optical machine-readable representation of data. Originally, bar codes represented data in the widths (lines) and the spacing of parallel lines and may be referred to as linear or 1Dbarcodes or symbiosis. But they also come in patterns of squares, dots, hexagons and other geometric patterns within images termed 2D matrix codes or symbiosis.. The Uniform Product Code (UPC), regulated by the Uniform Code Council, an industry organization, has provided a standard bar code used by most retail stores. The European Article Numbering system (EAN), developed by Joe Woodland, the inventor of the first bar code system, allows for an extra pair of digits and is becoming widely used. Everyday you see bar codes in the world around you. You see them in supermarkets, on labels, greeting cards and consumable goods. By now you also realize that bar codes have replaced the traditional pricing of products. Bar codes can be used in every business around the world. For example:

To track assets in any building including every desk, computer, telephone and desk accessory. To help security guards identify every employee, every door they enter and every room they work in. To secure, lock or unlock entrances or exits throughout the plant.

A bar code can best be described as an "optical Morse code.". The bar code labels are read with a scanner, which measures reflected light and interprets the code into numbers and letters that are passed on to a computer. Because there are many ways to arrange these bars and spaces, numerous symbiosis are possible. Common linear symbiosis include UPC/EAN, Interleaved 2 of 5 , Coda bar, Code 39, and Code 128.

CONTENTS

S NO Pg No

Chapters

1.

Introduction

2. LITERATURE SURVEY 2.1 2.2


3.

Existing System Proposed Sytem 9 9 10 11 11 12 13 14

Tools and Softwares Used 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 Methodology Purpose Scope Definations,acronyms and Abbreviations Tools used Technologies to be used Overview Performance requirements Hardware interface

4. Project Description 4.1 4.2 4.3 4.4 Data to encode Barcode symboligies Encoding Barcode Generation

16 16 17 18 18 20 21 21 23 24 25 35 52 54 54

5. Diagrams 5.1 5.2 5.3 5.4 Class Diagram Use-Case Model Survey Sequence Diagram Activity Diagram

6. Sample Code 7. Snapshots 8. Testing 9. Conclusion and Future Extensions 9. References

Chapter 1:Introduction
Barcode Generator is advanced and user friendly software for generating printable and scannable professional barcodes for number of small to large scale commercial and noncommercial sectors in nominal time and steps. Application integrates extremely simple and categorized interface along with most handy toolbar to facilitate basic functions in few clicks. Barcode Generator tool efficiently creates multiple optimized barcodes with widely usable 26 linear barcode fonts such as EAN, UPC, Code 39, Code128, ISBN, Telepen, Postnet, MSI, GS1 etc. Barcode Software offers an automated expert solution to create batch of single or sequential list barcodes either with constant or sequential values. Barcode Tool is an ultimate tool to generate number of barcodes by import or export data through Text or Excel documents and easily edit values in datasheet. Barcode Generator incorporates feature to define additional information (Item Name, Code etc.) with barcodes through Text Above/Below option. Application is proficient to create and design customized barcodes by implementing various settings and formatting in bars and text like height, width, density, color, spaces, margins, font style and lots of others and promptly make adjustments as per specific requirement through quick view panel with measuring scale.

Key Features

Simple and easy to use. Speedily creates multiple barcodes. Generates Single value or Sequential List of barcodes. Import and Export data in Text and Excel files. Designs customized barcodes. Integrates preview panel with measuring scale. Retains easily accessible toolbar. Efficient to print with ordinary and barcode printer. Print barcodes with pre defined label stocks viz. Ace, Avery, Apli etc. Allow to save barcodes as jpg, gif, bmp, tiff, gif and other format images. Supports Copy to Clipboard function. Provides advantageous Help and Support Standalone Windows application. Technical expertise is not required. Generates barcodes for multitudinous industries i.e. Manufacturing, Inventory, Retail, Stationary, Pharmaceuticals, Telecommunications etc.

Chapter 2. Literature Survey


In this section, informations about the existing system, proposed feasibility study about the project are discussed. system and

2.1 Existing System:


The Code 39 specification defines 43 characters, consisting of uppercase letters (A through Z), numeric digits (0 through 9) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted '*') is used for both start and stop delimiters. The barcode itself does not contain a check digit. Code39 used especially in non-retail environments.

2.2. Proposed System:


Even though the character codes themselves are self-checking, damaged images (such as white or black vertical stripes can occur on faxes) can create valid but incorrect bar codes To overcome this, we have generated barcode Code 39 mod 43. In this Code 39 mod 43 we have the code with check digit.

Chapter 3: Tools And Softwares used


3.1 Methodology : Rational Unified Process:
Rational Unified Process (RUP) is an object-oriented and Web-enabled program development methodology. According to Rational (developers of Rational Rose and the Unified Modeling Language), RUP is like an online mentor that provides guidelines, templates, and examples for all aspects and stages of program development. RUP and similar products -- such as ObjectOriented Software Process (OOSP), and the OPEN Process -- are comprehensive software engineering tools that combine the procedural aspects of development (such as defined stages, techniques, and practices) with other components of development (such as documents, models, manuals, code, and so on) within a unifying framework.

Inception Phase:
Inception is the smallest phase in the project, and ideally it should be quite short. If the Inception Phase is long then it may be an indication of excessive upfront specification, which is contrary to the spirit of the Unified Process.

Elaboration Phase:
During the Elaboration phase the project team is expected to capture a healthy majority of the system requirements. However, the primary goals of Elaboration are to address known risk factors and to establish and validate the system architecture. Common processes undertaken in this phase include the creation of use case diagrams, conceptual diagrams (class diagrams with only basic notation) and package diagrams (architectural diagrams).

Construction Phase:
Construction is the largest phase in the project. In this phase the remainder of the system is built on the foundation laid in Elaboration. System features are implemented in a series of short, timeboxed iterations. Each iteration results in an executable release of the software. It is customary to write full text use cases during the construction phase and each one becomes the start of a new iteration. Common UML (Unified Modelling Language) diagrams used during this phase include Activity, Sequence, Collaboration, State (Transition) and Interaction Overview diagrams.

Transition Phase:
The final project phase is Transition. In this phase the system is deployed to the target users. Feedback received from an initial release (or initial releases) may result in further refinements to be incorporated over the course of several Transition phase iterations. The Transition phase also includes system conversions and user training.

3.2 Purpose:

The purpose of designing the unique id management portal is to give an interface for, the citizens who apply for their Unique ID, agents who help the citizens to get their ID, administrator to manage the citizen and agent. The Unique ID Management (UIDM) is intended to provide a unique ID to each and every citizen of India. Citizens have to register through this site and get a password to access the site.

3.3 Scope:
It facilitates unique product identification through using international symbiosis/numbering system, promotes brand image and would enable timely and accurate capture of product information. This would result in wide ranging benefits including lowering of inventory costs, lower overall supply chain costs and hence reduced costs for Indian products, increasing efficiency of Indian industry and adherence to stringent quality assurance norms through product traceability

3.4 Definitions & Acronyms: UML :


Unified Modeling Language (UML) is a standardized general-purpose modeling language in the field of object-oriented software engineering. UML includes a set of graphic notation techniques to create visual models of objectoriented software-intensive systems.

J2EE :
Java Enterprise Edition 5 is a programming platform part of the Java Platform-for developing and running distributed multi-tier architecture Java applications, based largely on modular software components running on an application server.

Eclipse:
Eclipse is a development tool that helps to design web pages and also helps to design the diagrams like ER, Database schema diagrams and to generate DDL.

Code 39:
The Code 39 specification defines 43 characters, consisting of uppercase letters (A through Z), numeric digits (0 through 9) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted '*') is used for both start and stop delimiters

UPC: T The Universal Product Code (UPC) is a barcode symbology (i.e., a specific type of barcode) that is widely used in North America, the United Kingdom, Australia, New Zealand and in other countries for tracking trade items in stores. Its most common form, the UPC-A, consists of 12 numerical digits, which are uniquely assigned to each trade item.

EAN:
An EAN barcode (originally European Article Number, but now renamed International Article Number even though the abbreviation EAN has been retained) is a 13 digit (12 data and 1 check) barcoding standard which is a superset of the original 12-digitUniversal Product Code (UPC) system developed in the United States. The EAN-13 barcode is defined by the standards organizationGS1.

3.5 Tools Used:


JAVA
Java is an object-oriented programming language developed by Sun Microsystems a company best known for its high end UNIX workstations. Java language was designed to be small, simple, and portable across platforms, operating systems, both at the source and at the binary level, which means that Java programs (applet and application) can run on any machine that has the Java virtual machine (JVM) installed.

J2EE :
Java Enterprise Edition 5 is a programming platform part of the Java Platform-for developing and running distributed multi-tier architecture Java applications, based largely on modular software components running on an application server.

Eclipse
IBM Rational Application Developer for Web Sphere Software (RAD) is an integrated development environment (IDE), made by IBM's Rational Software division, for visually designing, constructing, testing, and deploying Web services, portals, and Java (J2EE) applications.

3.6 Technologies Used: Rational rose : Modeling tool. Windows : Operating system. JDK 1.4 :
Java tool

3.7 Overview:
The overview will include two sections, namely:

Overall Description:
section will describe major interconnections, and external interfaces.
This

components

of

the

system,

Specific Requirements:
This section will describe the functions of actors, their roles in the system and the constraints faced by the system.

3.8 PERFORMANCE REQUIREMENTS


Performance is measured in terms of the output provided by the application. Requirement specification plays an important part in the analysis of a system. Only when the requirement specifications are properly given, it is possible to design a system, which will fit into required environment. It rests largely with the users of the existing system to give the requirement specifications because they are the people who finally use the system. This is because the requirements have to be known during the initial stages so that the system can be designed according to those requirements. It is very difficult to

change the system once it has been designed and on the other hand designing a system, which does not cater to the requirements of the user, is of no use. The requirement specification for any system can be broadly stated as given below: The system should be able to interface with the existing system The system should be accurate The system should be better than the existing system

3.9 Hardware Interface


Minimum Requirements System: Processor RAM Disk space 512 MB 500 MB Pentium-IV with 800MHz

Chapter 4: Project Description


4.1 Data to Encode:
The * character presented below is not a true encodable character, but is the start and stop symbol for Code 39. The asymmetry of the symbol allows the reader to determine the direction of the barcode being scanned. This code is traditionally mapped to the * character in barcode fonts and will often appear with the human-readable representation alongside the barcode. These tables outline the Code 39 specification:

Legend Format1 Format2 W N w n B b W w Desc Wide Black Narrow - Black Wide White Narrow - White

4.2 Barcode symbology:


The mapping between messages and barcodes is called a symbology. The specification of a symbology includes the encoding of the single digits/characters of the message as well as the start and stop markers into bars and space, the size of the quiet zone required to be before and after the barcode as well as the computation of a checksum. Linear symbologies can be classified mainly by two properties: Continuous vs. discrete: Characters in continuous symbologies usually abut, with one character ending with a space and the next beginning with a bar, or vice versa. Characters in discrete symbologies begin and end with bars; the intercharacter space is ignored, as long as it is not wide enough to look like the code ends. Two-width vs. many-width: Bars and spaces in two-width symbologies are wide or narrow; the exact width of a wide bar has no significance as long as the symbology requirements for wide bars are adhered to (usually two to three times wider than a narrow bar). Bars and spaces in many-width symbologies are all multiples of a basic width called the module; most such codes use four widths of 1, 2, 3 and 4 modules.

Some symbologies use interleaving. The first character is encoded using black bars of varying width. The second character is then encoded, by varying the width of the white spaces between these bars.

Linear symbologies are optimized for laser scanners, which sweep a light beam across the barcode in a straight line, reading a slice of the barcode light-dark patterns. Stacked symbologies are also optimized for laser scanning, with the laser making multiple passes across the barcode.

4.3 Encoding:
Once the checksum digit has been calculated we know the entire message which must be encoded in the bars and spaces. Continuing with our example, we will encode, from zero, the Code 39 bar code we used in our example above: HI345678 with a checksum digit of 67. In the following text, we will discuss the encoding of the bar code by considering that the number "1" represents a "dark" or "bar" section of the bar code whereas a "0" represents a "light" or "space" section of the bar code. Thus the numbers 1101 represents a doublewide bar (11), followed by a single-wide space (0), followed by a single-wide bar (1). This would be printed in the bar code as:

A Code 39 bar code has the following structure: 1. A start character - the asterisk (*) character. 2. Any number of characters encoded from the table below. 3. An optional checksum digit calculated as described above and encoded from the table below. 4. A stop character, which is a second asterisk character.

CODE 39 ENCODING TABLE


This table indicates how to encode each digit of a Code 39 bar code. Note that the "Width Encoding" column is expressed as "N" for narrow and "W" for wide while the "Barcode

Encoding" column represents how the bar code will actually be encoded as described above in "Encoding the Symbol." Keep in mind that each character begins and ends with a bar, thus the "bar code encoding" always starts and ends with a "1".
CHEC ASCI CHEC ASCI K I WIDTH BARCODE K I WIDTH BARCODE VALU CHA ENCODING ENCODING VALU CHA ENCODING ENCODING E R E R 0 0 NNNWWNWN 1010011011 N 01 WNNWNNNN 1101001010 W 11 NNWWNNNN 1011001010 W 11 WNWWNNNN 1101100101 N 01 NNNWWNNN 1010011010 W 11 WNNWWNNN 1101001101 N 01 NNWWWNNN 1011001101 N 01 NNNWNNWN 1010010110 W 11 WNNWNNWN 1101001011 N 01 NNWWNNWN 1011001011 N 01 NNWWNNWN 1101010010 N 11 NNWNNWNN 1011010010 W 11 22 M WNWNNNNW 1101101010 N 01 NNNNWNNW 1010110100 W 11 WNNNWNNW 1101011010 N 01 NNWNWNNW 1011011010 N 01 NNNNNNWW 1010101100 W 11 WNNNNNWW 1101010110 N 01 NNWNNNWW 1011010110 N 01 NNNNWNWW 1010110110 N 01 WWNNNNNN 1100101010 W 11 NWWNNNNN 1001101010 W 11 WWWNNNNN 1100110101 N 01 NWNNWNNN 1001011010 W 11

23

24

25

26

27

28

29

30

31

10

32

11

33

12

WNWNNWNN 1101101001 N 01 NNNNWWNN 1010110010 W 11 WNNNWWNN 1101011001 N 01 NNWNWWNN 1011011001 N 01 NNNNNWWN 1010100110 W 11 WNNNNWWN 1101010011 N 01 NNWNNWWN 1011010011 N 01 NNNNWWWN 1010110011 N 01 WNNNNNNW 1101010100 W 11

34

WWNNWNNN 1100101101 N 01 NWWNWNNN 1001101101 N 01 NWNNNNWN 1001010110 W 11 WWNNNNWN 1100101011 N 01

13

35

14

36

15

37

16

38

SPAC NWWNNNWN 1001101011 E N 01 $ NWNWNWNN 1001001001 N 01 NWNWNNNW 1001001010 N 01 NWNNNWNW 1001010010 N 01 NNNWNWNW 1010010010 N 01 NWNNWNWN 1001011011 N 01

17

39

18

40

19

41

20

42

21

NNWNNNNW 1011010100 n/a W 11

If a Code 39 bar code starts with a space, that bar code will be appended to any previous code 39 bar code in the buffer and the system will wait for additional bar code(s). If a Code 39 bar code doesn't start with a space, the bar code will be appended to any previous code 39 bar codes and the entire message will be delivered to the application. In other words, if a code 39 bar code has additional bar codes to follow, it must start with a space-if the bar code is the last bar code in the message it must not start with a space.

Code 39 is sometimes used with an optional modulo 43 check digit. Using it requires this feature to be enabled in the barcode reader. The code with check digit is referred to asCode 39 mod 43. Here is how to do the checksum calculation: Take the value (0 through 42) of each character in the barcode excluding start and stop codes.

Sum the values. Divide the result by 43. The remainder is the value of the checksum character to be appended.

4.4 Barcode Generation


Barcode is generated for the example TEST8052,without using a check digita check digit.
1. The START character (*): 100101101101. 2. The digit "T": enocded as 101011011001. 3. The digit "E": enocded as 110101100101. 4. The digit "S": enocded as 101101011001. 5. The digit "T": enocded as 101011011001. 6. The digit "8": enocded as 110100101101. 7. The digit "0": enocded as 101001101101. 8. The digit "5": enocded as 110100110101. 9. The digit "2": enocded as 101100101011. 10. The STOP character (*): 100101101101.

This is shown in the following graphical representation where the bar code has been sectioned-off into areas that reflect each of the 10 components just mentioned.

NOTE: In the above encoding example note that there is an inter-character space between each character. This is not listed in the list of 10 components, but there is an inter-character space between each character. This intercharacter space is represented in the graphic by the white space separating the grey areas.

Chapter 5: Diagrams

UML Diagram ClassificationStatic, Dynamic, and Implementation A software system can be said to have two distinct characteristics: a structural, "static" part and a behavioral, "dynamic" part. In addition to these two characteristics, an

additional characteristic that a software system possesses is related to implementation. Before we categorize UML diagrams into each of these three characteristics, let us take a quick look at exactly what these characteristics are.

Static: The static characteristic of a system is essentially the structural aspect of the system. The static characteristics define what parts the system is made up of. Dynamic: The behavioral features of a system; for example, the ways a system behaves in response to certain events or actions are the dynamic characteristics of a system.

Implementation: The implementation characteristic of a system is an entirely new feature that describes the different elements required for deploying a system.

The UML diagrams that fall under each of these categories are:

Static
o o

Use case diagram Class diagram Object diagram State diagram Activity diagram Sequence diagram Collaboration diagram Component diagram Deployment diagram

Dynamic
o o o o o

Implementation
o o

DATA FLOW DIAGRAMS


The Dataflow Diagrams allows you to create and maintain business functions, data stores, data flows and externals that are stored in the Repository. Dataflow diagramming involves the creation of diagrams to show how data flows through your organization. Dataflow diagrams are drawn to represent data dependencies, system components or even the context of a project.

Each dataflow diagram represents a single business function for an application system .This function may be a mission statement for an entire organization, or a small series of activities for an isolated part of the organizations business. DFDs show the flow of data from external entities into the system, showed how the data moved from one process to another, as well as its logical storage. There are only four symbols: 1) Squares representing external entities, which are sources or destinations of data.

External Entity

2) Rounded rectangles representing process, which take data as input, do something to it, and output it.

Proc ess

3) Arrows representing the data flows , which can either be electric data or physical items.
Data

4)Open ended rectangles representing data stores , including electronic stores such as databases or XML files and physical stores such as or filing cabinets or stacks of paper.

Data Store

LEVELS OF ABSTRACTION:Level 0:The Highest level DFD is Level 0.It shows the entire application as a single process surrounded by its data stores and is sometimes known as context diagram.

Level 1:-

It shows the whole application again but with the main processes, the data flows between them and their individual links the data stores.

Level 2:Each process from level 1 is expanded into its own level 2 diagram and then into lower level diagram to show further detail. Process no 1 at level 1 would be expanded into processes 1.1, 1.2, 1.3, etc... At level 2. Data stores remain the same at all levels of abstraction but new stores may be introduced at any level. These are usually temporary stores such as views and cursors which are required in lower level processes.

5.1 Class Diagram:


The class diagram is used to refine the use case diagram and define a detailed design of the system. The class diagram classifies the actors defined in the use case diagram into a set of interrelated classes. The relationship or association between the classes can be either an "is-a" or "has-a" relationship. Each class in the class diagram may be capable of providing certain functionalities. These functionalities provided by the class are termed

"methods" of the class. Apart from this, each class may have certain "attributes" that uniquely identify the class.

GUI text : textfield fontsize : radiobutton fintStyle : ComboBox width : int height : int getText() setFontStyle() setFontSize() setW idth() setHeight()

Bar_Code encodetext : String encodealgo : String charSet : String[] getText() encode() generate_barcode() print()

5.2 Use case Diagram:


The use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases." The use case diagram shows which actors interact with each use case.

E n t e r Te x t

A d ju s t S e t t in g s

us er

B a rc o d e

E nc ode

G e n e ra t e B a rc o d e

5.3 Sequence Diagram:


A sequence diagram represents the interaction between different objects in the system. The important aspect of a sequence diagram is that it is time-ordered. This means

that the exact sequence of the interactions between the objects is represented step by step. Different objects in the sequence diagram interact with each other by passing "messages".

user

barcode processing 1: req for opening text field

2: loads the text

3:

response to user

4: req for code39 p 5: Read and process the text

response to user 6:

7: req for 3 of 9 modulo 43

8: read and process the text

9: response to user

10: req for adjustments

11: read and process the text

12:response to user

5.4 Activity Diagram:


Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. In the Unified

Modeling Language, activity diagrams can be used to describe the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control.

Enter text To Encode

Set Font Size

Set Font Style

Set Width & Height

Encode to 3of 9 algorith

Print barcode to Canvas

Chapter 6: Sample Code


MAIN MODULE GENERATION:

private void Encode() {

filledStringToEncode=new String(stringToEncode);

// aggiungo il check char

if ( style==CODE3OF9CHK ) { int leng=stringToEncode.length(); int sum=0; for ( int i=0;i<leng ;i++ ) { sum+=alphabet3of9.indexOf(stringToEncode.charAt(i)); } sum=sum%43; filledStringToEncode+=alphabet3of9.charAt(sum); }

// ci aggiungo i caratteri di start e stop filledStringToEncode="*"+filledStringToEncode+"*";

//codifico la stringa secondo il codice encodedString=""; int length=filledStringToEncode.length();

for ( int i=0;i<length-1 ;i++ ) { encodedString+=coded3of9Char[alphabet3of9.indexOf(filledStringToEncode.c harAt(i))]; encodedString+=intercharacterGap; } encodedString+=coded3of9Char[alphabet3of9.indexOf(filledStringToEncode.cha rAt(length-1))];

repaint();

} // end Encode3of9()

APPLET CREATION AND FINAL PHASE:

import java.applet.Applet; import java.awt.*; //import BarCode3of9; /* <applet code="BarCodeTest.class" width="800" height="800"> </applet> */

public class BarCodeTest extends Applet { BarCode3of9 bc;

// GUI components declaration Label l1,l2,l3,l4,l5,l6,l7,l8,l9; Panel p,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9; TextField tf; Checkbox cb1,cb2,cb3,cb4,cb5,cb6,cb7,cb8,cb9,cb10,cb11,cb12,cb13,cb14,cb15,cb16; CheckboxGroup cbg1,cbg2,cbg3,cbg4,cbg5;

Choice ch=new Choice(); Choice ch1=new Choice(); int fontdim=8;

public void init() { p=new Panel();

setLayout (new BorderLayout()); setBackground (Color.lightGray); l1=new Label("Insert text to encode:"); tf=new TextField("HELLO",40); p1=new Panel(); p1.add(l1);p1.add(tf); p.add(p1);

l2=new Label("Select a variant:"); ch.addItem("CODE3OF9"); ch.addItem("CODE3OF9CHK"); p2=new Panel(); p2.add(l2);p2.add(ch);

p.add(p2);

l3=new Label("Choose a dimension:"); cbg2=new CheckboxGroup(); cb3=new Checkbox("small",cbg2,true); cb4=new Checkbox("medium",cbg2,false); cb5=new Checkbox("large",cbg2,false); p3=new Panel(); p3.add(l3);p3.add(cb3);p3.add(cb4);p3.add(cb5); p.add(p3);

l5=new Label("Text inside:"); cbg1=new CheckboxGroup(); cb1=new Checkbox("Text Yes",cbg1,true); cb2=new Checkbox("Text No",cbg1,false); p5=new Panel(); p5.add(l5);p5.add(cb1);p5.add(cb2); p.add(p5);

l6=new Label("Select a font:"); Toolkit toolKit=getToolkit(); String[] fList=toolKit.getFontList(); for(int n=0;n<fList.length;n++) ch1.addItem(fList[n]);

p6=new Panel(); p6.add(l6);p6.add(ch1);

p.add(p6);

l7=new Label("Font size:"); cbg4=new CheckboxGroup(); cb9=new Checkbox("8",cbg4,true); cb10=new Checkbox("10",cbg4,false); cb11=new Checkbox("12",cbg4,false); cb12=new Checkbox("14",cbg4,false); cb13=new Checkbox("16",cbg4,false); p7=new Panel(); p7.add(l7);p7.add(cb9);p7.add(cb10);p7.add(cb11);p7.add(cb12);p7.add(cb13); p.add(p7);

l8=new Label("Text alignment:"); cbg5=new CheckboxGroup(); cb14=new Checkbox("Baseline",cbg5,false); cb15=new Checkbox("Middleline",cbg5,false); cb16=new Checkbox("Topline",cbg5,true); p8=new Panel(); p8.add(l8);p8.add(cb14);p8.add(cb15);p8.add(cb16); p.add(p8);

add("Center",p);

p0=new Panel();

bc=new BarCode3of9(); // customization of the component bc.setDimension ( BarCode3of9.SMALL ); bc.setTextInside ( true ); bc.setStyle ( BarCode3of9.CODE3OF9 ); //bc.setBackground ( Color.lightGray ); bc.setForeground ( Color.black ); bc.setFont ( getFont() ); bc.setTextAlign ( BarCode3of9.TOPLINE );

// resize the component to fit a barcode of 8 char length string bc.resize(bc.requestedMinimunSize("12345678")); try { bc.setString("HELLO"); } catch (Exception e){} // finally add the component p0.add(bc);

add("East",p0);

CHAPTER 7: SNAPSHOTS

Chapter 8:Testing

Testing is the process of detecting errors. Testing performs a very critical role for quality assurance and for ensuring the reliability of software. The results of testing are used later on during maintenance also.

Psychology of Testing
The aim of testing is often to demonstrate that a program works by showing that it has no errors. The basic purpose of testing phase is to detect the errors that may be present in the program. Hence one should not start testing with the intent of showing that a program works, but the intent should be to show that a program doesnt work. Testing is the process of executing a program with the intent of finding errors.

Testing Objectives
The main objective of testing is to uncover a host of errors, systematically and with minimum effort and time. Stating formally, we can say,

Testing is a process of executing a program with the intent of finding an error. A successful test is one that uncovers an as yet undiscovered error. A good test case is one that has a high probability of finding error, if it exists. The tests are inadequate to detect possibly present errors. The software more or less confirms to the quality and reliable standards.

Levels of Testing
In order to uncover the errors present in different phases we have the concept of levels of testing. The basic levels of testing are as shown below

Client Needs

Acceptance Testing

Requirements

System Testing

Integration Testing Design Unit Testing

Code

System Testing
The philosophy behind testing is to find errors. Test cases are devised with this in mind. A strategy employed for system testing is code testing. Code Testing This strategy examines the logic of the program. To follow this method we developed some test data that resulted in executing every instruction in the program and module i.e. every path is tested. Systems are not designed as entire nor are they tested as single systems. To ensure that the coding is perfect two types of testing is performed or for that matter is performed or that matter is performed or for that matter is performed on all systems.

Types of Testing
Unit Testing Link Testing

Unit Testing:
Unit testing focuses verification effort on the smallest unit of software i.e. the module. Using the detailed design and the process specifications testing is done to uncover errors within the boundary of the module. All modules must be successful in the unit test before the start of the integration testing begins. In this project each service can be thought of a module. There are three basic modules. Giving different sets of inputs has tested each module. When developing the module as well as finishing the development so that each module works without any error. The inputs are validated when accepting from the user. In this application developer tests the programs up as system. Software units in a system are the modules and routines that are assembled and integrated to form a specific function. Unit testing is first done on modules, independent of one another to locate errors. This enables to detect errors. Through these errors resulting from interaction between modules initially avoided.

Link Testing:
Link testing does not test software but rather the integration of each module in system. The primary concern is the compatibility of each module. The Programmer tests where modules are designed with different parameters, length, type etc.

Integration Testing:
After the unit testing we have to perform integration testing. The goal here is to see if modules can be integrated properly, the emphasis being on testing interfaces between modules. This testing activity can be considered as testing the design and hence the emphasis on testing module interactions. In this project integrating all the modules forms the main system. When integrating all the modules I have checked whether the

integration effects working of any of the services by giving different combinations of inputs with which the two services run perfectly before Integration.

System Testing:
Here the entire software system is tested. The reference document for this process is the requirements document, and the goal is to see if software meets its requirements. Here entire VOIP has been tested against requirements of project and it is checked whether all requirements of project have been satisfied or not.

Acceptance Testing
Acceptance Test is performed with realistic data of the client to demonstrate that the software is working satisfactorily. Testing here is focused on external behavior of the system; the internal logic of program is not emphasized. In this project VOIP I have collected some data and tested whether project is working correctly or not. Test cases should be selected so that the largest number of attributes of an equivalence class is exercised at once. The testing phase is an important part of software development. It is the process of finding errors and missing operations and also a complete verification to determine whether the objectives are met and the user requirements are satisfied.

Black Box Testing


This test involves the manual evaluation of the flow from one Module to the other and check accordingly for the process Flow.

Chapter 9: References Herbert schildt (The complete reference java), www.barcodeschool.com, www.aditus.nu/jpgraph/barcodes, www.upccode.net, www.barcodephp.com, www.stratulat.com/blog/barcode.

Vous aimerez peut-être aussi