Sponsored Ad

Wednesday, April 7, 2010

Unit Testing With Complex Dynamic Query in PL/SQL - Oracle

image

Dynamic queries are complex sometimes and it is very hard to debug them. Here is a simple approach to get the dynamic queries and debug them.

I am taking a very simple dynamic query while you can test it with complex one.

Its Global table approach to get dynamic query as static query and then debug the query in SQL window.

So lets start with a dynamic query.

DECLARE
vsql varchar(4000) := '';
vResult varchar2(1000) := '';
v_name varchar(100) := 'My_Name';

BEGIN

vsql:='insert into temp_table(id, name)  values(1, '''|| v_name ||''' )';
  delete from test_sql;
  insert into test_sql values(vsql);      
  commit;
EXECUTE IMMEDIATE VSQL ;
END;

The above Given dynamic query Program will execute and insert the constructed query into test_sql table.

To get this Static query you just have to first run the your procedure/function and then execute

select * from test_sql

you will get static query in results

When this dynamic query is is converted in static one at runtime it looks like:

insert into temp_table(id, name)  values(1, 'My_Name' );

You just copy and paste the given query into your SQL window and you can debug if there is any syntax error or logical error and you can change the corresponding things in your dynamic query.

Monday, April 5, 2010

SQL Basics for Software Testers | Unit Testing with SQL

SQL stands for Structured query language. There is 4 basic query statements we use to do common functions. These basic statement will help you to construct data for unit testing in database.

1. Select

2. Insert

3. Update

4. Delete

 

The SELECT statement is used to select data from a database.

SELECT * FROM your_table_name;

the above query is used to select the values from table - your_table_name

 

The INSERT INTO statement is used to insert new records in a table.

INSERT INTO table_name (column-1, column-2, column-3,...)
VALUES (value-1, value-2, value-3,...);

The above statement is used to insert value-1, value2 etc to insert in column-1 , column-2 etc in table_name  table.

 

The UPDATE statement is used to update records in a table.

UPDATE your_table_name
SET column-1=value-1, column-2=value-2,...
WHERE column-3=given_value

The above statement is used to update column-1 and column-2 values to value-1 and value-2 for only those rows which have column-2 values equal to given_value

 

The DELETE statement is used to delete records in a table.

DELETE FROM your_table_name
WHERE column-3=given_value

The above statement will delete all those rows from your_table_name which have column-3 values equal to given_value.

Tuesday, March 30, 2010

Oracle Procedure Unit Testing Using PL/SQL Developer

This post will help developers and unit testers to test oracle procedure using PL/SQL Developer.

Lets start step by step procedure to unit test a procedure.

I am assuming that you already have a PL/SQL developer and a procedure created in it.

I have a Procedure called PKG_Test and it have two input parameters and a output cursor.

Step 1: just open a browser window in PL/SQL Developer by Checking Tools-> Browser option.

browser window in PL/SQL Developer

 

Step 2: Search for procedure and right Click on it and click the View Spec and Body option.

View Spec and Body option PL/SQL

 

Step 3:  Now Package is open in new window just right click on procedure name and click on test option in menu.

Package window PL/SQL

 

Step 4: Test window opened now to start unit testing (Debugging) just enter the input parameter if any and click on Start Debugger button or F9.

Start Debugger button

 

test window PL/SQL

 

Step 5: Now cursor goes inside the procedure block . there is options to stop testing execute all blocks and step over and step out.

Let me explain all things clearly.

 

image Run button(CTRL R) will run the program till next break point, if no break point is there, it will just execute all code.

image Step into (CTRL N) will go inside the functions or another procedure, if any.

image Step Over(CTRL O) will move the debugger control to next executable statement.

image Step Out (CTRL T) will move the debugger control to the parant function or procedure.

image Run to Next Exception will run the control to next exception otherwise break the debugging.

PL/SQL Debug window

you can test the variable values at any point of debugging time, just go to Script tab and insert in the variable name under variable column and you will get current value of the variable under value column.

This program is just to demonstrate the debugging process in PL/SQL developer, we haven't used any passed parameter in this. you can use as per your requirement.

PL/SQL check variable values

 

Step 6:  Now procedure run is over and you can check the results at Cursor … icon.

Once the debugging is complete you can check the results of procedure in test window cursor column.

 

PL/SQL Results

Step 7: A new result window opened and you can see the results in window.

This procedure of block is returning 3 rows which contains the 'c' character in name column.

result window PL/SQL

Now you can debug the complex procedures. Happy testing.

Online Feed Validation | How to check Validity of RSS / Atom Feed

Feed validation service is available online directly on W3C official website.  There are two options available for QA. Either by direct input of feed data or just type the URL of feed and just click on Check.

Online Feed Validation | How to check Validity of RSS / Atom Feed

The given feed validation service is free of cost and provide syntax checking service for atom or RSS feed. Along with this service there is HTML validation service also available at W3C site. HTML Validation service verify for all the tags used in a given HTML page and if any error found, This service will respond with exact line number and tag error description.

 

 

How to validate Feed online:

Feed Validation

Monday, March 29, 2010

Free Broken Link Checker - Website Testing - W3C

Free Broken Link Checker - Website Testing - W3C

Broken Link Checker is very good tool to test website and find out broken links in all over website.

This is free tool provided by W3C and their is no limit to test website.

Just go to the W3C official link and type your website name to test and click on check, The results will appear after some time, Depends on site volume. the results will display broken links and their error status as shown in figure.

What results include:

List of broken links and other issues

List of redirects

Anchors

Processing

There is number of options:

Summary only – Gives the only summary of results.
all for directories only – Can check for all files and folder or for directories only
Don't send the Accept-Language header – Do not sends Language header
Don't send the Referrer header – do not sends Referrer header for testing 
Check linked documents recursively, recursion depth: Specify recursion depth
Save options in a cookie – Would like to use cookies or not.

This Link Checker looks for issues in links, anchors and referenced objects in a Web page, or recursively on a whole Web site. For best results. The results will be good if you first use the Valid (X)HTML Markup to check HTML tag validation.

 

How to Check:

Broken Link Checker

Wednesday, March 24, 2010

Latest Test Plan Interview Questions

Ques: List the key elements of Test Plan?

or

What test plan should contains?

The key elements for a test plan are:
1.The requirement documents based on which the plan is developed. Like BRD,FRD
2.Testing environment
3.Test data

Ques: What is test strategy?

1. It Describe How to Test 
2. It Define the methodology quality analyst finalizes test Responsibility Matrix on the basis of testing policy and this is done by QA.

Ques: Define test Plan?

Test Lead or project lead develop test plan. this phase starts after the SRS and other business knowledge gathering. Test Plan describes what to test1.What is Scope of test
2.What is Approach to test.
3.What are the modules to test.

Ques:  What is the difference between Master Test Plan and Test Plan?

Test Plan: Test plan we write for each module (Both for black box and white box testing).It contains test cases,strategy that is being used and any stubs that are involved to test that particular module.

Master Test Plan : The MTP is required in all projects. The MTP is applicable for all the projects. It have details about all modules testing , the time frame, the resource, hardware dependencies, and any training required. It also involves a block diagram showing how the testing takes place.

Ques: What are Standards for Software Test Plans?

There is number of standards for test plans, IEEE also defines the test plans.

IEEE standards for test plans:

829-1983 IEEE Standard for Software Test Documentation

1008-1987 IEEE Standard for Software Unit Testing

1012-1986 IEEE Standard for Software Verification & Validation Plans

1059-1993 IEEE Guide for Software Verification & Validation Plans

Tuesday, March 23, 2010

Manual Testing Common Interview Questions 2010

These are some Manual Testing Common Interview Questions asked in  2010.

What's an 'inspection'?

What is a 'walkthrough'?

What is verification? validation?

What is Risk Analysis? Types of risks?

Describe your QA experience?

What steps are needed to develop and run software tests?

What's a 'test plan'?

What should be done after a bug is found?

What is End-to-End testing ?

What makes a good Software QA engineer?

What's the role of documentation in QA?

Please explain test matrices?

Explain the difference between system integrated testing and integrated system testing and Manual Testing?

What is Entry Criteria & Exit Criteria?

What is Soak Testing ?

What’s the User acceptance testing ?

What is Unit Testing?

What is Stress Testing ?

What is Security Testing?

What is Scalability Testing ?

What is Sanity Testing ?

What is the Regression testing ?

What is the Re-testing testing ?

What is Performance Testing ?

What is Negative Testing ?

Manual Testing Interview Questions

Ques. Why manual testing is preferred by number of Software companies while good automated tools are available in market?

1. High per-test or maintenance costs are one indicator that a test should be done manually.

2. Need of human judgment  to access the correctness of results, always need human interfere to judge a result.

3. Some times need to install the number of software's and hardware for a testing tool.

4. Sometimes need to reconfigure the system and network, Like operations and maintenance testing.

5. To read the documents and check results we always need humans.

Ques. How many types of CMM levels?

CMM is describe level 3 or above.

Level 3 - Defined
It is characteristic of processes at this level that there are sets of defined and documented rules and standard processes established and will be positive changes over time.
Level 4 - Managed
It is characteristic of processes at this level that, using process metrics, management can effectively control the AS-IS process (e.g., for software development ).
Level 5 - Optimized
It is a characteristic of processes at this level that the focus is on continually improving process performance through both incremental and innovative technological changes/improvements.

Ques: What's the role of documentation in QA?

1. Should be document so that it can be repeatable.

2. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented, So that new team member can easily understand and old members can remember.

3. To track the changes and versioning.

4. To Reproduce the bugs.

5. To Test the application as per user requirement.

Tuesday, March 16, 2010

QTP Interview Questions 2010

Q. Tell me the features and importance of Quick test professional(QTP)?

1. Key word driven testing
2. Suitable to web applications
3. Vb script as the script language
4. Better error handling mechanism
5. Excellent data driven testing features
6. Record and playback
7. to store a values we can use runtime data table
8. Auto documentation

Q. Can a QTP user can increase or decrease active screen information with the test?

Yes, user can store.

Q. What are the limitations of QTP?

The limitations listed below are specifically for QTP 8.2:

Maximum length of name—255
Maximum length of format string—255
Maximum number of tables (workbooks)—Limited by system resources (windows and memory)
Column width—0 to 255 characters
Text length—16,383 characters
Formula length—1024 characters
Number precision—15 digits
Largest positive number—9.99999999999999E307
Largest negative number— -9.99999999999999E307
Smallest positive number—1E-307
Smallest negative number— -1E-307
Maximum number of names per workbook—Limited by available memory
Maximum worksheet size—65,536 rows by 256 columns

Q.What are the QTP Script Coding Standards?

at the start In Header section of QTP you have to declare these items

***Header Section of the QTP you have to Mention*****

1.Name of the Script
2.Name of the Test case
3.Name of the Reusable scripts
4.Path of the Excel sheet
5.Version
6.Name of the Tester
7.Change History

*******************************

Then you have to follow Naming convention for each of the script that you will create in QTP.Like Y_TRA_AGIALANT_FINANCE_01

*******************************

You have to follow coding standards for the variable that you will declare in the QTP script

Like For all the

Integer type variable the name should start with int

Character type variable the name should start with Char

Boolean type variable the name should start with Boo

String Type variable the name should start with Str

*****************************************************

Then throughout the QTP script you have to mention that what you are doing actually. Like

**Here you have to mention in the script what you are doing ** Like

**Clicking the yahoo signin button to Login **********

Browswer(Yahoo page).Page(Yahoo_1).Button(Sign_in).Click

*************************************************

Coding standard are used for readability and better understanding.

Sunday, March 14, 2010

Record QTP Script in Video | Video Tutorial to record QTP Script

Here is solution of a good questions that how to record QTP Script in video.

1. How to record QTP script for Web applications
2. What record and run settings should be used to run and execute QTP script
3. How to replay/execute QTP script

Website Testing Interview Questions

Q. How can you test a website or a web application manually without using any automation tool?

We can test web applications and website manually but it can be error prone and time consuming. while using automation tools can give us lot of flexibility and stability. for automation tools we can use QTP or win runner.

Q. what is mean by client and server?

When software provide a screen to access on client machine and all logic runs on server, The same application is called client server model.

Q. How to test Browser compatibility testing
Testing the web application with multiple browsers (like IE,Netscape navigator,Mozilla Firefox etc) is called browser compatibility testing.

Q. What are problems while testing web application?
server problems(ie server down or under maintenance)Hardware problems
DataBase problems
Client machine do not have specific configurations
Browser compatibility

Q. Difference between CLENT-SERVER application and a WEB application testing?

Web Server
1. Web server serves pages for viewing in different web browsers.
2. Web server exclusively handles http requests and give response to requests.
4. Web Server serves static HTML pages or gifs, jpegs, etc., and can also run code written in CGI, JSP etc.

Application server
1. Application Server provides exposes business logic for client applications through various protocols
2. Application server is more capable of dynamic behavior than webserver. We can also change the configuration settings of application server to work as a webserver.
3. An Application Server run all the business logic.

Q. How to launch a application in winrunner using a command?

invoke_application("file_path"," "," ","sw-show)
system.util.run("file_path")
these are 2 commands is used to launch application in Winrunner from command. press F7 in Winrunner search for invoke command.

Q. What is the test cases for URL Testing?

Test Objective/Description  -- To Verify the URL Address
Test Procedure/Steps -- 1. Open Internet Explorer. > 2. Enter valid URL in address box. > 3. press Enter.
Expected Result -- URL should be open with website properly.
Actual Result -- URL Open properly.
Comment -- Mention comments

Q.What is the popular scenarios to test a website?

These are popular scenarios:
1.Functionality testing
2.Performance Testing
-Load and Stress testing
3.Security Testing
4.Usability Testing
5.Compatibility Testing
6.Interface Testing

Unit Testing Interview Questions

Ques. What is Unit Testing?

A. Testing of individual component of software.

Ques. At what phase of SDLC, Unit Testing Starts?

A. Unit testing starts with coding phase simultaneously after design phase.

Actually, Unit testing is performed by Developers. And it is done, once they are done with the completion of their code development. Like whenever code is done for a module or a project the unit testing starts, even you can do unit testing of a page also.

Ques. How you prepare Test data in unit testing process???

A. Preparing proper test data is a core part of any testing process. a developer or tester can develop a test data as per project requirement. Either it can be a production data or any dummy data. It is responsibility of a tester or developer to prepare good data for unit testing process. Tester should create his/her own test data additional to the existing standard production data. Your test data set should be ideal in terms of cost and time. Design our test data considering following categories:

Test data set examples:
1) No data: Run your unit test on blank or default data. and check if proper error messages are generated.

2) Valid data set: Create it to check if application is
functioning as per requirements and a valid input data is
properly saved in database or files with out any error.

3) Invalid data set: Prepare invalid data set to check
application behavior for negative values, alphanumeric
string inputs (Negative unit testing).

4) Illegal data format: Make one data set of illegal data
format. System should not accept data in invalid or illegal
format. Also check proper error messages are generated.

5) Boundary Condition data set: Check Data if it is out of range. Identify application boundary cases and prepare
data set that will cover lower as well as upper boundary
conditions.

6) Data set for performance, load and stress testing: This
data set should be large in volume.

This way creating separate data sets for each test
condition will ensure complete test coverage.

Some Other Unit Testing Questions:

Q. What would be the Test Objective for Unit Testing? What are the quality measurements to assure that unit testing is complete?

Q. What is use of NUnit for unit testing?

Q. How to do unit testing with Visual studio team system?

Q. What are the Phases of Unit Testing?

Unit Testing with Visual Studio Team System 2008

Unit test is use to test the newly created program by Developers and Testers. You can create a Unit test and use it multiple time.

After Creating a unit test, a separate unit test file is created for each class that you are testing. A unit test file have test method for each method that you are testing.


These are some unit testing videos demonstrating the exact definition of unit testing with vsts 2008.

Saturday, March 13, 2010

Microsoft Visual Studio 2010 Test Professional for Testers

image

Microsoft Visual Studio 2010 Test Professional is a specialized toolset for quality assurance teams that simplifies test planning and manual test execution. Test Professional works in conjunction with Visual Studio software for developers, enabling effective collaboration between developers and testers throughout the application development lifecycle.

Main Features:

Align testing efforts to the application lifecycle

Embrace manual testing

File detailed and actionable bugs

Re-use manual test recordings

Improve your test process

This is launching on April 12 and will be available in market to buy.

Its features and other details are available at Microsoft site , Please visit the link below :

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/test-professional

Monday, March 8, 2010

PVCS – A Bug Tracking Tool

PVCS – A Bug Tracking Tool

PVCS. Professional.

PVCS is a defect management tool. It improves the fast-paced development projects in departmental and team environments. With the Serena PVCS Version Manager, you get comprehensive coverage across version, defect, and issue management.

It improves the development and fast bug fixing mode by analyzing the bugs and It provide a platform for fast bug reporting and easy management.

you can directly visit to PVCS website for more details and download information:

http://www.serena.com/products/pvcs/index.html

Sponsored Ad

Related Software Testing Articles

Development Updates

Tech Updates