Google
 

Saturday, March 1, 2008

Software testing

Introduction :
Software testing is an empirical technical investigation conducted to provide stakeholders with information about the quality of the product or service under test , with respect to the context in which it is intended to operate. This includes, but is not limited to, the process of executing a program or application with the intent of finding errors. Quality is not an absolute; it is value to some person. With that in mind, testing can never completely establish the correctness of arbitrary computer software; testing furnishes a criticism or comparison that compares the state and behaviour of the product against a specification. An important point is that software testing should be distinguished from the separate discipline of Software Quality Assurance (S.Q.A.), which encompasses all business process areas, not just testing.
Over its existence, computer software has continued to grow in complexity and size. Every software product has a target audience. For example, a video game software has its audience completely different from banking software. Therefore, when an organization develops or otherwise invests in a software product, it presumably must assess whether the software product will be acceptable to its end users, its target audience, its purchasers, and other stakeholders. Software testing is the process of attempting to make this assessment.

How Software Defects arise ?
The International Software Testing Qualifications Board says that software faults occur through the following process:
A human being can make an error (mistake), which produces a defect (fault, bug) in the code, in software or a system, or in a document. If a defect in code is executed, the system will fail to do what it should do (or do something it shouldn’t), causing a failure. Defects in software, systems or documents may result in failures, but not all defects do so.
A fault can also turn into a failure when the environment is changed. Examples of these changes in environment include the software being run on a new hardware platform, alterations in source data or interacting with different software.

Inability to find all faults:
A problem with software testing is that testing all combinations of inputs and preconditions is not feasible when testing anything other than a simple product. This means that the number of defects in a software product can be very large and defects that occur infrequently are difficult to find in testing.
More significantly, parafunctional dimensions of quality--for example, usability, scalability, performance, compatibility, reliability--can be highly subjective; something that constitutes sufficient value to one person may be intolerable to another.

When Testing is Carried Out ?
A common practice of software testing is that it is performed by an independent group of testers after the functionality is developed but before it is shipped to the customer.This practice often results in the testing phase being used as project buffer to compensate for project delays, thereby compromising the time devoted to testing. Another practice is to start software testing at the same moment the project starts and it is a continuous process until the project finishes.
Another common practice is for test suites to be developed during technical support escalation procedures.Such tests are then maintained in regression testing suites to ensure that future updates to the software don't repeat any of the known mistakes.

Finding Faults Early in the Process:
It is commonly believed that the earlier a defect is found the cheaper it is to fix it. This is reasonable based on the risk of any given defect contributing to or being confused with further defects later in the system or process. In particular, if a defect erroneously changes the state of the data on which the software is operating, that data is no longer reliable and therefore any testing after that point cannot be relied on even if there are no further actual software defects.
In counterpoint, some emerging software disciplines such as extreme programming and the agile software development movement, adhere to a "test-driven software development" model. In this process unit tests are written first, by the software engineers (often with pair programming in the extreme programming methodology). Of course these tests fail initially; as they are expected to. Then as code is written it passes incrementally larger portions of the test suites. The test suites are continuously updated as new failure conditions and corner cases are discovered, and they are integrated with any regression tests that are developed.
Unit tests are maintained along with the rest of the software source code and generally integrated into the build process (with inherently interactive tests being relegated to a partially manual build acceptance process).
The software, tools, samples of data input and output, and configurations are all referred to collectively as a test harness.

Measuring Software Testing:
Usually, quality is constrained to such topics as correctness, completeness, security, but can also include more technical requirements as described under the ISO standard ISO 9126, such as capability, reliability, efficiency, portability, maintainability, compatibility, and usability.

Static and Dynamic Testing:
There are many approaches to software testing, but effective testing of complex products is essentially to connote the dynamic analysis of the product—putting the product through its paces. Sometimes one therefore refers to reviews, walkthroughs or inspections as static testing, whereas actually running the program with a given set of test cases in a given development stage is often referred to as dynamic testing, to emphasize the fact that formal review processes form part of the overall testing scope.

Code coverage:
Code coverage measures aim to show the degree to which the source code of a program has been tested. It is inherently a white box testing activity because it looks at the code directly. This allows the software team to examine parts of a system that are rarely tested and ensures that the most important function points have been tested.Two common forms of code coverage are statement coverage, which reports on the number of lines executed, and path coverage, which reports on the branches executed to complete the test. They both return a coverage metric, measured as a percentage.

Software Testing Measurements:
There are a number of common software measures, often called "metrics", which are used to measure the state of the software or the adequacy of the testing:

*Bugs found per Tester per unit time (Day/Week/Month)*Total bugs found in a release
*Total bugs found in a module / feature
*Bugs found / fixed per build
*Number of customer reported Bug - As a measure of testing effectiveness
* Bug trend over the period in a release (Bugs should converge towards zero as the project gets closer to release) (It is possible that there are more cosmetic bugs found closer to release - in which case the number of critical bugs found is used instead of total number of bugs found)
* Number of test cases executed per person per unit time
* % of test cases executed so far, total Pass, total fail
* Test Coverage

History :
The separation of debugging from testing was initially introduced by Glenford J. Myers in 1979. Although his attention was on breakage testing ,it illustrated the desire of the software engineering community to separate fundamental development activities, such as debugging, from that of verification. Dr. Dave Gelperin and Dr. William C. Hetzel classified in 1988 the phases and goals in software testing in the following stages:
Until 1956 - Debugging oriented
1957-1978 - Demonstration oriented
1979-1982 - Destruction oriented
1983-1987 - Evaluation oriented1988-2000 - Prevention oriented
2000 - onwards - Early Customer intervention (Beta testing)

White box, black box, and grey box testing:
White box and black box testing are terms used to describe the point of view that a test engineer takes when designing test cases.
Black box testing treats the software as a black-box without any understanding as to how the internals behave. It aims to test the functionality according to the requirements.[18] Thus, the tester inputs data and only sees the output from the test object. This level of testing usually requires thorough test cases to be provided to the tester who then can simply verify that for a given input, the output value (or behaviour), is the same as the expected value specified in the test case.
White box testing, however, is when the tester has access to the internal data structures, code, and algorithms. For this reason, unit testing and debugging can be classified as white-box testing and it usually requires writing code, or at a minimum, stepping through it, and thus requires more knowledge of the product than the black-box tester. If the software in test is an interface or API of any sort, white-box testing is almost always required.
In recent years the term grey box testing has come into common usage. This involves having access to internal data structures and algorithms for purposes of designing the test cases, but testing at the user, or black-box level. Manipulating input data and formatting output do not qualify as grey-box because the input and output are clearly outside of the black-box we are calling the software under test. This is particularly important when conducting integration testing between two modules of code written by two different developers, where only the interfaces are exposed for test.

Verification and validation:
Software testing is used in association with verification and validation (V&V):
Verification: Have we built the software right (i.e., does it match the specification)? Software testing is just one kind of verification, which also uses techniques such as reviews, inspections, and walkthroughs.
Validation: Have we built the right software (i.e., is this what the customer wants)?

Stages of testing:
Pre Release:
Unit testing tests the minimal software component, or module. Each unit (basic component) of the software is tested to verify that the detailed design for the unit has been correctly implemented. In an Object-oriented environment, this is usually at the class level, and the minimal unit tests include the constructors and destructors. Integration testing exposes defects in the interfaces and interaction between integrated components (modules). Progressively larger groups of tested software components corresponding to elements of the architectural design are integrated and tested until the software works as a system.Functional testing tests at any level (class, module, interface, or system) for proper functionality as defined in the specification. The use of a traceability matrix often helps with functional testing.System testing tests a completely integrated system to verify that it meets its requirements.System integration testing verifies that a system is integrated to any external or third party systems defined in the system requirements.Performance Testing validates whether the quality of service (sometimes called Non-functional requirements) parameters defined at the requirements stage is met by the final product.Acceptance testing can be conducted by the end-user, customer, or client to validate whether or not to accept the product. Acceptance testing may be performed as part of the hand-off process between any two phases of development.

Post Release:
Alpha testing is simulated or actual operational testing by potential users/customers or an independent test team at the developers' site. Alpha testing is often employed for off-the-shelf software as a form of internal acceptance testing, before the software goes to beta testing. Beta testing comes after alpha testing. Versions of the software, known as beta versions, are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. Sometimes, beta versions are made available to the open public to increase the feedback field to a maximal number of future users. It should be noted that although both Alpha and Beta are referred to as testing it is in fact use immersion. The rigors that are applied are often unsystematic and many of the basic tenets of testing process are not used. The Alpha and Beta period provides insight into environmental and utilization conditions that can impact the software.

Certification:
Several certification programs exist to support the professional aspirations of software testers and quality assurance specialists. No certification currently offered actually requires the applicant to demonstrate the ability to test software. No certification is based on a widely accepted body of knowledge. This has led some to declare that the testing field is not ready for certification.[26] Certification itself cannot measure an individual's productivity, their skill, or practical knowledge, and cannot guarantee their competence, or professionalism as a tester.
Certifications can be grouped into: exam-based and education-based. Exam-based certifications: For these there is the need to pass an exam, which can also be learned by self-study: e.g. for ISTQB or QAI. Education-based certifications are instructor-led sessions, where each course has to be passed, e.g. IIST (International Institute for Software Testing).

Testing certifications:
*Certified Software Tester (CSTE) offered by the Quality Assurance Institute (QAI)
*Certified Software Test Professional (CSTP) offered by the International Institute for Software Testing
*CSTP (TM) (Australian Version) offered by K. J. Ross & AssociatesCATe offered by the International Institute for Software Testing
*ISEB offered by the Information Systems Examinations Board Certified Tester,
*Foundation Level (CTFL) offered by the International Software Testing Qualification Board Certified Tester,
*Advanced Level (CTAL) offered by the International Software Testing Qualification Board

Quality assurance certifications:
*CSQE offered by the American Society for Quality (ASQ)
*CSQA offered by the Quality Assurance Institute (QAI)

Roles in software testing:
Software Testing can be done by software testers. Until the 1950s the term software tester was used generally, but later it was also seen as a separate profession. Regarding the periods and the different goals in software testing there have been established different roles: test lead/manager, tester, test designer, test automater/automation developer, and test administrator.

Relationship with Software Quality Assurance:
Software testing may be viewed as an important part of the Software Quality Assurance (SQA) process.In SQA, software process specialists and auditors take a broader view on software and its development. They examine and change the software engineering process itself to reduce the amount of faults that end up in defect rate. What constitutes an acceptable defect rate depends on the nature of the software. An arcade video game designed to simulate flying an airplane would presumably have a much higher tolerance for defects than software used to control an actual airliner. Although there are close links with SQA testing departments often exist independently, and there may be no SQA areas in some companies.

Testing interview questions

What's Ad Hoc Testing ?
A testing where the tester tries to break the software by randomly trying functionality of software.
What's the Accessibility Testing ?
Testing that determines if software will be usable by people with disabilities.
What's the Alpha Testing ?
The Alpha Testing is conducted at the developer sites and in a controlled environment by the end user of the software.
What's the Beta Testing ?
Testing the application after the installation at the client place.
What is Component Testing ?
Testing of individual software components (Unit Testing).
What's Compatibility Testing ?
In Compatibility testing we can test that software is compatible with other elements of system.
What is Concurrency Testing ?
Multi-user testing geared towards determining the effects of accessing the same application code, module or database records. Identifies and measures the level of locking, deadlocking and use of single-threaded code and locking semaphores.
What is Conformance Testing ?
The process of testing that an implementation conforms to the specification on which it is based. Usually applied to testing conformance to a formal standard.
What is Context Driven Testing ?
The context-driven school of software testing is flavor of Agile Testing that advocates continuous and creative evaluation of testing opportunities in light of the potential information revealed and the value of that information to the organization right now.
What is Data Driven Testing ?
Testing in which the action of a test case is parameterized by externally defined data values, maintained as a file or spreadsheet. A common technique in Automated Testing.
What is Conversion Testing ?
Testing of programs or procedures used to convert data from existing systems for use in replacement systems.
What is Dependency Testing ?
Examines an application's requirements for pre-existing software, initial states and configuration in order to maintain proper functionality.
What is Depth Testing ?
A test that exercises a feature of a product in full detail.
What is Dynamic Testing ?
Testing software through executing it. See also Static Testing.
What is Endurance Testing ?
Checks for memory leaks or other problems that may occur with prolonged execution.
What is End-to-End testing ?
Testing a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.
What is Exhaustive Testing ?
Testing which covers all combinations of input values and preconditions for an element of the software under test.
What is Gorilla Testing ?
Testing one particular module, functionality heavily.
What is Installation Testing ?
Confirms that the application under test recovers from expected or unexpected events without loss of data or functionality. Events can include shortage of disk space, unexpected loss of communication, or power out conditions.
What is Localization Testing ?
This term refers to making software specifically designed for a specific locality.
What is Loop Testing ?
A white box testing technique that exercises program loops.
What is Mutation Testing ?
Mutation testing is a method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation requires large computational resources.
What is Monkey Testing ?
Testing a system or an Application on the fly, i.e just few tests here and there to ensure the system or an application does not crash out.
What is Positive Testing ?
Testing aimed at showing software works. Also known as "test to pass". See also Negative Testing.
What is Negative Testing ?
Testing aimed at showing software does not work. Also known as "test to fail". See also Positive Testing.
What is Path Testing ?
Testing in which all paths in the program source code are tested at least once.
What is Performance Testing ?
Testing conducted to evaluate the compliance of a system or component with specified performance requirements. Often this is performed using an automated test tool to simulate large number of users. Also know as "Load Testing".
What is Ramp Testing ?
Continuously raising an input signal until the system breaks down.
What is Recovery Testing ?
Confirms that the program recovers from expected or unexpected events without loss of data or functionality. Events can include shortage of disk space, unexpected loss of communication, or power out conditions.
What is the Re-testing testing ?
Retesting- Again testing the functionality of the application.
What is the Regression testing ?
Regression- Check that change in code have not effected the working functionality.
What is Sanity Testing ?
Brief test of major functional elements of a piece of software to determine if its basically operational.
What is Scalability Testing ?
Performance testing focused on ensuring the application under test gracefully handles increases in work load.
What is Security Testing ?
Testing which confirms that the program can restrict access to authorized personnel and that the authorized personnel can access the functions available to their security level.
What is Stress Testing ?
Stress testing is a form of testing that is used to determine the stability of a given system or entity. It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results.
What is Smoke Testing ?
A quick-and-dirty test that the major functions of a piece of software work. Originated in the hardware testing practice of turning on a new piece of hardware for the first time and considering it a success if it does not catch on fire.
What is Soak Testing ?
Running a system at high load for a prolonged period of time. For example, running several times more transactions in an entire day (or night) than would be expected in a busy day, to identify and performance problems that appear after a large number of transactions have been executed.
What's the Usability testing ?
Usability testing is for user friendliness.
What's the User acceptance testing ?
User acceptance testing is determining if software is satisfactory to an end-user or customer.
What's the Volume Testing ?
We can perform the Volume testing, where the system is subjected to large volume of data.