Subscribe by Email

Sunday, May 25, 2008


BATCH SYSTEMS : They are a set of programs that perform certain activities which do not require any kind of input from the user. Batch systems contain one or more API which perform various tasks.

Ex: When something is typed on a word document by pressing a key, same is displayed on the monitor. The process of conversion of user input of the key to machine language and then displaying what you have typed on monitor is performed by batch system.

EVENT CONTROL SYSTEMS : These systems process real time data to provide the user with results for the command that has been given.

Ex: When you press Ctrl + S, it tells the computer to save the document. This communication is provided by the event controls that are pre-defined in the system.

PROCESS CONTROL SYSTEMS : When two systems communicate, the co-ordination or data transfer becomes vital. Process control systems are the one’s that receive data from a system and instruct the sending system to perform specific tasks based on the reply sent by the receiving system.

PROCEDURE CONTROL SYSTEMS : These systems are one’s which control the functions of another system.

MESSAGE PROCESSING SYSTEMS : A simple example to explain these kind of systems is the SMS management software used by the mobile operator which handles the incoming and outgoing messages.

DIAGNOSTIC SOFTWARE SYSTEMS : These systems help in diagnosing the computer hardware components.
Ex: The “NEW HARDWARE FOUND” dialogue seen when you plug in a new device to the computer is an example of these kind of systems.

SENSOR & SIGNAL PROCESSING SYSTEMS : In these systems the computer receives input in form of signals and then transforms the signals to a user understandable output.

Deadlock - algorithms


Consider an example:

There are four customers: A, B, C and D, which are analogous to four processes.
The credit unit is like the resource
The banker himself is the OS
Assume each credit unit = Rs. 1000.

Not all customers need their maximum credit immediately. Hence only 10 credit units are reserved.
Process Current Max. Free = 10
A 0 6 B 0 5 C 0 4 D 0 7

How does the Algorithm Work?

When a new process (customer) enters the system, it (he) must declare the maximum number of instances of each resource type (credit units) that it (he) may need. This number may not exceed the total number of resources (credit units) in the system. When a user (customer) requests a set of resources (credit unit), the system must determine whether the allocation of these resources will leave the system in a safe state. If it will,
the resources are allocated; otherwise, the process must wait until some other process releases enough resources. Consider current allocation to various processes is as shown below.
Process Current Max. Free = 2
A 1 6 B 1 5 C 2 4 D 4 7
Would the System be in a Safe State?
‘C’ requests 2 additional units and gets them. It then runs to completion and frees all the resources it has.
Process Current Max. Free = 4
A 1 6 B 1 5 C 0 - D 4 7
Now either ‘B’ or ‘D’ can request and run to completion. Assume ‘B’ requests 4 additional units and gets them. It then runs to completion and frees all its resources. Process Current Max. Free = 5
A 1 6 B 0 - C 0 - D 4 7
Now ‘D’ runs and requests 3 additional resources and gets them. It then runs to completion and releases all its resources.Process Current Max. Free = 9
A 1 6 B 0 - C 0 - D 0 -
Finally ‘A’ runs and requests 5 additional resources and gets them. It then runs to completion and releases all its resources. Process Current Max. Free = 10
A 0 - B 0 - C 0 - D 0 -
Here is the complete banker’s algorithm:

Several data structures must be maintained to implement banker’s algorithm. Let n be the number of processes and m be the number of resource types. The data structures needed are:
• Available : A vector of length m indicates number of available resources of each type. If Available[j] = k, there are k instances of resource type Rj available.
• Max : A n*m matrix defines the maximum demand of each process. If Max[i,j]=k, then Pi may request at most k instances of resource type Rj.
• Allocation : An n*m matrix defines the number of resources of each type currently allocated to each process. If Allocation[i,j]=k, then process Pi is currently allocated k instances of resource type rj.
• Need : An n*m matrix indicates the remaining resource need of each process. If Need[i,j]=k, then Pi may need k more instances of resource type Rj to complete its task. Need[i,j]=Max[I,j] – Allocation[I,j].

After defining the data structures, algorithm moves into two phases :
• Safety Algorithm
• Resource Request Algorithm


The safety algorithm is for finding out whether or not a system is in a safe state. It is described below:

1. Let work and finish be vectors of length m and n
respectively. Initialize work = Available and Finish[I] = false for all I = 1, 2, …, n.
2. Find an I such that both
• Finish[I] = false
• Needi <= work
If no such I exists, go to step 4.
3. Work = work + allocationi
finish[I] = true
go to step 2

4. If finish[I] = true for all I, then the system is in a safe state. This algorithm may require an order of m * n2 operations to decide whether a state is safe.


Having determined that the system is safe, this algorithm grants the requested resources to the process. Let Request i be the request vector for process Pi. If Request[j] = k, then process Pi wants k instances of resource type Rj. When this request is made, the following actions are taken:

1. If request I <= need I, then go to step 2. Otherwise raise an error condition because the process has exceeded its maximum claim.
2. If request I <= available, go to step 3. Otherwise, Pi must wait since the resources are not available.
3. Have the system pretend to have allocated the requested resources to process Pi by modifying the state as follows:
a. Available = available – request I
b. Allocation = allocation + request I
c. Need I = Need I – request I
4. Call the Safety algorithm. If the state is safe, then transaction is completed and process Pi is allocated the resources. If the new state is unsafe, then Pi must wait and the old resource allocation state is restored.

Deadlock situation

A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does. In the computing world deadlock refers to a specific condition when two or more processes are each waiting for another to release a resource, or more than two processes are waiting for resources in a circular chain.

Under the normal mode of operation, a process may utilize a resource in the following sequence:

Request – when a process needs some resource, it requests for it. Process has to wait if resource is busy.
Use – The process should operate on the resource.
Release – After using, process should release the resource.

Conditions In Which Deadlock Can Arise

• Hold and Wait : As the name suggests, a process is holding a resource and also waiting for some other resources that are held by other process.
• No Preemption : A resource can be released only voluntarily by the process holding it, after that process has completed the task.
• Mutual Exclusion : It means only one process can use the resource at a time. If some other process requests that resource, the requesting process has to wait until the resource is released.
• Circular Condition : There must exist a state of waiting processes in which process P0 is waiting for a resource that is held by P1, P1 waiting for resource held by P2, Pn-1 waiting for resource held by Pn an Pn is waiting for resource held by P0.

Friday, May 9, 2008

Defect Management

What is a defect?

For a test engineer, a defect is:
• Any deviation from a given specification.
• Anything that causes user dissatisfaction
• Incorrect output
• Software is not behaving the way it should behave.

Difference between bug, defect and error:-
• Software is said to have a bug if the features deviate from the specifications.
• Software is said to have a defect if it is having some unwanted side effects.
• Software is said to have an error if it is giving an incorrect output.


All software defects can be broadly categorized into the below mentioned types:
• Errors of Commission : when something wrong is done.
• Errors of Omission : when something is left out by accident.
• Errors of Clarity & Ambiguity : when there are different interpretations.
• Errors of speed & capacity.
• Conceptual or Design bugs.
• Coding bugs
• Integration bugs.
• User interface errors.
• Functional errors.
• Communication errors.
• Missing commands
• Performance
• Output
• Error handling errors.
• Boundary related errors
• Calculation errors
• Control flow errors.
• Race condition errors.
• Load condition errors.
• Hardware errors.
• Source & Version control errors.
• Documentation errors.
• Testing errors.

Facebook activity