Monday, April 30, 2007

Limitation of Junit

  • Tests that verify the integrity of a small unit are useful but limited. Experience has taught us that most bugs are found in the integration phase. These problems range from two modules that fail to work together, all the way to two separate applications that are acting up. Whether it is two application servers, a client/server environment, or even a peer-to-peer scenario, it is highly important to test these complex scenarios because of the tricky bugs that can be found in them. But it is nearly impossible to do so with JUnit.
  • Although Java is platform-independent, it is wise to check an application on more than one operating system. Your application may work very well on all operating systems, but it may not function exactly the way you expect it to work on some of them. Running the same set of tests over and over again for every OS is time-consuming, and with JUnit you cannot perform distributed tests, so you don't have a way to run the same series of tests simultaneously on several JVMs each running on different OSes.
  • Some units of code can only be tested in a multiple-JVM scenario. For example, testing the opening of a connection (TCP socket or HTTP connection) and the integrity of the information retrieved from it is not possible (or very hard) to test with only one JVM, which is the only option that exists with JUnit.
  • JUnit was designed to have all tests run within a single process within a single class. It is also designed with the constraint that all tests are atomic and independent of any other code outside the test being run and that the lifecycle for these tests are independent for each test. This is all great for testing low level units of code, but not for client/server scenario tests.

Special Shell Script Variables

There are some variables which are set internally by the shell and which are available to the user:

$1 - $9   These variables are the positional parameters.
$0        The name of the command currently being executed.
$#        The number of positional arguments given to this invocation of the shell.
$?        The exit status of the last command executed is given as a decimal string.
When a command completes successfully, it returns the exit status of 0
(zero), otherwise it returns a non-zero exit status.
$$        The process number of this shell - useful for including in filenames, to
make them unique.
$!        The process id of the last command run in the background.
$-        The current options supplied to this invocation of the shell.
$*        A string containing all the arguments to the shell, starting at $1.
$@@       Same as above, except when quoted.


Friday, April 27, 2007

Web Server Vs Application Server

A Web server exclusively handles HTTP requests, whereas an application server serves business logic to application programs through any number of protocols.

The Web server
A Web server handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.

When a request comes into the Web server, the Web server simply passes the request to the program best able to handle it. The Web server doesn't provide any functionality beyond simply providing an environment in which the server-side program can execute and pass back the generated responses. The server-side program usually provides for itself such functions as transaction processing, database connectivity, and messaging.

The application server
As for the application server, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object (or a function in the procedural world).

Such application server clients can include GUIs (graphical user interface) running on a PC, a Web server, or even other application servers. The information traveling back and forth between an application server and its client is not restricted to simple display markup. Instead, the information is program logic. Since the logic takes the form of data and method calls and not static HTML, the client can employ the exposed business logic however it wants.

In most cases, the server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on J2EE (Java 2 Platform, Enterprise Edition) application servers. Moreover, the application server manages its own resources. Such gate-keeping duties include security, transaction processing, resource pooling, and messaging. Like a Web server, an application server may also employ various scalability and fault-tolerance techniques.

An example
As an example, consider an online store that provides real-time pricing and availability information. Most likely, the site will provide a form with which you can choose a product. When you submit your query, the site performs a lookup and returns the results embedded within an HTML page. The site may implement this functionality in numerous ways. I'll show you one scenario that doesn't use an application server and another that does. Seeing how these scenarios differ will help you to see the application server's function.

Scenario 1: Web server without an application server
In the first scenario, a Web server alone provides the online store's functionality. The Web server takes your request, then passes it to a server-side program able to handle the request. The server-side program looks up the pricing information from a database or a flat file. Once retrieved, the server-side program uses the information to formulate the HTML response, then the Web server sends it back to your Web browser.

To summarize, a Web server simply processes HTTP requests by responding with HTML pages.


Scenario 2: Web server with an application server
Scenario 2 resembles Scenario 1 in that the Web server still delegates the response generation to a script. However, you can now put the business logic for the pricing lookup onto an application server. With that change, instead of the script knowing how to look up the data and formulate a response, the script can simply call the application server's lookup service. The script can then use the service's result when the script generates its HTML response.

In this scenario, the application server serves the business logic for looking up a product's pricing information. That functionality doesn't say anything about display or how the client must use the information. Instead, the client and application server send data back and forth. When a client calls the application server's lookup service, the service simply looks up the information and returns it to the client.

By separating the pricing logic from the HTML response-generating code, the pricing logic becomes far more reusable between applications. A second client, such as a cash register, could also call the same service as a clerk checks out a customer. In contrast, in Scenario 1 the pricing lookup service is not reusable because the information is embedded within the HTML page. To summarize, in Scenario 2's model, the Web server handles HTTP requests by replying with an HTML page while the application server serves application logic by processing pricing and availability requests.

Caveats
Recently, XML Web services have blurred the line between application servers and Web servers. By passing an XML payload to a Web server, the Web server can now process the data and respond much as application servers have in the past.

Additionally, most application servers also contain a Web server, meaning you can consider a Web server a subset of an application server. While application servers contain Web server functionality, developers rarely deploy application servers in that capacity. Instead, when needed, they often deploy standalone Web servers in tandem with application servers. Such a separation of functionality aids performance (simple Web requests won't impact application server performance), deployment configuration (dedicated Web servers, clustering, and so on), and allows for best-of-breed product selection.

Thursday, April 26, 2007

Testing Links

http://googletesting.blogspot.com/

http://linuxpoison.wordpress.com/2007/03/12/software-testing-faq/

http://softwaretestingguide.blogspot.com/

http://quality-assurance-software-testing.blogspot.com/

http://techiecorner.blogspot.com/2005/12/software-testing-interview-questions.html

http://en.wikipedia.org/wiki/Software_testing

http://www.sqablogs.com/jstrazzere/908/

http://www.softwareqatest.com/

http://sqa.fyicenter.com/art/index.html

http://www.software-testing.com/web/Testing_resources_Center.html

http://www.allinterview.com

http://onestoptesting.com

Testing FAQs1

Differentiate between gmail and yahoomail?
Before current yahoo beta version was launched, gmail was only one to use AJAX.

What will you do if you are trying to install a software and its not getting installed
if something is not working then we do google to find solution for things that
normally would take more time if done through normal procedure.

How do you solve in case you find a Bug in the telephone?
First I will get in touch with the Customer who made the complain and send engineer to test in case the connection is proper and also check in case the instrument is working fine . In case instrument is not working fine it will be replaced else it will be rectified in the telephone exchange from which the line was given to the customer

How do you raise a bug in case in yahoo conference call you are not able to view messages delivered by the other person at your end?
Take the screen shot of the messages screen of the other person where he is sending messages and also the screen shot of my end where I am not able to view those messages and describe the situation to the developer for resolution of the problem

What are the different types of testing that can be done on an application?
Black box covering functional and other types of testing
White Box testing checking for logic and conditional loops

Gray box testing in case HTML and other technologies are involved in application


What is the purpose of using java script in the application?
Web pages have several input boxes we use Java script to write validations and other functions

How will you test a lock?
  • Lock should open only with its key. Test with selected samples of key (local made ,same company, same make but different key, other brands, carved keys, master key )
  • Should open smoothly showing no signs of stiffness or rough/wear tear with intensive/stressing use of Lock. Concept is Locks interior surface detoriate /oxidize with passage of time so locks should have resistant surface.
  • Lock should have standards displayed like number of levers and tested benchmarks/symbols specified on lock.
  • Lock should be robust, subjected to force or massive hit should not get deformed or detoriate from its working condition.
How will you test a browser?
  • URL should retrieve home page of given website.
  • Should support Http and Https protocols
  • Should directly retrieve response if input variable is given in URL (like URL?variable_name=input typed in address bar)
  • Should display html, images.
  • Should prompt the user for ActiveX controls installations if required for correct functioning of web page.
  • Functionality for Stop, Refresh , Favourites, and other options.
  • Should allow for saving of page on edit (File options)
  • Should work equally for both domain names and IPs
How to test outlook mail (specially send-receive functionality)
  • To test based on configuration to receive mails from mail server.
  • System should check for new mails in the mail server for the user’s account
    1. to test user authentication and authorization as per definition.
    2. For example - Test to confirm system should d/l only for the specific user’s a/c etc
  • System should follow filters / rules defined during download the mails to local system.

How to test Calculator application of windows.
  • Launch the application as per configuration and requirement.
  • Test different types of numbers involved in calculation like
  1. +ve/-ve integers, decimals, no of digits etc in details
  2. using boundary value analysis
  3. How the application is capable to handle continues combination of calculations
  • How the application is capable to handle errors, for example “overflow of values”
  • How the application is capable to accept and react different Input methods (keyboard/mouse).






Tuesday, April 24, 2007

Testing FAQs

  • What are the components in a web based application?
  • What is javascript?
  • How HTML will take care in Java Script absence?
  • Define a Table in HTML
  • Difference between HTTP and HTTPS.
  • What is SSL
  • How do you check the ip of machine on linux ?
  • How will you print first three letters of all files and sub folders within folder "A" in linux.
  • Tell one problem that may arise handling a team?
  • How do you determine the 2nd largest number in a array of elements?
  • What is a DLL file ?
  • What are windows registry used for?
  • What information does windows registry have?
  • Which folder does the software details stored in registry?
  • How do you check the registry and what information is needed to be checked in a registry?
  • What are Services in Windows? Name a few services which come by default in windows.
  • How do you start/stop a service?
  • Difference Between System Testing and Integration Testing.
  • Different kinds of performance testing like load testing, volume testing.
  • When do you think a Tester can certify a product or an application, so that it can go into production?
  • What is the most critical bug you happen to find in your testing life cycle?
  • 3 critical defects found in your 1st project, why do you think it is critical
  • 3 most interesting tests you came up with in your current project
  • Prepare test cases for a Pen
  • How will you test a projector.
  • How will you test the 'Random' feature of windows media player.
  • How to you test a web page , say yahoo.com or google.com ?
  • Explain Automation architecture.
  • Give a few positive and negative test cases for login scenario
  • How would you test a real atom bomb?