Friday, May 22, 2009
Basics of QTP
Quick Test Professional
What’s the QTP?
QTP is Mercury Interactive Functional Testing Tool.
What’s the basic concept of QTP? QTP is based on two concepts-
• Recording • Playback
Which scripting language used by QTP?
QTP using VB scripting.
How many types of recording facility are available in QTP?
QTP provides three types of recording methods-
• Context Recording (Normal) • Analog Recording • Low Level Recording
There are three types of recording modes available in Quick Test Pro.
1.Normal mode 2.Analog mode 3.Low-level recording mode
Normal mode: This is the default mode of recording in QTP, Object and the Operation associated/performed with Object can be recorded. This mode takes full advantage of Quick Test's test object model, recognizing the objects in AUT regardless of their location on the screen.
Analog mode: This mode records exact mouse and keyboard operations you perform in relation to the screen / application window. This mode is useful for the operation which you can record at object level, such as drawing a picture, recording signature. the steps recoded using Analog mode are saved in separate data-file, Quick tests adds to your test a Run Analog file statement that calls the recorded Analog file .This file is stored with your action in which these Analog steps are created. The steps recorded in Analog mode can not be edited within Quick Test.
Low-level recording mode: enables you to record any object or operation in your AUT whether or not Quick Test recognizes it. This Low-level recording is useful when the exact location of an Object/operation in your AUT is important for your test. This mode records in terms of X, Y co-ordinates. Unlike in Analog mode, the steps can be seen in Test script, as well in Keyword view. Normal rec. mode (by default rec. mode is normal)- it captures objects in GUI format and object repository is created with object and its properties stored during recoding time. Mouse movements are not captured in this mode. Analog rec. mode - Objects are not captured, thus object repository is not created. Only mouse movements are captured and this is stored in a file called track file. Mouse movements’ relation to screen /application window can be captured. Low level rec. mode - Objects are captured in Win obj. format and properties stored in obj. repository. if u see in object repository u will notice a different icon for the objects stored here. In this mode u cannot capture overlapping objects. E.g. - menu drop down etc.
How many types of Parameters are available in QTP?
QTP provides three types of Parameter- • Method Argument • Data Driven • Dynamic
What’s the QTP testing process?
QTP testing process consist of seven steps- • Preparing to recoding • Recording • Enhancing your script • Debugging • Run • Analyze • Report Defects
What’s the Active Screen?
It provides the snapshots of your application as it appeared when you performed a certain steps during recording session.
What’s the Test Pane?
Test Pane contains Tree View and Expert View tabs.
What’s Data Table?
It assists to you about parameterizing the test.
What’s the Test Tree?
It provides graphical representation of your operations which you have performed with your application.
Which all environment QTP supports?
ERP/ CRM Java/ J2EE VB, .NET Multimedia, XML Web Objects, ActiveX controls SAP, Oracle, Siebel, PeopleSoft Web Services, Terminal Emulator IE, NN, AOL
How can you view the Test Tree?
The Test Tree is displayed through Tree View tab.
What’s the Expert View?
Expert View display the Test Script.
Which keyword used for Normal Recording?
F3
Which keyword used for run the test script?
F5
Which keyword used for stop the recording?
F4
Which keyword used for Analog Recording?
Ctrl+Shift+F4
Which keyword used for Low Level Recording?
Ctrl+Shift+F3
Which keyword used for switch between Tree View and Expert View?
Ctrl+Tab
Note:
> QTP records each step you perform and generates a test tree and test script.
> QTP records in normal recording mode.
> If you are creating a test on web object, you can record your test on one browser and run it on another browser.
> Analog Recording and Low Level Recording require more disk space than normal recording mode.
What’s the Transaction?
You can measure how long it takes to run a section of your test by defining transactions.
Where you can view the results of the checkpoint?
You can view the results of the checkpoints in the Test Result Window.
Note: If you want to retrieve the return value of a checkpoint (a Boolean value that indicates whether the checkpoint passed or failed) you must add parentheses around the checkpoint argument in the statement in the Expert View.
What’s the Standard Checkpoint?
Standard Checkpoints checks the property value of an object in your application or web page.
Which environment is supported by Standard Checkpoint?
Standard Checkpoint is supported for all add-in environments.
What’s the Image Checkpoint?
Image Checkpoint checks the value of an image in your application or web page.
Which environments are supported by Image Checkpoint?
Image Checkpoint supports only Web environment.
What’s the Bitmap Checkpoint?
Bitmap Checkpoint checks the bitmap images in your web page or application.
Which environment is supported by Bitmap Checkpoints?
Bitmap checkpoints are supported all add-in environment.
What are the Table Checkpoints?
Table Checkpoint checks the information within a table.
Which environments are supported by Table Checkpoint?
Table Checkpoints are supporting only ActiveX environment.
What’s the Text Checkpoint?
Text Checkpoint checks that a test string is displayed in the appropriate place in your application or on web page.
Which environment is supported by Test Checkpoint?
Text Checkpoint is supported all add-in environments 1. Some more quetions i have with me on QTP. Hope it will help u.
1. What are the Features & Benefits of Quick Test Pro(QTP)..?
1. Key word driven testing 2. Suitable for both client server and web based application 3. Vb script as the scriot language 4. Better error handling mechanism 5. Excellent data driven testing features
2. Where can I get Quck Test pro(QTP Pro) software.. This is Just for Information purpose Only. Introduction to QuickTest Professional 8.0, Computer Based Training: Please find the step to get QuickTest Professional 8.0 CBT Step by Step Tutorial and Evaluation copy of the software. The full CBT is 162 MB. You will have to create account to be able to download evaluation copies of CBT and Software.
3. How to handle the exceptions using recovery secnario manager in Qtp? You can instruct QTP to recover unexpected events or errors that occured in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps
1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
3. How to handle the exceptions using recovery secnario manager in Qtp? You can instruct QTP to recover unexpected events or errors that occured in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
4. what is the use of Text output value in Qtp? Output values enable to view the values that the application talkes during run time.When paramaterised, the values change for each iteration.Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
5. How to use the Object spy in QTP 8.0 version? There are two ways to Spy the objects in QTP 1) Thru file toolbar —In the File ToolBar click on the last toolbar button (an icon showing a person with hat). 2) Tru Object repository Dialog —In Objectrepository dialog click on the button”object spy…” In the Object spy Dialog click on the button showing hand symbol. the pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible..or window is minimised then Hold the Ctrl button and activate the required window to and release the Ctrl button.
6. What is the file extension of the code file & object repository file in QTP? File extension of – Per test object rep :- filename.mtr – Shared Oject rep :- filename.tsr Code file extension id script.mts
7. Explain the concept of object repository & how QTP recognises objects? Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). we can view or modify the test object description of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits.If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description.If no assistive properties are available, then it adds a special Ordianl identifier such as objects location onthe page or in the source code.
8. What are the properties you would use for identifying a browser & page when using descriptive programming ? “name” would be another property apart from “title” that we can use. OR We can also use the property “micClass”. ex: Browser(”micClass:=browser”).page(”micClass:=page”)….
9. What are the different scripting languages you could use when working with QTP ? Visual Basic (VB),XML,JavaScript,Java,HTML
10. Give me an example where you have used a COM interface in your QTP project?
11. Few basic questions on commonly used Excel VBA functions. common functions are: Coloring the cell Auto fit cell setting navigation from link in one cell to other saving
12. Explain the keyword createobject with an example. Creates and returns a reference to an Automation object syntax: CreateObject(servername.typename [, location]) Arguments servername:Required. The name of the application providing the object. typename : Required. The type or class of the object to create. location : Optional. The name of the network server where the object is to be created.
13. Explain in brief about the QTP Automation Object Model. Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program.
14. How to handle dynamic objects in QTP? QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognise the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. Check this out- If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object. While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails. The Smart Identification mechanism uses two types of properties: Base filter properties—The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link’s tag was changed from to any other value, you could no longer call it the same object. Optional filter properties—Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.
15. What is a Run-Time Data Table? Where can I find and view this table? In QTP, there is data table used , which is used at runtime. -In QTP, select the option View->Data tabke. -This is basically an excel file, which is stored in the folder of the test created, its name is Default.xls by default.
16. How does Parameterization and Data-Driving relate to each other in QTP? To datadrive we have to parameterize.i.e. we have to make the constant value as parameter, so that in each iteraration(cycle) it takes a value that is supplied in run-time datatable. Through parameterization only we can drive a transaction(action) with different sets of data. You know running the script with the same set of data several times is not suggestable, & it’s also of no use.
17. What is the difference between Call to Action and Copy Action.? Call to Action : The changes made in Call to Action , will be reflected in the orginal action( from where the script is called).But where as in Copy Action , the changes made in the script ,will not effect the original script(Action)
18. Discuss QTP Environment. QuickTest Pro environment using the graphical interface and ActiveScreen technologies - A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.
19. Explain the concept of how QTP identifies object. During recording qtp looks at the object and stores it as test object.For each test object QT learns a set of default properties called mandatory properties,and look at the rest of the objects to check whether this properties are enough to uniquely identify the object. During test run,QT searches for the run time obkects that matches with the test object it learned while recording.
20. Differentiate the two Object Repository Types of QTP. Object repository is used to store all the objects in the application being tested.2 types of oject repositoy per action and shared. In shared repository only one centralised repository for all the tests. where as in per action.for each test a separate per action repostory is created.
21. What the differences are and best practical application of each. Per Action: For Each Action, one Object Repository is created. Shared : One Object Repository is used by entire application
22. Explain what the difference between Shared Repository and Per_Action Repository Shared Repository: Entire application uses one Object Repository , that similar to Global GUI Map file in WinRunner Per Action: For each Action ,one Object Repository is created, like GUI map file per test in WinRunner
23. Have you ever written a compiled module? If yes tell me about some of the functions that you wrote. I Used the functions for Capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages.
24. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them. pbs :WR fails to identify the object in gui. If there is a non std window obk wr cannot recognize it ,we use GUI SPY for that to handle such situation. .
25. Can you do more than just capture and playback? I have done Dynamically capturing the objects during runtime in which no recording, no playback and no use of repository is done AT ALL. -It was done by the windows scripting using the DOM(Document Object Model) of the windows.
26. How long have you used the product?
27. How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. Whatz the difference between them? how to handle script issues? Yes, there’s an in-built functionality called “Step Generator” in Insert->Step->Step Generator -F7, which will generate the scripts as u enter the appropriate steps. 28. What is the difference between check point and output value. I would like to add some stuff to Kalpana’s comments. It is as follows:- An outPut value is a value captured during the test run and entered in the run-time but to a specified location. EX:-Location in Data Table[Global sheet / local sheet]
29. IF we use batch testing.the result shown for last action only.in that how can i get result for every action. u can click on the icon in the tree view to view the result of every action
30. How the exception handling can be done using QTP It can be done Using the Recovery Scenario Manager which provides a wizard that gudies you through the process of defining a recovery scenario. FYI.. The wizard could be accesed in QTP> Tools-> Recovery Scenario Manager …….
31. How do you test siebel application using qtp?
32. How many types of Actions are there in QTP? There are three kinds of actions: non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once. reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests. external action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.
33. How do you data drive an external spreadsheet?
34. I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this?
U can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad “( i.e., where the notepad.exe is stored in the system) in the “Windows Applications Tab” of the “Record and Run Settings window. Try it out. All the Best.
1. . What are the Features & Benefits of Quick Test Pro(QTP)..?
1. Key word driven testing
2. Suitable for both client server and web based application
3. Vb script as the scriot language
4. Better error handling mechanism
5. Excellent data driven testing features
2. Where can I get Quck Test pro(QTP Pro) software.. This is Just for Information purpose Only. Introduction to QuickTest Professional 8.0, Computer Based Training: Please find the step to get QuickTest Professional 8.0 CBT Step by Step Tutorial and Evaluation copy of the software. The full CBT is 162 MB. You will have to create account to be able to download evaluation copies of CBT and Software.
3. How to handle the exceptions using recovery secnario manager in Qtp?
You can instruct QTP to recover unexpected events or errors that occured in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
4. what is the use of Text output value in Qtp?
Output values enable to view the values that the application talkes during run time.When paramaterised, the values change for each iteration.Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
5. How to use the Object spy in QTP 8.0 version?
There are two ways to Spy the objects in QTP 1) Thru file toolbar —In the File ToolBar click on the last toolbar button (an icon showing a person with hat). 2) Tru Object repository Dialog —In Objectrepository dialog click on the button”object spy…” In the Object spy Dialog click on the button showing hand symbol. the pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible..or window is minimised then Hold the Ctrl button and activate the required window to and release the Ctrl button.
6. What is the file extension of the code file & object repository file in QTP?
File extension of – Per test object rep :- filename.mtr – Shared Oject rep :- filename.tsr Code file extension id script.mts
7. Explain the concept of object repository & how QTP recognises objects?
Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). we can view or modify the test object description of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits.If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description.If no assistive properties are available, then it adds a special Ordianl identifier such as objects location onthe page or in the source code.
8. What are the properties you would use for identifying a browser & page when using descriptive programming ?
“name” would be another property apart from “title” that we can use. OR We can also use the property “micClass”. ex: Browser(”micClass:=browser”).page(”micClass:=page”)….
9. What are the different scripting languages you could use when working with QTP ?
Visual Basic (VB),XML,JavaScript,Java,HTML
10. Give me an example where you have used a COM interface in your QTP project?
11. Few basic questions on commonly used Excel VBA functions. common functions are: Coloring the cell Auto fit cell setting navigation from link in one cell to other saving
12. Explain the keyword createobject with an example. Creates and returns a reference to an Automation object syntax: CreateObject(servername.typename [, location]) Arguments servername:Required. The name of the application providing the object. typename : Required. The type or class of the object to create. location : Optional. The name of the network server where the object is to be created.
13. Explain in brief about the QTP Automation Object Model. Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program.
14. How to handle dynamic objects in QTP? QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognise the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. Check this out- If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object. While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails. The Smart Identification mechanism uses two types of properties: Base filter properties—The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link’s tag was changed from to any other value, you could no longer call it the same object. Optional filter properties—Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.
15. What is a Run-Time Data Table? Where can I find and view this table?
In QTP, there is data table used , which is used at runtime. -In QTP, select the option View->Data tabke. -This is basically an excel file, which is stored in the folder of the test created, its name is Default.xls by default.
16. How does Parameterization and Data-Driving relate to each other in QTP?
To datadrive we have to parameterize.i.e. we have to make the constant value as parameter, so that in each iteraration(cycle) it takes a value that is supplied in run-time datatable. Through parameterization only we can drive a transaction(action) with different sets of data. You know running the script with the same set of data several times is not suggestable, & it’s also of no use.
17. What is the difference between Call to Action and Copy Action.? Call to Action : The changes made in Call to Action , will be reflected in the orginal action( from where the script is called).But where as in Copy Action , the changes made in the script ,will not effect the original script(Action)
18. Discuss QTP Environment. QuickTest Pro environment using the graphical interface and ActiveScreen technologies - A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.
19. Explain the concept of how QTP identifies object. During recording qtp looks at the object and stores it as test object.For each test object QT learns a set of default properties called mandatory properties,and look at the rest of the objects to check whether this properties are enough to uniquely identify the object. During test run,QT searches for the run time obkects that matches with the test object it learned while recording.
20. Differentiate the two Object Repository Types of QTP. Object repository is used to store all the objects in the application being tested.2 types of oject repositoy per action and shared. In shared repository only one centralised repository for all the tests. where as in per action.for each test a separate per action repostory is created.
21. What the differences are and best practical application of each. Per Action: For Each Action, one Object Repository is created. Shared : One Object Repository is used by entire application
22. Explain what the difference between Shared Repository and Per_Action Repository Shared Repository: Entire application uses one Object Repository , that similar to Global GUI Map file in WinRunner Per Action: For each Action ,one Object Repository is created, like GUI map file per test in WinRunner
23. Have you ever written a compiled module? If yes tell me about some of the functions that you wrote. I Used the functions for Capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages.
24. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them. pbs :WR fails to identify the object in gui. If there is a non std window obk wr cannot recognize it ,we use GUI SPY for that to handle such situation.
25. Can you do more than just capture and playback? I have done Dynamically capturing the objects during runtime in which no recording, no playback and no use of repository is done AT ALL. -It was done by the windows scripting using the DOM(Document Object Model) of the windows.
26. How long have you used the product?
27. How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. Whatz the difference between them? how to handle script issues? Yes, there’s an in-built functionality called “Step Generator” in Insert->Step->Step Generator -F7, which will generate the scripts as u enter the appropriate steps.
28. What is the difference between check point and output value. I would like to add some stuff to Kalpana’s comments. It is as follows:- An outPut value is a value captured during the test run and entered in the run-time but to a specified location. EX:-Location in Data Table[Global sheet / local sheet]
29. IF we use batch testing.the result shown for last action only.in that how can i get result for every action. u can click on the icon in the tree view to view the result of every action
30. How the exception handling can be done using QTP It can be done Using the Recovery Scenario Manager which provides a wizard that gudies you through the process of defining a recovery scenario. FYI.. The wizard could be accesed in QTP> Tools-> Recovery Scenario Manager …….
31. How do you test siebel application using qtp?
32. How many types of Actions are there in QTP? There are three kinds of actions: non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once. reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests. external action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.
33. How do you data drive an external spreadsheet?
34. I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this? U can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad “( i.e., where the notepad.exe is stored in the system) in the “Windows Applications Tab” of the “Record and Run Settings window. Try it out. All the Best.
Thursday, May 21, 2009
SQL Fundamentals
|
|
What is SQL and where does it come from?
Structured Query Language (SQL) is a language that provides an interface to relational database systems. SQL was developed by IBM in the 1970s for use in System R, and is a de facto standard, as well as an ISO and ANSI standard. SQL is often pronounced SEQUEL.
In common usage SQL also encompasses DML (Data Manipulation Language), for INSERTs, UPDATEs, DELETEs and DDL (Data Definition Language), used for creating and modifying tables and other database structures.
The development of SQL is governed by standards. A major revision to the SQL standard was completed in 1992, called SQL2. SQL3 support object extensions and will be (partially?) implemented in Oracle8.
![]()
What are the difference between DDL, DML and DCL commands?
DDL is Data Definition Language statements. Some examples:
· CREATE - to create objects in the database
· ALTER - alters the structure of the database
· DROP - delete objects from the database
· TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
· COMMENT - add comments to the data dictionary
· GRANT - gives user's access privileges to database
· REVOKE - withdraw access privileges given with the GRANT command
DML is Data Manipulation Language statements. Some examples:
· SELECT - retrieve data from the a database
· INSERT - insert data into a table
· UPDATE - updates existing data within a table
· DELETE - deletes all records from a table, the space for the records remain
· CALL - call a PL/SQL or Java subprogram
· EXPLAIN PLAN - explain access path to data
· LOCK TABLE - control concurrency
DCL is Data Control Language statements. Some examples:
· COMMIT - save work done
· SAVEPOINT - identify a point in a transaction to which you can later roll back
· ROLLBACK - restore database to original since the last COMMIT
· SET TRANSACTION - Change transaction options like what rollback segment to use
How can I eliminate duplicates values in a table?
Choose one of the following queries to identify or remove duplicate rows from a table leaving one record:
Method 1:
SQL> DELETE FROM table_name A WHERE ROWID > (
2 SELECT min(rowid) FROM table_name B
3 WHERE A.key_values = B.key_values);
Method 2:
SQL> create table table_name2 as select distinct * from table_name1;
SQL> drop table_name1;
SQL> rename table_name2 to table_name1;
Method 3:
SQL> Delete from my_table where rowid not in(
SQL> select max(rowid) from my_table
SQL> group by my_column_name );
Method 4:
SQL> delete from my_table t1
SQL> where exists (select 'x' from my_table t2
SQL> where t2.key_value1 = t1.key_value1
SQL> and t2.key_value2 = t1.key_value2
SQL> and t2.rowid > t1.rowid);
Note: If you create an index on the joined fields in the inner loop, you, for all intents purposes, eliminate N^2 operations (no need to loop through the entire table on each pass by a record).
How can I generate primary key values for my table?
Create your table with a NOT NULL column (say SEQNO). This column can now be populated with unique values:
SQL> UPDATE table_name SET seqno = ROWNUM;
or use a sequences generator:
SQL> CREATE SEQUENCE sequence_name START WITH 1 INCREMENT BY 1;
SQL> UPDATE table_name SET seqno = sequence_name.NEXTVAL;
Finally, create a unique index on this column.
How can I get the time difference between two date columns
Look at this example query:
select floor(((date1-date2)*24*60*60)/3600)
|| ' HOURS ' ||
floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)
|| ' MINUTES ' ||
round((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600 -
(floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)*60)))
|| ' SECS ' time_difference
from ...
How does one count different data values in a column?
select dept, sum( decode(sex,'M',1,0)) MALE,
sum( decode(sex,'F',1,0)) FEMALE,
count(decode(sex,'M',1,'F',1)) TOTAL
from my_emp_table
group by dept;
How does one count/sum RANGES of data values in a column?
A value x will be between values y and z if GREATEST(x, y) = LEAST(x, z). Look at this example:
select f2,
sum(decode(greatest(f1,59), least(f1,100), 1, 0)) "Range 60-100",
sum(decode(greatest(f1,30), least(f1, 59), 1, 0)) "Range 30-59",
sum(decode(greatest(f1, 0), least(f1, 29), 1, 0)) "Range 00-29"
from my_table
group by f2;
For equal size ranges it might be easier to calculate it with DECODE(TRUNC(value/range), 0, rate_0, 1, rate_1, ...). Eg.
select ename "Name", sal "Salary",
decode( trunc(f2/1000, 0), 0, 0.0,
1, 0.1,
2, 0.2,
3, 0.31) "Tax rate"
from my_table;
Can one retrieve only the Nth row from a table?
provided this solution to select the Nth row form a table:
SELECT f1 FROM t1
WHERE rowid = (
SELECT rowid FROM t1
WHERE rownum <= 10
MINUS
SELECT rowid FROM t1
WHERE rownum <>
Alternatively...
SELECT * FROM emp WHERE rownum=1 AND rowid NOT IN
(SELECT rowid FROM emp WHERE rownum <>
Please note, there is no explicit row order in a relational database. However, this query is quite fun and may even help in the odd situation.
Can one retrieve only rows X to Y from a table?
To display rows 5 to 7, construct a query like this:
SELECT *
FROM tableX
WHERE rowid in (
SELECT rowid FROM tableX
WHERE rownum <= 7
MINUS
SELECT rowid FROM tableX
WHERE rownum <>
Please note, there is no explicit row order in a relational database. However, this query is quite fun and may even help in the odd situation.
How does one select EVERY Nth row from a table?
One can easily select all even, odd, or Nth rows from a table using SQL queries like this:
Method 1: Using a subquery
SELECT *
FROM emp
WHERE (ROWID,0) IN (SELECT ROWID, MOD(ROWNUM,4)
FROM emp);
Method 2: Use dynamic views (available from Oracle7.2):
SELECT *
FROM ( SELECT rownum rn, empno, ename
FROM emp
) temp
WHERE MOD(temp.ROWNUM,4) = 0;
Please note, there is no explicit row order in a relational database. However, these queries are quite fun and may even help in the odd situation.
How does one select the TOP N rows from a table?
Form Oracle8i one can have an inner-query with an ORDER BY clause. Look at this example:
SELECT *
FROM (SELECT * FROM my_table ORDER BY col_name_1 DESC)
WHERE ROWNUM <>
Use this workaround with prior releases:
SELECT *
FROM my_table a
WHERE 10 >= (SELECT COUNT(DISTINCT maxcol)
FROM my_table b
WHERE b.maxcol >= a.maxcol)
ORDER BY maxcol DESC;
How does one code a tree-structured query?
Tree-structured queries are definitely non-relational (enough to kill Codd and make him roll in his grave). Also, this feature is not often found in other database offerings.
The SCOTT/TIGER database schema contains a table EMP with a self-referencing relation (EMPNO and MGR columns). This table is perfect for tesing and demonstrating tree-structured queries as the MGR column contains the employee number of the "current" employee's boss.
The LEVEL pseudo-column is an indication of how deep in the tree one is. Oracle can handle queries with a depth of up to 255 levels. Look at this example:
select LEVEL, EMPNO, ENAME, MGR
from EMP
connect by prior EMPNO = MGR
start with MGR is NULL;
One can produce an indented report by using the level number to substring or lpad() a series of spaces, and concatenate that to the string. Look at this example:
select lpad(' ', LEVEL * 2) || ENAME ........
One uses the "start with" clause to specify the start of the tree. More than one record can match the starting condition. One disadvantage of having a "connect by prior" clause is that you cannot perform a join to other tables. The "connect by prior" clause is rarely implemented in the other database offerings. Trying to do this programmatically is difficult as one has to do the top level query first, then, for each of the records open a cursor to look for child nodes.
One way of working around this is to use PL/SQL, open the driving cursor with the "connect by prior" statement, and the select matching records from other tables on a row-by-row basis, inserting the results into a temporary table for later retrieval.
How does one code a matrix report in SQL?
Look at this example query with sample output:
SELECT *
FROM (SELECT job,
sum(decode(deptno,10,sal)) DEPT10,
sum(decode(deptno,20,sal)) DEPT20,
sum(decode(deptno,30,sal)) DEPT30,
sum(decode(deptno,40,sal)) DEPT40
FROM scott.emp
GROUP BY job)
ORDER BY 1;
JOB DEPT10 DEPT20 DEPT30 DEPT40
--------- ---------- ---------- ---------- ----------
ANALYST 6000
CLERK 1300 1900 950
MANAGER 2450 2975 2850
PRESIDENT 5000
SALESMAN 5600
How does one implement IF-THEN-ELSE in a select statement?
The Oracle decode function acts like a procedural statement inside an SQL statement to return different values or columns based on the values of other columns in the select statement.
Some examples:
select decode(sex, 'M', 'Male',
'F', 'Female',
'Unknown')
from employees;
select a, b, decode( abs(a-b), a-b, 'a > b',
0, 'a = b',
'a <>
from tableX;
select decode( GREATEST(A,B), A, 'A is greater than B', 'B is greater than A')...
Note: The decode function is not ANSI SQL and is rarely implemented in other RDBMS offerings. It is one of the good things about Oracle, but use it sparingly if portability is required.
From Oracle 8i one can also use CASE statements in SQL. Look at this example:
SELECT ename, CASE WHEN sal>1000 THEN 'Over paid' ELSE 'Under paid' END
FROM emp;
How can one dump/ examine the exact content of a database column?
SELECT DUMP(col1)
FROM tab1
WHERE cond1 = val1;
DUMP(COL1)
-------------------------------------
Typ=96 Len=4: 65,66,67,32
For this example the type is 96, indicating CHAR, and the last byte in the column is 32, which is the ASCII code for a space. This tells us that this column is blank-padded.
![]()
Can one drop a column from a table?
From Oracle8i one can DROP a column from a table. Look at this sample script, demonstrating the ALTER TABLE table_name DROP COLUMN column_name; command.
With previous releases one can use Joseph S. Testa's DROP COLUMN package that can be downloaded from http://www.oracle-dba.com/ora_scr.htm.
Other workarounds:
1. SQL> update t1 set column_to_drop = NULL;
SQL> rename t1 to t1_base;
SQL> create view t1 as select
2. SQL> create table t2 as select
SQL> drop table t1;
SQL> rename t2 to t1;
Can one rename a column in a table?
No, this is listed as Enhancement Request 163519. Some workarounds:
1. -- Use a view with correct column names...
rename t1 to t1_base;
create view t1
2. -- Recreate the table with correct column names...
create table t2
drop table t1;
rename t2 to t1;
3. -- Add a column with a new name and drop an old column...
alter table t1 add ( newcolame datatype );
update t1 set newcolname=oldcolname;
alter table t1 drop column oldcolname;
How can I change my Oracle password?
Issue the following SQL command: ALTER USER
/
From Oracle8 you can just type "password" from SQL*Plus, or if you need to change another user's password, type "password user_name".
How does one find the next value of a sequence?
Perform an "ALTER SEQUENCE ... NOCACHE" to unload the unused cached sequence numbers from the Oracle library cache. This way, no cached numbers will be lost. If you then select from the USER_SEQUENCES dictionary view, you will see the correct high water mark value that would be returned for the next NEXTVALL call. Afterwards, perform an "ALTER SEQUENCE ... CACHE" to restore caching.
You can use the above technique to prevent sequence number loss before a SHUTDOWN ABORT, or any other operation that would cause gaps in sequence values.
Workaround for snapshots on tables with LONG columns
You can use the SQL*Plus COPY command instead of snapshots if you need to copy LONG and LONG RAW variables from one location to another. Eg:
COPY TO SCOTT/TIGER@REMOTE -
CREATE IMAGE_TABLE USING -
SELECT IMAGE_NO, IMAGE -
FROM IMAGES;
Note: If you run Oracle8, convert your LONGs to LOBs, as it can be replicated.
Wednesday, May 20, 2009
CMM Overview
After two decades of unfulfilled promises about productivity and quality gains from applying new software methodologies and technologies, industry and government organizations are realizing that their fundamental problem is the inability to manage the software process [DoD87]. The benefits of better methods and tools cannot be realized in the maelstrom of an undisciplined, chaotic project. In many organizations, projects are often excessively late and double the planned budget [Siegel90]. In such instances, the organization frequently is not providing the
infrastructure and support necessary to help projects avoid these problems. Even in disciplined organizations, however, some individual software projects produce excellent results. When such projects succeed, it is generally through the heroic efforts of a dedicated team, rather than through repeating the proven methods of an organization with a mature software process. In the absence of an organization-wide software process, repeating results depends entirely on having the same individuals available for the next project. Success that rests solely on the availability of specific individuals provides no basis for long-term productivity and quality improvement throughout an organization. Continuous improvement can occur only through focused and sustained effort towards building a process infrastructure of effective software engineering and management practices.
1.1 Immature Versus Mature Software Organizations
Setting sensible goals for process improvement requires an understanding of the difference between immature and mature software organizations. In an immature software organization, software processes are generally improvised by practitioners and their management during the course of the project. Even if a software process has been specified, it is not rigorously followed or enforced. The immature software organization is reactionary, and managers are usually focused on solving immediate crises (better known as fire fighting). Schedules and budgets are routinely exceeded because they are not based on realistic estimates. When hard deadlines are
imposed, product functionality and quality are often compromised to meet the schedule.
In an immature organization, there is no objective basis for judging product quality or for solving product or process problems. Therefore, product quality is difficult to predict. Activities intended to enhance quality such as reviews and testing are often curtailed or eliminated when projects fall behind schedule.
On the other hand, a mature software organization possesses an organization-wide ability for managing software development and maintenance processes. The software process is accurately communicated to both existing staff and new employees, and work activities are carried out
according to the planned process. The processes mandated are fit for use [Humphrey91b] and consistent with the way the work actually gets done. These defined processes are updated when necessary, and improvements are developed through controlled pilot-tests and/or cost benefit analyses. Roles and responsibilities within the defined process are clear throughout
the project and across the organization.
In a mature organization, managers monitor the quality of the software products and customer satisfaction. There is an objective, quantitative basis for judging product quality and analyzing problems with the product and process. Schedules and budgets are based on historical performance and are realistic; the expected results for cost, schedule, functionality, and quality of the product are usually achieved. In general, a disciplined process is consistently followed because all of the participants understand the value of doing so, and the necessary infrastructure exists to support the process.
Capitalizing on these observations about immature and mature software organizations requires construction of a software process maturity framework. This framework describes an evolutionary path from ad hoc, chaotic processes to mature, disciplined software processes. Without this framework, improvement programs may prove ineffective because the necessary foundation for supporting successive improvements has not been established. The software process maturity framework emerges from integrating the concepts of software process, software process capability, software process performance, and software process maturity, all of which are defined in succeeding paragraphs.
1.2 Fundamental Concepts Underlying Process Maturity
According to Webster's dictionary, a process is "a system of operations in producing something ... a series of actions, changes, or functions that achieve an end or result." The IEEE defines a process as "a sequence of steps performed for a given purpose" [IEEE-STD-610]. A software process can be defined as a set of activities, methods, practices, and transformations that
people use to develop and maintain software and the associated products (e.g., project plans, design documents, code, test cases, and user manuals). As an organization matures, the software process becomes better defined and more consistently implemented throughout the organization.
Software process capability describes the range of expected results that can be achieved by following a software process. The software process capability of an organization provides one means of predicting the most likely outcomes to be expected from the next software project the organization undertakes.
Software process performance represents the actual results achieved by following a software process. Thus, software process performance focuses on the results achieved, while software process capability focuses on results expected. Based on the attributes of a specific project and the context within which it is conducted, the actual performance of the project may not reflect
the full process capability of the organization; i.e., the capability of the project is constrained by its environment. For instance, radical changes in the application or technology undertaken may place a project' s staff on a learning curve that causes their project's capability, and performance, to fall short of the organization's full process capability.
Software process maturity is the extent to which a specific process is explicitly defined,managed, measured, controlled, and effective. Maturity implies a potential for growth in capability and indicates both the richness of an organization's software process and the consistency with which it is applied in projects throughout the organization. The software process is well-understood throughout a mature organization, usually through documentation and training, and the process is continually being monitored and improved by its users. The capability of a mature software
process is known. Software process maturity implies that the productivity and quality resulting from an organization’s software process can be improved over time through consistent gains in the discipline achieved by using its software process.
As a software organization gains in software process maturity, it institutionalizes its software process via policies, standards, and organizational structures. Institutionalization entails building an infrastructure and a corporate culture that supports the methods, practices, and procedures of the business so that they endure after those who originally defined them have gone.
2 The Five Levels of Software Process Maturity
Continuous process improvement is based on many small, evolutionary steps rather than revolutionary innovations [Imai86]. The CMM provides a framework for organizing these evolutionary steps into five maturity levels that lay successive foundations for continuous process improvement. These five maturity levels define an ordinal scale for measuring the
maturity of an organization's software process and for evaluating its software process capability. The levels also help an organization prioritize its improvement efforts.
A maturity level is a well-defined evolutionary plateau toward achieving a mature software process. Each maturity level provides a layer in the foundation for continuous process improvement. Each level comprises a set of process goals that, when satisfied, stabilize an important component of the software process. Achieving each level of the maturity framework
establishes a different component in the software process, resulting in an increase in the process capability of the organization.
Organizing the CMM into the five levels shown in Figure 2.1 prioritizes improvement actions for increasing software process maturity. The labeled arrows in Figure 2.1 indicate the type of process capability being institutionalized by the organization at each step of the maturity
framework.

The following characterizations of the five maturity levels highlight the primary process changes made at each level:
1) Initial The software process is characterized as ad hoc, and occasionally even chaotic. Few processes are defined, and success depends on individual effort.
2) Repeatable Basic project management processes are established to track cost, schedule, and functionality. The necessary process discipline is in place to repeat earlier successes on projects with similar applications.
3) Defined The software process for both management and engineering activities is documented, standardized, and integrated into a standard software process for the organization. All projects use an approved, tailored version of the organization's standard software process for developing and maintaining software.
4) Managed Detailed measures of the software process and product quality are collected. Both the software process and products are quantitatively understood and controlled.
5) Optimizing Continuous process improvement is enabled by quantitative feedback from the process and from piloting innovative ideas and technologies.
Tuesday, May 19, 2009
Test Plan Guidelines
(Looking for a heavy-duty test plan? The government and the military are good sources. Try the one on the IRS Web site:
Make sure to fill in the running headers and footers with the product name, draft numbers, revision dates, and page numbers; this is important in places with lots of test projects on the go. Make sure to include the author’s name, too, so that errors or questions can be addressed to the right person.
1. OVERVIEW
1.1. PRODUCT NAME
1.2. PRODUCT REVISION
1.3. PROJECT LEADS
1.3.1. Marketing Lead (or other customer representative)
1.3.2. Program Manager
1.3.3. Development Lead
1.3.4. Test Lead
1.3.5. Build and Release Control Engineer
1.3.6. Legal representative
Include names, phone numbers, and email addresses for each. Note that this table will differ for a particular company or group. The goal is to ensure that anyone walking into the company or into the test role can easily identify and contact the people he/she needs to reach.
1.4. TEST PROJECT STAFF
1.4.1. Test requirements designers
1.4.2. Test case designers
1.4.3. Test personnel
1.4.3.1. For manual (i.e. non-automated) tests
1.4.3.2. For automated tests
1.4.3.3. Test automation programmers
1.4.4. Documentation reviewers
1.4.5. Legal reviewer
Include names, phone numbers, and email addresses for each. Note that there may be several people in each role, that one person may be obliged to fill multiple roles, and that some roles (e.g. legal reviewer) won’t be required for all projects.
1.5. PRODUCT OVERVIEW
This could also be “description of the change requirements” for maintenance projects.
1.5.1. Cut and paste from requirements document or specification a brief summary description of the product or change, or describe the project as understood by the developers—if the latter, make sure that there is agreement and sign-off from the customer.
1.6. TRACKING AND REPORTING SYSTEMS
1.6.1. Identify the defect tracking system in use.
1.6.2. Identify the manner and schedule by which defect reports are expected to be delivered to developers.
1.6.3. Identify parties that may have access to the tracking system.
1.6.4. Identify the change control system.
1.6.5. Identify the means by which the team is to be notified of changes to the requirements, the product, the test plan, etc.
2. TESTING SYNOPSIS
2.1. Items to be tested
2.1.1. Refer to the functional requirements that specify the features and functions to be tested. The description of the change need not be excessively detailed when there is a complete description to refer to in some other document. On the other hand, if there is no reasonable specification available, more detail is called for here.
2.2. Items not to be Tested
2.2.1. List the features and functions that will not be covered in this test plan. Identify briefly the reasons for leaving them out.
2.3. System Requirements
2.3.1. This section should be filled out in detail for new projects. For existing maintenance tasks, a simple cross-reference to the document describing existing system requirements is fine. Note any changes to previous system requirements, especially when support for a given product or platform is being dropped.
2.3.2. If there is a system requirement that could be unclear, make it specific; for example, for Web-based projects, identify not only the supported browsers but also the minimum versions of the supported browsers.
2.4. Standards/Reference material
2.4.1. List any standards or other reference material used in the creation of this test plan.
2.4.2. Identify standards for acceptance criteria, defect severity, testable specifications, and so on. (These standards may have to be created, or adapted from time to time; the first use of this test plan will require more work than later iterations.)
2.5. Glossary
2.5.1. In cases where terminology could be unfamiliar or open to interpretation, provide a list defining the unclear terms.
2.5.2. Obtain agreement on these terms from all interested parties.
2.5.3. Note: If no one is forthcoming with the information you need, make something up; they might not have done their jobs from the outset, but they’ll be happy to correct your work! You will have achieved the goal, which is clarity and agreement.
3. TYPES OF TESTING
3.1. ACCEPTANCE TESTING
3.1.1. Detail a set of acceptance criteria—conditions that must be met before testing can begin. A smoke test should represent the bare minimum of acceptance testing.
3.1.2. As noted above, the ideal is to create a separate document for acceptance criteria that can be reused and referred to here. If any particular, specialized test cases not listed in that document will be used, refer to them here.
3.2. FEATURE LEVEL TESTING
This is the real meat of the test plan. The test categories below are filled in itemizing categories of tests, along with references to the test library or catalog. Individual test cases should not be listed here; test requirements generally should not be either; the details should exist elsewhere and can be cross-referenced.
3.2.1. Task-Oriented Functional Tests
3.2.1.1. This is a detailed section, listing tests requirements for program features against functional specifications, user guides or other design related documents. If there are test matrices available listing these features and their interdependence (and there should be), refer to them.
3.2.2. Forced-Error Tests
3.2.2.1. Provide or refer to a list of all error conditions and messages. Identify the tests that will be run to force the program into error conditions.
3.2.3. Boundary Tests
3.2.3.1. Boundary tests—tests carried out at the lines between valid and invalid input, acceptable and unacceptable system requirements (such as memory, disk space, or timing), and other tests at the limits of performance—are the keys to eliminating duplication of effort. Identify the types of boundary tests that will be carried out. Note that such tests can also fall into the categories outlined below, so this section may be removed, or made a sub-section of those categories.
3.2.4. Integration Tests
3.2.4.1. Identify components or modules that can be combined and tested independently to reduce dependence on system testing. Identify any test harnesses or drivers that need to be developed.
3.2.5. System-Level Tests
3.2.5.1. Specify the tests will be carried out to fully exercise the program as a whole to ensure that all elements of the integrated system function properly. Note that when unit and integration testing have been properly performed, the dependence upon system testing can be reduced.
3.2.6. Real World User-Level Test
3.2.6.1. In contrast to types of testing designed to find defects, identify tests that will demonstrate the successful functioning of the program as you expect the customer to use it. What type of workflow tests will be run? What type of “real work” will be carried out using the program?
3.2.7. Unstructured Tests
3.2.7.1. Specify the amount of ad-hoc or exploratory testing that will be carried out. Identify the scope and the time associated with this form of testing.
3.2.8. Volume Tests
3.2.8.1. Indicate the types of tests will be carried out to see how the program deals with very large amounts of data, or with a large demand on timely processing. Note that these tests can rarely be performed without automation; identify the automation tools, test harnesses, or scripts that will be used. Ensure that the programs developed for the test automation effort are accompanied by their own sets of requirements, specifications, and development processes.
3.2.9. Stress Tests
3.2.9.1. Identify the limits under which the program is expected to perform. These may include number of transactions per unit time, timeouts, memory constraints, disk space constraints, and so on. Volume tests and stress tests are closely related; you may consider wrapping both into the same category.
3.2.9.2. How will the product be tested to push the upper functional limits of the program? Will specific tools or test suites be used to carry out stress tests? Ensure that these are reusable.
3.2.10. Performance Tests
3.2.10.1. Refer to the functional requirements that specify acceptable performance. Identify the functions that need to be measured, and the tests needed to show conformance to the requirements.
3.3. REGRESSION TESTING
3.3.1. At each stage of new development or maintenance, a subset of the regression test library should be run, focusing on the feature or function that has changed from the previous version. Unit, integration, and system tests are all viable places for regression testing. For small maintenance fixes, identify this subset. A good version control system can allow the building of older versions of the software for comparative purposes.
3.3.2. In the final phase of a complete development cycle, a full regression test cycle is run. Identify the test case libraries and suites that will be run.
3.3.3. Whether a subset or a full regression test run, existing test scripts, matrices and test cases should be used, whether automation is available or not. Identify the documents that describe the details. Emphasize regression tests for functions that are new or that have changed, for components that have had a history of vulnerability, for high-risk defects, and for previously-fixed severe defects.
3.4. CONFIGURATION AND COMPATIBILITY TESTING
3.4.1. If applicable, identify the types of software and hardware compatibility tests that will be carried out.
3.4.2. List operating systems, software applications, device drivers etc. that the product will be tested with or against.
3.4.3. List hardware environments required for in-house testing.
3.5. DOCUMENTATION TESTING/ONLINE HELP TESTING
3.5.1. Documentation and online help testing will be carried out to verify technical accuracy of documented material.
3.5.2. If a license agreement is included in or displayed by the product, or the portion of it to which this test plan refers, ensure the correct one is being used (see the next item below).
3.6. COPYRIGHTS AND LICENSE AGREEMENT
3.6.1. Identify any copyright notices displayed by the program. Verify that they are accurate and up to date.
3.6.2. In cases where an End-User License Agreement (EULA) is displayed by the program, which EULA will be used in this product? Provide a link to the file. Ensure that it is the consistent with the one included in the product.
3.6.3. Receive sign-off from the legal department that this is the correct EULA for this product.
3.7. UTILITY, TOOL KIT, AND COLLATERAL TESTS
3.7.1. If there are any additional products or components to be included in the final product, or on the distribution media, list the types of tests that will be carried out, and the extent to which they shall be performed.
3.8. INSTALL/UNINSTALL TESTS
3.8.1. How will deployment and installation be tested?
3.8.2. How will the uninstallation or rollback process be tested?
3.8.3. Since some form of deployment is required for all software products, what generic installation and uninstallation test catalogs will be used or adapted for these tests?
3.9. CODE COVERAGE
3.9.1. What tools or processes will be used to assure that each line of code is run at least once during testing?
3.9.2. Have the developers performed coverage tests during unit or integration testing? Have they provided the results of these tests? Have they provided source code, test harnesses, or test tools?
3.9.3. Are there plans to cover all code during regression testing? If not, why not?
3.10. YEAR 2000 AND DATE COMPLIANCE
3.10.1. Identify date and time values that are accepted, calculated, and output by the program. Pay attention both to hard dates and timespans.
3.10.2. What tests, if any, will be carried out to make sure the program will continue to work correctly when dates on both sides of the year 2000 are processed?
3.10.3. What tests, if any, will be run to ensure that other forms of date processing are done correctly?
3.11. INTERNATIONALIZATION
3.11.1. For products intended for global markets, what tests will be carried out to make sure the product can be easily localized (that is, adapted for a specific local market)? For products intended for Asian markets, what tests will be performed to verify that the program correctly handles multiple-byte character sets?
4. TEST SCHEDULE AND RESOURCES
4.1. Identify the estimated effort required to execute the test plan. Include a both a range and a confidence level. Use the guidelines on pp. 3.23 – 3.44 of the course book to plan and review estimates.
4.2. Identify the resources available to carry out the test plan.
4.3. Identify time or resource constraints that will lead to a risk of the test project falling behind schedule, below expected scope, or below expected quality. Cross-reference this with the Unresolved Issues and Risks section later in this document.
4.4. If any testing is to be handled by another entity, such as another department or a third party test lab, identify them. List names and contact information at the beginning of this document. List the specific tasks they will be assigned to carry out. Include references to contracts with these people, and ensure that contracts are approved and signed.
5. TEST PHASES AND COMPLETION CRITERIA
5.1. Detail the planned test cycles and phases; these should be linked to the development plan for the project. Specify the type of testing being done in each phase. Typically unit testing will be done by the developer of the code, and need not be covered in detail in the test plan. Integration and system testing phases should be detailed here.
5.2. Outline the criteria for assessing the severity of found defects. List expectations for setting the priorities on resolving them. Collaborate with the developer(s), project managers, and the customer representatives on this.
5.3. Identify in advance the criteria that must be fulfilled before each stage of testing can be considered complete. Make these specific, measurable, and decidable; otherwise, expectations will differ and time will be wasted on discussion and debate.
5.4. If there are to be staged releases of system testing – typically alpha for internal releases, beta for limited releases to external test sites, and final releases – sometime called “gold master”, define them. Define acceptance standards for each phase. Ideally these should be in a separate document that can be referred to here
Bear in mind that there is a chance that the standards set here are subject to being overruled by some authority or another; for example, a product may ship with a higher than satisfactory number of minor defects, at the behest of a marketing department or CFO that wants the product released with time as the most important consideration. Be prepared to accept such decisions dispassionately, but also be prepared to record them as failures to fulfill the standards set and agreed upon in advance. Companies and individuals can forget easily and repeat mistakes when there is no record of breached agreements and their consequences; people learn and improve more easily when records of successes and failures are available.
6. UNRESOLVED ISSUES AND RISKS
6.1. Identify issues that have yet to be decided as of this draft of the plan. Note these as risks to the schedule, scope, or quality of the test effort.
6.2. Identify other risks that may have an impact on the success of the plan. Use the risks outlined in the course book and the attached speaker notes as a guideline to identifying common risks. Refer also to the Software Project Survival Guide (Steve McConnell), which includes a good list of risks for every phase of development. When assessing risk, don’t be optimistic; the quality of the test plan and the risk assessment is weakened by failure to assess risk realistically.
7. TEST PLAN REVIEW
7.1. Include plans for review of this test plan. Identify the parties to review and approve the document, either within the test group or with another set of developers or test engineers. Look at sample test plan checklists, such as that on p. 3.45 – 3.47 of the course book, or those in Software Project Survival Guide. Use ideas from these checklists to develop your own checklists, appropriate to the size and scope of the product. Identify here the checklist(s) that will be used.
7.2. Meet with developers and customers or customer representatives to ensure that the test plan meets their requirements.
