Local Variables

A local variable in Java is a variable that’s declared within the body of a method. Then you can use the variable only within that method. Other methods in the class aren’t even aware that the variable exists.

Here’s a program that uses a local variable:

public class HelloApp
{
    public static void main(String[] args)
    {
        String helloMessage;
        helloMessage = "Hello, World!";
        System.out.println(helloMessage);
    }
}

You don’t specify static on a declaration for a local variable. If you do, the compiler generates an error message and refuses to compile your program.

Unlike class and instance variables, a local variable is fussy about where you position the declaration for it: You must place the declaration before the first statement that actually uses the variable.

You may also declare local variables within blocks of code marked by braces. For example:

if (taxRate > 0)
{
    double taxAmount;
    taxAmount = subTotal * taxRate;
    total = subTotal + total;
}

Local variables are not given initial default values. Thus, you must assign a value before you use a local variable.

One way to initialize a variable is to code an assignment statement following the variable declaration. Assignment statements have this general form:

variable = expression;

Here, the expression can be any Java expression that yields a value of the same type as the variable. For example, here’s a method that declares a local variable named i, and then initializes the variable before using it:

    public static void main(String[] args)
    {
        int i;
        i = 0;
        System.out.println("i is " + i);
    }

Another way to initialize a variable is to use an initializer, which lets you assign an initial value to a variable at the time you declare the variable. Here’s the general form:

type name = expression;

Here are some examples:

int x = 0;
String lastName = "Lowe";
double radius = 15.4;

In each case, the variable is declared and initialized in a single statement.

When you declare more than one variable in a single statement, each variable can have its own initializer:

int x = 5, y = 10;

When you declare two class or instance variables in a single statement but use only one initializer, the initializer applies only to the last variable in the list. For example:

static int x, y = 5;

Here, only y is initialized.

Regression Testing

Regression testing a black box testing technique that consists of re-executing those tests that are impacted by the code changes. These tests should be executed as often as possible throughout the software development life cycle.

Types of Regression Tests:

Final Regression Tests: - A "final regression testing" is performed to validate the build that hasn't changed for a period of time. This build is deployed or shipped to customers.

Regression Tests: - A normal regression testing is performed to verify if the build has NOT broken any other parts of the application by the recent code changes for defect fixing or for enhancement.

Selecting Regression Tests:

- Requires knowledge about the system and how it affects by the existing functionalities.
- Tests are selected based on the area of frequent defects.
- Tests are selected to include the area, which has undergone code changes many a times.
- Tests are selected based on the criticality of the features.

Regression Testing Steps:

Regression tests are the ideal cases of automation which results in better Return On Investment (ROI).

- Select the Tests for Regression.
- Choose the apt tool and automate the Regression Tests
- Verify applications with Checkpoints
- Manage Regression Tests/update when required
- Schedule the tests
- Integrate with the builds
- Analyze the results

Recovery Testing

In software testing, recovery testing is the activity of testing how well an application is able to recover from crashes, hardware failures and other similar problems.

Recovery testing is the forced failure of the software in a variety of ways to verify that recovery is properly performed. Recovery testing should not be confused with reliability testing, which tries to discover the specific point at which failure occurs.

Examples of recovery testing:

1. While an application is running, suddenly restart the computer, and afterwards check the validness of the application's data integrity.
2. While an application is receiving data from a network, unplug the connecting cable. After some time, plug the cable back in and analyze the application's ability to continue receiving data from the point at which the network connection disappeared.
3. Restart the system while a browser has a definite number of sessions. Afterwards, check that the browser is able to recover all of them.

Source: http://en.wikipedia.org/wiki/Recovery_testing

Usage

- Recovery is ability to restart the operation after integrity of application is lost.
- It includes reverting to a point where integrity of system is known , then reprocessing up until the point of failure.
- The time taken to recover depends upon :
1. the number of restart points
2. volume of application
3. training and skill of people conducting recovery activities
4. tools available for recovery

Objectives

- To ensure operations can be continued after a disaster .
- Recovery testing verifies recovery process and effectiveness of recovery process.
- Adequate back up data is preserved and kept in secure location.
- Recovery procedures are documented.
- Recovery personnel have been assigned and trained.
- Recovery tools have been developed and are available.

How to Use

- Procedures , methods , tools and techniques are assessed to evaluate the adequacy.
- After system is developed a failure can be introduced in the system and check whether the system can recover.
- A simulated disaster is usually performed on one aspect of application system.
- When there are no. Of failures then instead of taking care of all recovery testing should be carried out for one segment and then another i.e. structured fashion.

Who uses it

- System Analysts
- Testing professionals
- Management personnel.

When to use

- When user says that the continuity of the system is needed inorder for system to perform or function properly.
- User then should estimate the losses, time span to carry out recovery testing.

Examples

- Loss of communication , loss of database integrity.
- Evaluate adequacy of back up data.

Test Environment

Test Environment is a required Hardware and Software Technologies to conduct testing

Software Technologies: Operating Systems, Browsers and Softwares
Hardware Technologies: Computer Machine and Computer Peripherals

Compatibility Testing is  performed to verify whether a software is compatible with all other supported software and hardware. This is also know as Configuration Testing.

1. Operating Systems:

An operating system (OS) is software, consisting of programs and data, that runs on computers and manages computer hardware resources and provides common services for efficient execution of various application software.

The three most used Operating Systems in Software Testing are:
Microsoft Windows Opearting Systems
Linux Operating Systems
Mac Operating Systems
Question: What is the reason for more usage of the above Operating Systems in Testing?

Answer: Huge Market ( i.e. Most Users in the world use the above three Operating Systems)

?2.  Browsers:

A web browser is a software application used to browse URLs posted on the World Wide Web. It acts as an interface between the Internet User and World Wide Web.

Most Used Browsers in Testing:
Priority1: Internet Explorer 8.0 & 7.0
Priority2: Moziall Fire Fox Latest Version
Priority3: Google Chrome Latest Version
Priority4: Safari Latest Version
 Less Used Browsers in Testing:
Netscape Latest Version
Opera Latest Version

?3. Softwares:

Pre-requisite softwares: Some softwares (to be tested) requires other pre-requisite software to be installed in the System. So a test environment different by the type of  installed 'pre-requisite software'.

For Example:- A product integrates with Microsoft Office. So inorder to test the product we've to installl Microsoft Office prior to product installation. But we've many versions and service packs in MS Office. So test environment with Office 2003 installed is different from the Test Environment which has Office 2007 installed. Even the Test Environment with MS Office 2003 Service Pack1 is different from the Test Environmnet with MS Office 2003 Service Pack2.

Conclusion: So Test Environments can be classified whith pre-requisite softwares

Other Generally Required Pre-requisite Softwares: .Net 2.0, .Net 3.0, etc..

4. Computer Machines:

Computer Machines also plays a major role in classifying the test environments.

Example:- A Dell Vostro Machine with 4 GB RAM and 2.20 GHz is asked by a Client to check the Performance of a Web Application. But the tester has tested on Dell Inspiron with 3 GB Ram and 2 GHz. So the Performance Results submitted by Tester are wrong due to wrong test machine environment.

In the above example computer machine is changed by three aspects:
Inspiron Model instead of Vostro Model
3 GB Ram used instead of 4GB Ram
2 GHz processor speed used instead of 2.2 GHz
Hence the performance results went wrong due to wrong test environment.

5. Computer Peripherels:

Computer Peripherels are the devices which connect to the Computer.

How does the Computer Peripherels relate to Test Environments?

Answer: I will explian this by an example. You have recently buyed a Sony Ericson Mobile which has all features in it. At the same time your brother/sister also buyed Sony Ericson Mobile which is not your model. Now you two want to buy a software which can be installed in your Computer and can manage all the contacts, songs etc in your mobile phones.

So before you buy this sofware there is a requirement for testing the software to check whether it works for your mobile and at the same time your brother/sisters mobile.

Test Enviroment One: Your Mobile Connect to [ Computer + Buyed Software]
Test Environment Two: Your Sisters Mobile Connected to [Computer + Buyed Software]

So here Your Mobile and Your Sisters Mobile are the different Computer Periphers. We've to test whehter the buyed software works for Different Mobile models [i.e. Different Test Environments]

Test Environments Categorized using Operating Systems:

1. Ownership of Operating Systems:

Ownership: The company which owns the operating system

Most Popular OS Ownerships:
Microsoft
Mac
Linux
Other OS Ownerships List - Click Here

Microsoft:

Current Running Microsoft Operating Systems:
Windows XP OS
Windows Vista OS
Windows 7 OS
Windows Server 2003 OS
Windows Server 2008 OS
Older Microsoft Operating Systems List - Click Here

MAC:

Current Running MAC Operating Systems:
MAC OSX 10.5 (Leapord)
MAC OSX 10.6 (Snow Leapord)
MAC OSX 10.7 (Lion) - Upcomming Version
MAC OSX 10.5 Server (Leapord Server)
MAC OSX 10.6 Server (Snow Leapord Server)
Older MAC Operating Systems List - Click Here
Older MAC Server Operating Systems List - Click Here
Oldest MAC Operating Systems List - Click Here

Linux:

Linux Distribution are Unix like operating systems build on the top of Open Source Linux Kernel.

Most Popular Linux Distributions:
Debian
RPM (Redhat Packet Manager)
Gentoo
Pacman
Slackware
Other Linux Distributions - Click Here

2.  32 bit and 64 bit Operating Systems:

A 64 bit processor handles large amount of RAM (Random Access Memory) than a 32 bit processor. Larget amount of RAM (= and > than 4 GB) is required to identify the beneifits of 64 bit over 32 bit [As 64 bit can handle large amount of Random Access Memory]

32 bit Operating System - An Operating System which works on a 32 bit Processor Machine is called as 32 bit Operating System

64 bit Operating System - An Operating System which works on a 64 bit Processor Machine is called as 64 bit Operating System

Example:-
Windows XP 32 bit Operating System
Windows XP 64 bit Operating System
3. Client Operating Systems and Server Operating Systems:

Client Machine - Makes a service request to the Server Machine
Server Machine - Fulfills the request made by Client Machine

The operating system designed for the Client Type Machine is called as Client Operating System and the operating system designed for the Server Type Machine is called as Server Operating System

Example:-
Windows XP  - Client Operating System
Windows 2003 - Server Operating System
4.  Opeating Systems in Different Languages:

Globalization testing is performed to verify whether the application works in all supported languages

Localization testing is performed to test whether the application works in a particular language

So language of the Operating System plays a major role in classifying the test environments.

Example:- Chinese Windows XP Test Environment is different from English Windows XP Test Environment



 5.  Operating Systems in Different Languages:

Globalization testing is performed to verify whether the application works in all supported languages

Localization testing is performed to test whether the application works in a particular language

So language of the Operating System plays a major role in classifying the test environments.

Example:- Chinese Windows XP Test Environment is different from English Windows XP Test Environment


?6.  GUI of the Operating Systems:

GUI - Graphical User Interface of an Operating System.

All the windows and mac operating system have single GUI. So these environments can't be classified by GUI.

But some of the Linux Distributions have the Flexibility to choose a GUI  from more than one GUI.

Example:- Linux Ubuntu OS
Linux Ubuntu - Gnome GUI(default GUI)
Linux Ubuntu - KDE GUI
Linux Ubuntu - XFCE GUI
The software behaves differently with different GUI. So Linux Ubuntu Gnome GUI Test Environment is different from Linux Ubuntu KDE GUI Test Environment.

7.   Operating Systems with different Service Packs:

Service Packs - Operating System may be released with few issues. Developers release the fixes for this issues as Updates after some duration. These Updates are bundled and released as Service Packs i.e. Service Pack1, Service Pack2 and so on.

Example:
Windows XP Service Pack1
Windows XP Service Pack2
Windows XP Service Pack3
So the Software behaves differently in OS Service Pack1 and OS Service Pack2 environments. As a result Test Enviroments differes by OS Service Packs.

8.  Different Editions of the Operating Systems:

Editions - Different editions of the same operating system are created for different User Types (i.e. Home User, Business User etc)

Example1: Windows XP
Windows XP Home Edition - This edition is designed for Home Users
Windows XP Professional Edition - This edition is designed for Business Professionals
Example2: Windows Vista
Windows Vista Home Basic - This edtion is designed for Home Users. This edition only provides basic needs of a Home User.
Windows Vista Home Premium - This edition is designed for Home Users. This edition provides complete needs of a Home User.
Windows Vista Business - This edition is designed for Business Professionals.
Windows Vista Ultimate - This edition is the combination of Home Premium and Business Editions. This is designed for both Home and Business Users.
Example3: Windows 7
Windows 7 Starter - This edtion is designed for Home Users. This edition contains fewest features.
Windows 7 Home Basic - This edtion is designed for Home Users. This edition only provides basic needs of a Home User.
Windows 7 Home Premium - This edition is designed for Home Users. This edition provides complete needs of a Home User.
Windows 7 Business - This edition is designed for Business Professionals. This edtion can be sold to an individual who owns a small Business.
Windows 7 Enterpirse - This edition is designed for Business Professionals. This edition is sold in with volume of licenses to Organizations by reducing cost.
Windows 7 Ultimate - This edition is the combination of Home Premium and Business Editions. This is designed for both Home and Business Users.
So a software will behave differently in different editions of the same operating system. So the Windows XP Home Edition Test Environment is different from the Windows XP Professional Edtion Test Environment.

9.  Different User Roles of the Operating Systems:

User Roles are nothing but the Operating System Users divided according to the privileges they have.
Admin User - Administrator has full control on the Operating System [Like Installing Softwares, changing OS Settings etc]
Normal User - Normal User has no control on the Operating System [Can't Install or Uninstall Software but can use the Software]
Guest User - Created for the Users having no account on the Operating System. Guest User dont have control on the Operating System [Can't Install or Uninstall Software but can use the Software]
Testing the Software or Product in Admin User Environment is different from the testing in Normal User Environment.

Example1: A Software works sucessfully when Logged in as Admin User but dont work in Normal User.
Example2: On installing the Software by Logging in as Admin User, it gets installed only in Admin User but doesn't install in Normal User.

So we've to test the Software in both Admin, Normal and Guest Environments.

10.  Different Hardware Operating System Editions:

Hardware OS Editions - Operating Systems are designed according to the Harward Devices which are going to use it.

Example:
Desktop Edtion - Windows XP designed for Desktop Computers
Netbook Edtion - Windows XP designed for a Netbook
Tablet PC Edition - Windows XP designed for a Table PC
Mobile Edition - Windows XP designed for a Mobile Phone
So testing a software or web application on Desktop OS Edition Test Environment is different from the Netbook OS Edition Test Environment.

In this ways there will be hundreds of test environments. We've to choose the correct test environment based on the client requirements.

Load Testing

Testing with the intent of determining how well the product handles competition for system resources. The competition may come in the form of network traffic, CPU utilization or memory allocation. In load testing, we increase the number of user to a level i.e. the maximum it can support. We do it by increasing the number of threads in Jmeter.

Installation Testing

Testing with the intent of determining if the product will install on a variety of platforms and how easily it installs.

Beta Testing

In this type of testing, the software is distributed as a beta version to the users and users test the application at their sites. As the users explore the software, in case if any exception/defect occurs that is reported to the developers.

Configuration Testing

Testing to determine how well the product works with a broad range of hardware/peripheral equipment configurations as well as on different operating systems and software.

Compatibility Testing

 Testing used to determine whether other system software components such as browsers, utilities, and competing software will conflict with the software being tested.

Ad Hoc Testing

Testing without a formal test plan or outside of a test plan. With some projects this type of testing is carried out as an adjunct to formal testing. If carried out by a skilled tester, it can often find problems that are not caught in regular testing. Sometimes, if testing occurs very late in the development cycle, this will be the only kind of testing that can be performed. Sometimes ad hoc testing is referred to as exploratory testing.