Custom Search

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 from t1_base;

2. SQL> create table t2 as select from t1;

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 as select * from t1_base;

2. -- Recreate the table with correct column names...

create table t2 as select * from t1;

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 IDENTIFIED BY
/

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


1 The Process MaturityFramework

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

This is a sample of an outline for a test plan. It has been designed for medium to small test projects, and thus is fairly lightweight. It is by necessity general, because each enterprise, each development group, each testing group, and each development project is different. This outline should be used as a set of guidelines for creating your own standard template; add to it or subtract from it as you find appropriate. Bear in mind that it is generally better to have an excess of detail in the template—detail which can be removed when creating a specific test plan—than to have to remember to add something that is not in the template.

(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.

Monday, May 18, 2009

What is Alpha Testing?

Alpha testing is the software prototype stage when the software is first able to run. It will not have all the intended functionality, but it will have core functions and will be able to accept inputs and generate outputs. An alpha test usually takes place in the developer's offices on a separate system.

Any software that will be run on customer equipment must first be reviewed and approved by EPRI Corporate Software Quality. Be sure to discuss any exceptions with the Software Quality Manager for your EPRI sector.

The EPRI project manager utilizes this prototype to evaluate and provide input to the developer as the design evolves. Although software is usually not distributed to users prior to beta testing, selected end-users may also be involved. Usually, the most complex or most used parts of the code are developed more completely in the alpha, in order to enable early resolution of design questions.


The project manager collaborates with the developer to determine specific goals for alpha testing, and to integrate the results into evolving project plans.

In-depth software reliability testing, installation testing, and documentation testing are not done at alpha test time, as the software is only a prototype. Alpha tester feedback forms are not used, although the developer does request feedback on specific aspects of the software.

Setting Customer Expectations

If customers will receive alpha software, they must understand that the product will be only minimally functional, and is likely to have problems. The required review by EPRI Corporate Software Quality checks for the most serious problems, but customers must still be prepared for unexpected or frustrating experiences.

A letter or e-mail accompanying alpha software is strongly recommended. This letter should make customers aware of:

  • The software's limited functionality at this early stage
  • The likelihood of experiencing problems
Their mission: Find problems and provide feedback


Quality Team Involvement

It is understood that alpha software is not fully functional. However, EPRI Corporate Software Quality tests all software that is to be sent to users or run on customer equipment so that possible serious errors can be removed. Examples of such errors are software behavior that compromises a user's system, or presence of a virus. This pre-testing of alpha software that is sent to users will protect the reputation of EPRI software with customers.

If any end-users or customers will receive software for alpha evaluation, or if software will be run on customer equipment, be sure to send it first to EPRI Corporate Software Quality. This prior review and approval is required. Be sure to discuss any exceptions with the Software Quality Manager for your EPRI sector.



In order not to delay project schedules, EPRI Corporate Software Quality:

  • Uses e-mail notes rather than structured reports on alpha evaluations.
  • Works with project managers to complete alpha evaluations within the time needed.

If desired, the EPRI Corporate Software Quality will provide additional early usability feedback on an alpha stage software code, such as feedback on the proposed navigation scheme, and the look and feel of the software.

In general, expect a 6-8 day turnaround time for EPRI software testing. However, during peak periods such as September through December, turnaround may take longer depending upon the testing queue. Testing time will also vary with software size and complexity.

Common Problems

  • Customer expectations surrounding Alpha software have not been appropriately set, and customers are disappointed at the limited functionality and problems encountered.
  • Software sent to users or run on customer equipment is not tested by EPRI Corporate Software Quality beforehand.



In Software Development there are a few different phases of software releases: Alpha Release, Beta Release, and Final Release. Let’s break it down...

Alpha Software

Alpha Software is the first major release of software for the public to use. Since it is the first major release, it often times has many unknown bugs.

If you use alpha software you should not be dependent on your computer as alpha software could possible cause unexpected things to happen with your system(s). It is also a good idea to have a general understanding of software testing.

Why release buggy software to the public? By releasing this software to the public, we can reach a substantial amount of people who will be willing to submit detailed information about their experience with the software as well as bug reports. Once we receive a bug report, we immediately create a fix or workaround for the next release of the software.

At SodaBush, we do a great deal of testing before we release any Alpha Software. This way we limit the amount of bugs in what should normally be a very buggy phase of software.

Beta Software

Beta Software is the second major release of software for the public to use. It works much the same as alpha software except that it should, hopefully, have fewer bugs, be more stable, and easier to work with. Keep in mind that no software ever is fully debugged. But, with your help, we can try to remove as many bugs as possible, creating a better experience for everyone using the software overall.

Final Software

Final Software is the final major release of software for the public to use. This is the phase which all software one day reaches. Final release software has been tested on several machines and has many, hopefully all, of the major bugs fixed.

During this phase of software development software becomes widely available as a freeware or shareware product.

Telling the Difference

On our site, we label all of our software accordingly. If you see “Alpha” after the name of a piece of software, it would mean that the software is currently alpha testing. (i.e. “Hyper Color v1.00 Alpha 1.”) Likewise with “Hyper Color v1.00 Beta 1,” you will know it is beta software. Software which does not indicate alpha or beta is a final version.

Bottom Line

What is the difference between Alpha, Beta, and Final software? When you boil it down, you can simply view the differences as...

Final = Least Buggy
Beta = Buggy
Alpha = Most Buggy

a stage of software development where the software is first tested for bugs by real users. In contrast to beta testing, alpha software is usually assumed to have some significant bugs or unimplemented portions.

Step Overview (http://www.epri.com/eprisoftware/processguide/testinteg.html)

The main objective of testing is to show with a high level of confidence that the software application meets the acceptance criteria: function, performance, usability, features, and capabilities.
The developer is expected to thoroughly test software for both functionality and usability before submitting it to EPRI for final acceptance testing.

Software testing tests the software itself, but it also tests documentation, operator or user interfaces, and reports. What is also indirectly tested are the development team, the technical and project management, the application development tools, and the software development rules and guidelines. In sum, much more is tested than just the software product itself.

Tasks In This Step

These are the tasks of the Test and Integration step. For more background, see the Background Material section below.

  • Alpha Test by Developer - Describes alpha testing, and when EPRI Corporate Software Quality review is required.
  • Alpha Test (Required if Alpha version going to customers) - Describes alpha testing, and when EPRI Corporate Software Quality review is required.
  • Beta Test (Required for all software going to customers) - Overview, implementation tips, downloadable Beta Tester Feedback form.

Common Problems

  • Alpha software that is run outside the developer's shop is not reviewed by EPRI Corporate Software Quality before it is sent to customers.
  • Beta testing is not done, or is not complete enough to identify key problems.
Insufficient usability testing is done by the developer prior to submitting final software to EPRI Corporate Software Quality.