You are on page 1of 40

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Chapter 1
INTRODUCTION
--------------------------------------------------------------------------------A command prompt is used in a text-based or "command-line"
interface, such as a UNIX terminal or a DOS shell. It is a symbol or series of
characters at the beginning of a line that indicates the system is ready to
receive input. It other words, it prompts the user for a command (hence the
name).
Since a command prompt requires specific input, it is basically useless
if you don't know the syntax of the command you want to enter. Therefore,
knowledge of some basic commands is required to use a command-line
interface. Fortunately, most operating systems now use a graphical user
interface GUI as their main way of requesting input from the user. This
means you don't have to learn any special commands in order to use the
computer. However, learning to use a command-line interface is kind of like
learning to drive a car with a manual transmission. You never know when it
might come in handy.
1.1 What is a command prompt or Terminal?
A command prompt is a non-graphical interface that allows you to
interact with your operating system. At the command prompt, you enter
commands by typing their names followed by options and arguments. Most
modern computers use a graphical user interface (GUI), which allows users
to more intuitively access programs and documents. However, some
programs and commands are still only available only through a command

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 1

MULTI-PLATFORM BASED VIRTUAL TERMINAL
prompt. To access the command prompt, follow the instructions appropriate
to your operating system.
A user can type commands at the command prompt, such as cd /,
which means "change directory to the root folder." The "cd" command
allows the user to browse through different directories of files on a hard disk
or network. There are dozens of other commands that a user can type, which
can be used to list, move, delete, and copy files, run programs, or perform
other operations. While the "cd" command is the same in both DOS and
UNIX, many other commands have different syntax.
1.2 Windows Command Prompt :To access the command prompt in Windows, in Windows 7, click the
Start button and enter cmd. In other versions, from the Start menu, select
Run... and then enter cmd. The command prompt is often preceded by the
current directory of the system the user is working with. For example, the
default prompt in DOS may be C:\, which indicates the user is working at
the root level of the main C: drive.
Command Prompt is officially called Windows Command Processor
but is also sometimes called the command shell or by its file name cmd.exe.
Command Prompt is sometimes incorrectly referred to as "the DOS prompt"
or as MS-DOS itself. Command Prompt is a Windows program that
emulates many of the command line abilities available in MS-DOS but it is
not actually MS-DOS. Command Prompt is most commonly used to execute
batch files, perform advanced administrative functions, and troubleshoot and
solve certain kinds of Windows issues.
1.3 Unix terminal :DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 2

MULTI-PLATFORM BASED VIRTUAL TERMINAL
When you log into a UNIX computer, your shell begins to run and
provides you with a command prompt. The command prompt's appearance
varies depending on the shell you're using. In UNIX, the prompt may be ~
user$, where "user" is the name of the current user. The tilde (~) indicates
the current directory is the user's home folder.
Every user has a unique username. When they logon to the system,
they are placed in a HOME directory, which is a portion of the disk space
reserved just for them. When you log onto a UNIX system, your main
interface to the system is called the UNIX SHELL. This is the program that
presents you with the dollar sign ($) prompt. This prompt means that the
shell is ready to accept your typed commands. There is more than one
variety of shell that can be used on a UNIX system. one of the most standard
UNIX shells called the Bourne Shell. Other shells such as the Korn Shell or
Bourne Again Shell work very similarly at this level. They all use the dollar
sign as their prompt.
UNIX commands are strings of characters typed in at the keyboard.
To run a command, you just type it in at the keyboard and press the ENTER
key. We will look at several of the most common commands below. UNIX
extends the power of commands by using special flags or switches. These
switches are one of the most powerful features of UNIX commands.
Switches are usually preceded with a dash (-) and precede any filenames or
other arguments on the command line.
1.4 Comparison between Windows and UNIX commands :There are many commands which are use for same task but have different
syntax in different operating systems. Their comparison is as follows:

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 3

MULTI-PLATFORM BASED VIRTUAL TERMINAL
 In windows, the command for listing files directory is dir while in
Unix, command for same task is ls.
 In windows, the command for clearing the screen is cls while in Unix,
command for same task is clear.
 In windows, the command for copying a file is Copy while in Unix,
command for same task is cp.
 In windows, the command for removing a file Del while in Unix,
command for same task is rm.
 In windows, the command for moving a file Move while in Unix,
command for same task is mv.
 Windows or DOS commands are not case sensitive, UNIX systems
are case sensitive (upper and lower case characters are considered
different). Nearly all command names and most of their command line
switches will be in lowercase.
1.5 Difficulty :The main difficulty is, as all operating system such as Unix, windows
has their own commands. Therefore, the new user fined it difficult to work
on these command prompt or terminal.
To resolve this difficulty, new application is created called ‘MultiPlatform based Virtual terminal.’ In this terminal, the commands used are
common for all platforms such as windows, Unix, etc.
1.6 Multi-platform based Virtual Terminal :This terminal works as the virtual command prompt on multiple
platforms. It is platform independent. It recovers disadvantages of terminal.
In this we create user define commands. Same command can be execute on
all platform. It also has a built in editor which lets you write files.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 4

MULTI-PLATFORM BASED VIRTUAL TERMINAL
It is written in Java, So, java must be installed in system i.e. machine
has to be a Java Virtual Machine (JVM).
1.6.1 Features of Virtual Terminal :1. It supports multiple entries of filenames & website names under a single
command, all these entries are then processed sequentially.
2. It also has a built in editor which lets you write files:
a) Type "edit" at the command-line.
b) Write whatever you want to write.
c) Type "save example" where, "example" is the name of the file you
have

written.

d) Type "exit" at command-line to exit from the editor mode and go
back to

command mode of “Virtual Terminal"

e) To edit an existing file type "edit hello.txt" where, "hello.txt" is the
existing file you want to edit.
3. A directory cannot delete with files inside it. the files inside have to be
deleted, then delete the directory.
4. It supports "command-line surfing". It’s just like as of "doskey" in DOS.
You can easily switch between your previous commands using the UP arrow
& DOWN arrow keys.
5. It supports multiple video modes (like orange text on black background
etc.).
6. It can run any number of programs with a single 'command-line'
command e.g. "run calc write mplayer" will start the programs "calc",
"write" & "mplayer" simultaneously.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 5

MULTI-PLATFORM BASED VIRTUAL TERMINAL
7. It cannot access any other partition or drive directly from the commandline. If the Terminal.class file is in your drive C:\, then only C drive can be
accessed.

Chapter2
SOFTWARE ENGINEERING PARADIGM
----------------------------------------------------------------------------------------------------------Every project has its own methodology. Various methodology models
such as waterfall, incremental, prototyping, spiral etc. The model suitable for
our project is waterfall model.
2.1 Phases of Project :This section explains the various phases of the project. The software
model followed for implementing this project is waterfall model.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 6

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig 2.1 Waterfall Model

This project consists of following phases:*

Requirements

*

Analysis

*

Design

*

Implementation

*

Testing

2.1.1 Requirements Phase :In this phase, all the requirements of the project will be gathered
based on which the problem will be analyzed. We will try to understand the
specific requirements that must be achieved to implement this project. At the
end of this phase, we will have detailed understanding of the nature of
application to be developed by identifying the problem and specify refined
preliminary set of proposed solution.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 7

MULTI-PLATFORM BASED VIRTUAL TERMINAL
This phase will state following points in detail
*

Problem definition

*

Need for building this application

*

Requirement Specification

*

Scope of the Project.

*

Deliverables of the Project.

2.1.1.1 Requirement specification :In the context of computer-based systems (and software), the term
specification means different things to different people, a specification can
be written document, a graphical model, a formal mathematical model, and a
collection of usage of scenarios, prototype or any combination of these. The
System specification is the final work product produced by the system and
requirements engineer. It serves as the foundation for the hardware
engineering, software engineering, database engineering and human
engineering. It describes the function and performance of a computer-based
system and the constrained that will govern its development. The
specification also describes the information that is input to and output from
the system.
2.1.1.2 Hardware requirements :These are the minimum requirements of the computer setup for the
product developed to run, giving satisfactory results. Any faster machine
would certainly improve the performance and speed.
1. Pentium III 700 MHz (2)
2. 64 MB Ram
3. 2 GB Hard Disk space.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 8

MULTI-PLATFORM BASED VIRTUAL TERMINAL
2.1.1.3 Software requirements :These are the requirement for the well functioning of the software. any
upgraded versions of the software will also works.
1)

JDK 1.6.0 or above.

2.1.2 Analysis Phase :This phase analyzes the various aspects of the project. In this phase,
the architecture of the project will be designed and designed and decisions
regarding problem evaluation will be taken. The basic modules in which the
project will be divided will be taken. The technology decision for
implementing the project is taken in this phase.
2.2 Design :In this phase, we will come out with various UML diagrams, which
explain the design of the project. The database designing will be done
keeping in view the performance issues. All the data structures and
interfaces required would be designed as per the specifications mentioned in
Requirements phase.
2.3 Implementation :In this phase, we will decide the coding strategy that will be employed
to implements this Project. Based on the decided strategy, we will implement
the project using the technologies decided in analysis phase. The modules
will be implemented as per the design. The functionality of each unit will be
tested during this phase.
2.4 Testing :In this phase, various testing strategies like Unit Testing, Integration
Testing, Validation Testing and system Testing will be carried out for various

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 9

MULTI-PLATFORM BASED VIRTUAL TERMINAL
test cases. All the modules will be tested for specific test and all the errors
uncovered will be fixed.
2.5 Technology Used :- JAVA
A programming tool or software tool is a program or application that
software developers use to create, debug, maintain, or otherwise support
other programs and applications. The term usually refers to relatively simple
programs that can be combined together to accomplish a task. The Chapter
describes about the software tool that is used in our project.
2.5.1 What Is Java?
Java is a computer programming language. It enables programmers to
write computer instructions using English based commands, instead of
having to write in numeric codes. It’s known as a “high-level” language
because it can be read and written easily by humans. Like English, Java has
a set of rules that determine how the instructions are written. These rules are
known as its “syntax”. Once a program has been written, the high-level
instructions are translated into numeric codes that computers can understand
and execute.
2.5.2 Why Choose Java?
Java was designed with a few key principles in mind:
 Easy to Use: The fundamentals of Java came from a programming
language called c++. Although c++ is a powerful language, it was felt
to be too complex in its syntax, and inadequate for all of Java's
requirements. Java built on, and improved the ideas of c++, to provide
a programming language that was powerful and simple to use.
 Reliability: Java needed to reduce the likelihood of fatal errors from
programmer

mistakes.

With

this

in

mind,

object-oriented

programming was introduced. Once data and its manipulation were
packaged together in one place, it increased Java’s robustness.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 10

MULTI-PLATFORM BASED VIRTUAL TERMINAL
 Secure: As Java was originally targeting mobile devices that would
be exchanging data over networks, it was built to include a high level
of security. Java is probably the most secure programming language
to date.
 Platform Independent: Programs needed to work regardless of the
machine they were being executed on. Java was written to be a
portable language that doesn't care about the operating system or the
hardware of the computer.
The team at Sun Microsystems was successful in combining these key
principles,

and Java's popularity can be traced to it being a robust,

secure, easy to use, and portable language.
2.5.3 Java is a Platform :Java (with a capital J) is a platform for application development. A
platform is a loosely defined computer industry buzzword that typically
means some combination of hardware and system software that will mostly
run all the same software. For instance PowerMacs running Mac OS 9.2
would be one platform. DEC Alphas running Windows NT would be
another. There's another problem with distributing executable programs
from web pages. Computer programs are very closely tied to the specific
hardware and operating system they run.
A Windows program will not run on a computer that only runs DOS.
A Mac application can't run on a Unix workstation. Java solves the problem
of platform-independence by using byte code. The Java compiler does not
produce native executable code for a particular machine like a C compiler
would. Instead it produces a special format called byte code. Java byte code
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 11

MULTI-PLATFORM BASED VIRTUAL TERMINAL
written in hexadecimal, byte by byte, looks like this: CA FE BA BE 00 03
00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08
This looks a lot like machine language, but unlike machine language
Java byte code is exactly the same on every platform. This byte code
fragment means the same thing on a Solaris workstation as it does on a
Macintosh PowerBook. Java programs that have been compiled into byte
code still need an interpreter to execute them on any given platform. The
interpreter reads the byte code and translates it into the native language of
the host machine on the fly. The most common such interpreter is Sun's
program java (with a little j). Since the byte code is completely platform
independent, only the interpreter and a few native libraries need to be ported
to get Java to run on a new computer or operating system. The rest of the
runtime environment including the compiler and most of the class libraries
are written in Java. All these pieces, the javac compiler, the java interpreter,
the Java programming language, and more are collectively referred to as
Java.
2.5.4 Java is Simple :Java was designed to make it much easier to write bug free code.
According to Sun's Bill Joy, shipping C code has, on average, one bug per
55 lines of code. The most important part of helping programmers write
bug-free code is keeping the language simple. Java has the bare bones
functionality needed to implement its rich feature set. It does not add lots of
syntactic sugar or unnecessary features. Despite its simplicity Java has
considerably more functionality than C, primarily because of the large class
library. Because Java is simple, it is easy to read and write. Obfuscated Java
isn't nearly as common as obfuscated C. There aren't a lot of special cases or

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 12

MULTI-PLATFORM BASED VIRTUAL TERMINAL
tricks that will confuse beginners. About half of the bugs in C and C++
programs are related to memory allocation and deallocation.
2.5.5 Java is Platform Independent :Java was designed to not only be cross-platform in source form like
C, but also in compiled binary form. Since this is frankly impossible across
processor architectures Java is compiled to an intermediate form called bytecode. A Java program never really executes natively on the host machine.
Rather a special native program called the Java interpreter reads the byte
code and executes the corresponding native machine instructions. Thus to
port Java programs to a new platform all that is needed is to port the
interpreter and some of the library routines. Even the compiler is written in
Java. The byte codes are precisely defined, and remain the same on all
platforms. The second important part of making Java cross-platform is the
elimination of undefined or architecture dependent constructs. Integers are
always four bytes long, and floating point variables follow the IEEE 754
standard for computer arithmetic exactly.
2.5.6 Java is Multi-Threaded :Java is inherently multi-threaded. A single Java program can have
many different threads executing independently and continuously. Three
Java applets on the same page can run together with each getting equal time
from the CPU with very little extra effort on the part of the programmer.
This makes Java very responsive to user input. It also helps to contribute to
Java's robustness and provides a mechanism whereby the Java environment
can ensure that a malicious applet doesn't steal all of the host's CPU cycles.
Unfortunately multithreading is so tightly integrated with Java, that it makes
Java rather difficult to port to architectures like Windows 3.1 or the
PowerMac that don't natively support preemptive multi-threading.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 13

MULTI-PLATFORM BASED VIRTUAL TERMINAL

2.6 The Architecture of the Java Virtual Machine :In the Java virtual machine specification, the behavior of a virtual
machine instance is described in terms of subsystems, memory areas, data
types, and instructions. These components describe an abstract inner
architecture for the abstract Java virtual machine. The purpose of these
components is not so much to dictate an inner architecture for
implementations. It is more to provide a way to strictly define the external
behavior of implementations. The specification defines the required
behavior of any Java virtual machine implementation in terms of these
abstract components and their interactions.
Figure 2.2 shows a block diagram of the Java virtual machine that
includes the major subsystems and memory areas described in the
specification. As mentioned in previous chapters, each Java virtual machine
has a class loader subsystem: a mechanism for loading types given fully
qualified names. Each Java virtual machine also has an execution engine: a
mechanism responsible for executing the instructions contained in the
methods of loaded classes. When a Java virtual machine runs a program, it
needs memory to store many things, including byte codes and other
information it extracts from loaded class files, objects the program
instantiates, parameters to methods, return values, local variables, and
intermediate results of computations.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 14

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig. 2.2. The internal architecture of the Java virtual machine.

The Java virtual machine organizes the memory it needs to execute a
program into several runtime data areas. Although the same runtime data
areas exist in some form in every Java virtual machine implementation, their
specification is quite abstract. Many decisions about the structural details of
the runtime data areas are left to the designers of individual
implementations.
Different implementations of the virtual machine can have very
different memory constraints. Some implementations may have a lot of
memory in which to work, others may have very little. Some
implementations may be able to take advantage of virtual memory, others
may not.
Some runtime data areas are shared among all of an application's
threads and others are unique to individual threads. Each instance of the
Java virtual machine has one method area and one heap. These areas are
shared by all threads running inside the virtual machine. When the virtual
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 15

MULTI-PLATFORM BASED VIRTUAL TERMINAL
machine loads a class file, it parses information about a type from the binary
data contained in the class file. It places this type information into the
method area. As the program runs, the virtual machine places all objects the
program instantiates onto the heap.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 16

MULTI-PLATFORM BASED VIRTUAL TERMINAL
Chapter 3
DESIGN DETAILS
----------------------------------------------------------------------------------------------------------This software has written in JAVA as frontend. As java is platform
independent. Following are details for java
3.1 JAVA :3.1.1 The Creation of Java :Java was conceived by James Gosling, Patrick Naughton, Chris
Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. It
took 18 months to develop the first working version. This language was
initially called “Oak” but was renamed “Java” in 1995. Between the initial
implementation of Oak in the fall of 1992 and the public announcement of
Java in the spring of 1995, many more people contributed to the design and
evolution of the language.
Bill Joy, Arthur van Hoff, Jonathan Payne, Frank Yellin, and Tim
Lindholm were key contributors to the maturing of the original prototype.
Somewhat surprisingly, the original impetus for Java was not the Internet!
Instead, the primary motivation was the need for a platform-independent
(that is, architecture-neutral) language that could be used to create software
to be embedded in various consumer electronic devices, such as microwave
ovens and remote controls.
The trouble with C and C++ (and most other languages) is that they
are designed to be compiled for a specific target. Although it is possible to
compile a C++ program for just about any type of CPU, to do so requires a
full C++ compiler targeted for that CPU. The Problem is that compilers are
expensive and time-consuming to create. An easier— and more costefficient—solution was needed. In an attempt to find such a solution,
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 17

MULTI-PLATFORM BASED VIRTUAL TERMINAL
Gosling and others began work on a portable, platform-independent
language that could be used to produce code that would run on a variety of
CPUs under differing environments. This effort ultimately led to the creation
of Java.
3.1.2 The Java Buzzwords :No discussion of the genesis of Java is complete without a look at the
Java buzzwords. Although the fundamental forces that necessitated the
invention of Java are portability and security, other factors also played an
important role in molding the final form of the language. The key
considerations were summed up by the Java team in the following list of
buzzwords:










Simple
Secure
Portable
Object-oriented
Robust
Multithreaded
Architecture-neutral
Interpreted
High performance
Distributed
Dynamic

3.1.3 Event Handling :3.1.3.1 Events :Event is an object that describes a state change in a source. It can be
generated as consequence of a person interacting with the elements in a
graphical user interface. Some of the activities that cause events to be
generated are pressing a button, entering a character via the keyboard,
electing an item in a list, and clicking the mouse.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 18

MULTI-PLATFORM BASED VIRTUAL TERMINAL
3.1.3.2 The KeyListener Interface :This interface defines three methods. The keyPressed( ) and
keyReleased( ) methods are invoked when a key is pressed and released,
respectively. The keyTyped( ) method is invoked when a character has been
entered. For example, if a user presses and releases the A key, three events
are generated in sequence: key pressed, typed, and released. If a user presses
and releases the HOME key, two key events are generated in sequence: key
pressed and released. The general forms of these methods are shown here:
void keyPressed(KeyEvent ke)
void keyReleased(KeyEvent ke)
void keyTyped(KeyEvent ke)
3.2 The Java Class Library :The Java class library provides the set of classes that are guaranteed to
be available in any commercial Java environment. Those classes are in the
Java package and include all the classes .The Java Developer's Kit comes
with documentation for all of the java class library, which includes
descriptions of each class's instance variables, methods, constructors,
interfaces, and so on. You can get to this documentation (called the Java
Application Programmer's Interface, or API) via the web. A shorter summary
of the Java API is in appendix C as well. Exploring the Java class library and
its methods and instance variables is a great way to figure out what java can
and cannot do, as well as how it can become a starting point for your own
development.
Here are the class packages that are part of the Java class library:
 java.lang- Classes that apply to the language itself, including the
Object class, the string class, and the system class. It also contains the
special classes for the primitive types (Integer, character, float, and so

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 19

MULTI-PLATFORM BASED VIRTUAL TERMINAL
on). You will get at least a glance at most of the classes in this
package in this first week.
 java.util– Utility classes, such as Date, as well as simple collection
classes such as vector and Hash table. You'll learn more about these
classes in the Bonus week.
 java.io- Input and output classes for writing to and reading from
streams ( such as standard input and output ) and for handling files,
"Streams and I/O," describes the classes in this package.
 java.net- Classes for networking support, including socket and URL
( a class to represent references to documents on the World Wide
Web) You'll learn a little about networking on "Windows, networking,
and other Tidbits," and then on " Client/Server Networking in Java.
 java.awt- This is the abstract Windowing Toolkit. It contains classes to
implement graphical user interface features, including classes for
Window, Menu, Button, Font, Check Box , and so on It also includes
mechanisms for managing system events and for processing images.
 java.applet- Classes to implement Java applets.
In addition to the Java classes, your development environment may also
include additional classes that provide other utilities or functionality.
Although these classes may be useful, because they are not part of the
standard Java library, they may not be available to other people trying to run
your java program unless you explicitly include those classes with your
program. This is particularly important for applets, because applets are
expected to be able to run on any platform, using any Java - enabled
browser. Only classes inside the Java package are guaranteed to be available
on all browsers and Java environments.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 20

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig. 3.1 Applet Hierarchy

3.3 Window Fundamentals :The AWT defines windows according to a class hierarchy that adds
functionality and specificity with each level. The two most common
windows are those derived from Panel, which is used by applets, and those
derived from Frame, which creates a standard window. Much of the
functionality of these windows is derived from their parent classes. Thus, a
description of the class hierarchies relating to these two classes is
fundamental to their understanding. Figure 3.1 shows the class hierarchy for
Panel and Frame.
3.3.1 Component :At the top of the AWT hierarchy is the Component class. Component
is an abstract class that encapsulates all of the attributes of a visual
component. All user interface elements that are displayed on the screen and
that interact with the user are subclasses of Component. It defines over a
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 21

MULTI-PLATFORM BASED VIRTUAL TERMINAL
hundred public methods that are responsible for managing events, such as
mouse and keyboard input, positioning and sizing the window, and
repainting.
A Component object is responsible for remembering the current
foreground and background colors and the currently selected text font. Class
Description ScrollPane a container that provides horizontal and/or vertical
scroll bars for another component. System Color contains the colors of GUI
widgets such as windows, scroll bars, text, and others. TextArea Creates a
multiline edit control. TextComponent A superclass for TextArea and
TextField. TextField Creates a single-line edit control. Toolkit abstract class
implemented by the AWT. Window Creates a window with no frame, no
menu bar, and no title.
3.3.2 Container :The Container class is a subclass of Component. It has additional
methods that allow other Component objects to be nested within it. Other
Container objects can be stored inside of a Container. This makes for a
multileveled containment system. A container is responsible for laying out
any components that it contains. It does this through the use of various
layout managers.
3.3.3 Panel :The Panel class is a concrete subclass of Container. It doesn’t add any
new methods; it simply implements Container. A Panel may be thought of as
a recursively nestable, concrete screen component. Panel is the super class
for Applet. When screen output is directed to an applet, it is drawn on the
surface of a Panel object. In essence, a Panel is a window that does not
contain a title bar, menu bar, or border. This is why you don’t see these items
when an applet is run inside a browser. When you run an applet using an
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 22

MULTI-PLATFORM BASED VIRTUAL TERMINAL
applet viewer, the applet viewer provides the title and border. Other
components can be added to a Panel object by its add( ) method from. Once
these components have been added, you can position and resize them
manually using the setLocation( ), setSize( ), or setBounds( ) methods
defined by Component.

Fig.3.2The class hierarchy for Panel and Frame

3.3.4 Window :The Window class creates a top-level window. A top-level window is
not contained within any other object; it sits directly on the desktop.
Generally, you won’t create Window objects directly. Instead, you will use a
subclass of Window called Frame, described next.
3.3.5 Frame :Frame encapsulates what is commonly thought of as a “window.” It is
a subclass of Window and has a title bar, menu bar, borders, and resizing
corners. If you create a Frame object from within an applet, it will contain a
warning message, such as “Java Applet Window,” to the user that an applet
window has been created. This message warns users that the window they
see was started by an applet and not by software running on their computer.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 23

MULTI-PLATFORM BASED VIRTUAL TERMINAL
When a Frame window is created by a program rather than an applet, a
normal window is created.
Chapter 4
IMPLEMENTATION
----------------------------------------------------------------------------------------------------------The virtual terminal is a window created using awt and applet class.
The window is divided in two panels. The above panel is used to display the
actual command operations while the below panel is used for inserting
commands.
4.1 Source code :4.1.1 Appearance on Multi-Platform :-

Fig. 4.2 Terminal on Windows Platform

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 24

MULTI-PLATFORM BASED VIRTUAL TERMINAL
The above fig shows the general appearance of the virtual terminal on

Windows platform. As there is no directory hierarchy on windows systems,
the execution starts from drive.

Fig4.2 Terminal on Unix Platform

The above figure shows the general appearance of the virtual terminal
on Linux platform. As there is directory hierarchy on linux systems, the
execution starts from root folder. Thus, the terminal considers the home
folder as its root folder as shown above.
4.1.2 IP :The below figure shows the working of ip command. Ip command is
used to retrieve the information of particular website. Ip command retrieves
the ip addresses of the websites.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 25

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig.4.3 IP Command
4.1.3 URLINFO :-

Fig.4.4 URLINFO command

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 26

MULTI-PLATFORM BASED VIRTUAL TERMINAL
The above figure shows use of urlinfo command. This shows
information of website about the date it is used and text type it have and the
date it lastly modified. This command requires internet connection.
4.1.4 RUN :-

Fig.4. 5 RUN command

The above figure shows working of Run command. Run command
executes the applications such as calculator, notepad, paint, etc. Run
command is use to open application using command prompt. This command
can open multiple application in one command. All application can
simultaneously
4.1.5 DATE :-

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 27

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig.4.6 DATE Command

The above figure shows working of Date command. Date command
displays day, date and time of your system.
4.1.6 DIR :-

Fig.4.7 DIR Command
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 28

MULTI-PLATFORM BASED VIRTUAL TERMINAL
The above figure shows working of Dir command. Dir command is
used to list the files in particular folder or directory. It also shows the total
number of files in that directory.
4.1.7 CD and CD.. :The below figure shows working of cd and cd.. command. This
commands are use to change directory. Cd command is used to enter into a
specified directory. Cd.. is used to exit from a present directory.

Fig. 4.8 CD & CD.. Command

4.1.8 SHOW :The below figure shows working of show command. When a file is
created in edit mode, it should be saved by a specific name. To view the
contents of a particular file show command is used.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 29

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig. 4.9 SHOW Command

4.1.9 COPY :The below figure shows working of copy command. When the
contents of one file are to be copied into other file, the copy command is
used. We can copy contents of one file into one or more files simultaneously.

Fig.4.10 COPY Command

4.1.10 Osinfo :DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 30

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Fig.4.11 OSINFO in Linux

The Osinfo command displays the information about the operating
system in which it is running. The above figure shows the osinfo of the linux
operating system. It displays the name, architecture, version, registration.
4.2 List of Commands :There are some more commands which can be executed on the
terminal. The list of those commands is mentioned in the table given below:

COMMAND
Ip
Run
Date
Cls
Cd
Copy

MEANING
Internet Protocol
Run Program
Shows date
Clears Screen
Changes directory
Copy files

SYNTAX or EXAMPLE
ip yahoo.com hotmail.com
run calc notepad word prog
Date
Cls
cd Programs
copy readme.txt
newreadme.txt

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 31

MULTI-PLATFORM BASED VIRTUAL TERMINAL
Dir
Memcheck
Prompt
Urlinfo

Shows Directory
Checks Memory
Changes prompt sign
Gives URL information

Dir
Memcheck
prompt >>>
urlinfo

Sort
Edit
Find
Kill
Save
Local

Sorts given data
Goes to Edit mode
Finds file
Deletes file
Saves file in edit mode
Shows country Time &

http://www.yahoo.com
sort bad perfect great
edit filename(optional)
find prog.dbm hello.txt
kill file1.txt file2.txt
save file1 file2 file3
Local

Nv
Bv
Ov
Osinfo
Whois

Date
Normal Video
Black Video
Orange Video
OS Information
Gives information of site

Nv
Bv
Ov
Osinfo
whois internic.net

Rename files

dotcom.com
ren oldName.txt

Creates new Directory
Shows file content
Exits from Edit Mode
Shows help information
Quits Terminal / Edit

newName.txt
md newDirectory
show readme.txt
Exit
Help or ?
Quit

Ren
Md
Show
Exit
Help or ?
Quit

mode
Table 4.1 List of commands

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 32

MULTI-PLATFORM BASED VIRTUAL TERMINAL

Chapter-5
TESTING DETAILS
----------------------------------------------------------------------------------------------------------Testing presents an interesting anomaly for the software engineer.
During earlier software engineering activities, the engineer attempts to build
software from an abstract concept to a tangible product. Now comes testing.
The engineer creates a series of test cases that are intended to "demolish" the
software that has been built. In fact, testing is the one step in the software
process that could be viewed as destructive rather than constructive.
Software engineers are by their nature constructive people. Testing
requires that the developer discard preconceived notions of the "correctness"
of software just developed and overcome a conflict of interest that occurs
when errors are uncovered.
5.1 Testing Objectives :1. Testing is a process of executing a program with the intent of finding an
error.
2. A good test case is one that has a high probability of finding an as-yetundiscovered error.
3. A successful test is one that uncovers an as-yet-undiscovered error.
These objectives imply a dramatic change in viewpoint. They move
counter to the commonly held view that a successful test is one in which no
errors are found. Our objective is to design tests that systematically uncover
different classes of errors and to do so with a minimum amount of time and
effort.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 33

MULTI-PLATFORM BASED VIRTUAL TERMINAL
5.2 Test Case Design :Any engineered product can be tested in one of two ways:
 Knowing specified function that a product has been designed to
perform, tests can be conducted that demonstrate each function is
fully operational while at the same time searching for errors in each
function;
 Knowing the internal workings of a product, tests can be conducted to
ensure that "all gears mesh," that is, internal operations are performed
according to specifications and all internal components have been
adequately exercised. The first test approach is called black-box
testing and the second, white-box testing.
When computer software is considered, black-box testing alludes to
tests that are conducted at the software interface. Although they are designed
to uncover errors, black-box tests are used to demonstrate that software
functions are operational, that input is properly accepted and output is
correctly produced.
5.3 White-Box Testing :White-box testing, sometimes called glass-box testing, is a test case
design method that uses the control structure of the procedural design to
derive test cases. Using white-box testing methods, the software engineer
can derive test cases that
 guarantee that all independent paths within a module have been
exercised at least once
 exercise all logical decisions on their true and false sides

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 34

MULTI-PLATFORM BASED VIRTUAL TERMINAL
 execute all loops at their boundaries and within their operational
bounds
 exercise internal data structures to ensure their validity.
Why don't we spend all of our energy on black-box tests? The answer
lies in the nature of software defects. Logic errors and incorrect assumptions
are inversely proportional to the probability that a program path will be
executed. Errors tend to creep into our work when we design and implement
function, conditions, or controls that are out of the mainstream. Everyday
processing tends to be well understood, while "special case" processing
tends to fall into the cracks.
We often believe that a logical path is not likely to be executed when,
in fact, it may be executed on a regular basis. The logical flow of a program
is some- times counterintuitive, meaning that our unconscious assumptions
about flow of control and data may lead us to make design errors that are
uncovered only once path testing commences.
5.4 Black-Box Testing :Black-box testing, also called behavioral testing, focuses on the
functional requirements of the software. That is, black-box testing enables
the software engineer to derive sets of input conditions that will fully
exercise all functional requirements for a program. Black-box testing is not
an alternative to white-box techniques. Rather, it is a complementary
approach that is likely to uncover a different class of errors than white-box
methods.
Black-box testing attempts to find errors in the following categories
 Incorrect or missing functions
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 35

MULTI-PLATFORM BASED VIRTUAL TERMINAL
 Interface errors
 Errors in data structures or external data base access
 Behavior or performance errors and
 Initialization and termination errors.
5.5 Unit Testing :Unit testing focuses verification effort on the smallest unit of software
design the software component or module. Using the component-level
design description as a guide, important control paths are tested to uncover
errors within the boundary of the module. The relative complexity of tests
and uncovered errors is limited by the constrained scope established for unit
testing. The unit test is white-box oriented, and the step can be conducted in
parallel for multiple components.
5.6 Integration Testing :Integration testing is a systematic technique for constructing the
program structure while at the same time conducting tests to uncover errors
associated with inter- facing. The objective is to take unit tested components
and build a program structure that has been dictated by design.
5.6.1 Acceptance Testing :It is virtually impossible for a software developer to foresee how the
customer will really use a program. Instructions for use may be
misinterpreted; strange combinations of data may be regularly used; output
that seemed clear to the tester may be unintelligible to a user in the field.
When custom software is built for one customer, a series of
acceptance tests are conducted to enable the customer to validate all
requirements. Conducted by the end- user rather than software engineers, an
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 36

MULTI-PLATFORM BASED VIRTUAL TERMINAL
acceptance test can range from an informal "test drive" to a planned and
systematically executed series of tests.
In fact, acceptance testing can be conducted over a period of weeks or
months, thereby uncovering cumulative errors that might degrade the system
over time. If software is developed as a product to be used by many
customers, it is impractical to perform formal acceptance tests with each
one. Most software product builders use a process called alpha and beta
testing to uncover errors that only the end-user seems able to find.
5.7 Design Concepts :Design is a meaningful engineering representation of something that
is to be built. It can be traced to a customer’s requirements and at the same
time assessed for quality against a set of predefined criteria for “good”
design. In the software engineering context, design focuses on four major
areas of concern: data, architecture, interfaces, and components.
5.7.1 Why is it important?
You wouldn’t attempt to build a house without a blueprint, would
you? You’d risk confusion, errors, a floor plan that didn’t make sense,
windows and doors in the wrong place a mess. Computer software is
considerably more complex than a house; hence, we need a blue print the
design.
5.7.2 What is the steps?
Design begins with the requirements model. We work to transform
this model into four levels of design detail: the data structure, the system
architecture, the interface representation, and the component level detail.
During each design activity, we apply basic concepts and principles that lead
to high quality.
DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 37

MULTI-PLATFORM BASED VIRTUAL TERMINAL
5.8 The Design Process :Software design is an iterative process through which requirements
are translated into a “blueprint” for constructing the software. Initially, the
blueprint depicts a holistic view of software. That is, the design is
represented at a high level of abstraction a level that can be directly traced to
the specific system objective and more detailed data, functional, and
behavioral requirements. As design iterations occur, subsequent refinement
leads to design representations at much lower levels of abstraction.
Three characteristics that serve as a guide for the evaluation of a good
design:
The design must implement all of the explicit requirements contained in the
analysis model, and it must accommodate all of the implicit requirements
desired by the customer. The design must be a readable, understandable
guide for those who generate code and for those who test and subsequently
support the software.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 38

MULTI-PLATFORM BASED VIRTUAL TERMINAL
CONCLUSION
----------------------------------------------------------------------------------------------------------Thus, we implemented project on “Multi-platform based Virtual
Terminal”. The project consists of one window which has two panels. This
can be dynamically installed on any operating system. It has its own inbuilt
commands which are same for all operating system and can be run manually.
From two panels, the above panel show output or operation of
commands and as in second panel accept the commands.
This project provides multi-platform facility which avoids confusion
of user for using different commands. As user has to remember different
commands used in different operating system this difficulty can be avoided
by this multi-platform virtual terminal. The default command prompts are
statically installed in operating system. This terminal can be installed
dynamically and can be used virtually.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 39

MULTI-PLATFORM BASED VIRTUAL TERMINAL
REFERENCES
-----------------------------------------------------------------------------------------------------[1] “Complete Reference Java”, By H. Shields.
[2] “The Linux Command Line”, William E. Shotts.
[3] “Windows command line reference”, by Microsoft.
[4] “Software Engineering” by Roger S. Pressman.

DEPT. OF COMPUTER SCIENCE AND ENGG.

Page 40