Tuesday, July 1, 2008

Test Design & Technique - Summary

Test Design & Technique - Summary


•The test case techniques discussed so far need to be combined to form overall strategy
•Each technique contributes a set of useful test cases, but none of them by itself contributes a thorough set of test cases


Use of the following design strategy may not guarantee all errors are found but it represents a reasonable compromise
1. If the specification contains combinations of input conditions - start with cause-effect graphing
2. Identify valid and invalid equivalence classes for input and output and supplement the test cases
3. Use boundary value analysis
4. Use error guessing to add additional test cases


SDLC and V Model


•There are some distinct test phases that take place in each of the software life cycle activity
• It is easier to visualize through the famous Waterfall model of development and V- model of testing
• The V proceeds from left to right, depicting the basic sequence of development and testing activities

V Model

The model is valuable because it highlights the existence of several levels or phases of testing and depicts the way each relates to a different development phase.


Why Write Test Cases Before Coding?


•When adding a new feature or enhancing an existing solution, writing test cases forces you to think about what the code is supposed to accomplish.
•You end up with a clean and simple design that does exactly what you expect it to do.


Testing Phases


Unit testing is code-based and performed primarily by developers to demonstrate that their smallest pieces of executable code function suitably.
Integration testing demonstrates that two or more units or other integrations work together properly, and tends to focus on the interfaces specified in low-level design.


Unit Testing


•The most 'micro' scale of testing to test particular functions, procedures or code modules. Also called as Module testing.
•Typically done by the programmer and not by Test Engineers, as it requires detailed knowledge of the internal program design and code.
•Purpose is to discover discrepancies between the unit's specification and its actual behavior.
•Testing a form, a class or a stored procedure can be an example of unit testing


Integration Testing


•Testing of combined parts of an application to determine if they function together correctly.
•The main three elements are interfaces, module combinations and global data structures.
•Attempts to find discrepancies between program & its external specification (program’s description from the point of view of the outside world).
•Testing a module to check if the component of the modules are integrated properly is example of integration testing


Integration Testing


•Modules are integrated by two ways.
A)Non-incremental Testing (Big Bang Testing)
Each Module is tested independently and at the end, all modules are combined to form a application.
B)Incremental Module Testing.
There are two types by which incremental module testing is achieved.
A)Top down Approach
B)Bottom up Approach


•Top Down Incremental Module Integration:
Firstly top module is tested first. Once testing of top module is done then any one of the next level modules is added and tested. This continues till last module at lowest level is tested.


Integration approach can be done Depth first or Breadth-first.
Top down testing
• The main control module is used as a test driver
•Stubs are substituted for all components directly subordinate to the main control module.
•Depending on the approach subordinate stubs are replaced by actual components.


•Bottom Up Incremental Module Integration:
Firstly module at the lowest level is tested first. Once testing of that module is done then any one of the next level modules is added to it and tested. This continues till top most module is added to rest all and tested.


Bottom-Up testing
•Low-level components are combined into clusters (builds) that perform a specific sub function.
•A driver is written to coordinate test case input and output.
•Drivers are removed and clusters are combined moving upward in the program structure.


Verification and Validation


Verification
• Verification refers to a set of activities which ensures that software correctly implements a specific function.
• Purpose of verification is to check: Are we building the product right?
Example: code and document reviews , inspections, walkthroughs


Validation
•Purpose of Validation is to check : Are we building the right product?
•Validation refers to a different set of activities which ensures that the software that has been built is traceable to customer requirements.


Validation
•After each validation test has been conducted,one of two possible conditions exist:
1. The function or performance characteristics conform to specification and are accepted, or
2. Deviation from specification and a deficiency list is created.
Example : a series of black box tests that demonstrate conformity with requirements.

System Testing


•Test the software in the real environment in which it is to operate. (hardware,people,information,etc.)
•Observe how the system performs in its target environment, for example in terms of speed, with volumes of data, many users, all making multiple requests


•Test how secure the system is and how can the system recover if some fault is encountered in the middle of procession
•System Testing, by definition, is impossible if the project has not produced a written set of measurable objectives for its product.


Types of System Testing


•Performance
•Volume
• Background
• Stress
• Security
•Usability
• Recovery
• Documentation
• Configuration
• Installation



Performance Testing

Performance is the behavior of the system w.r.t. goals for time, space, cost and reliability.
Performance objectives:
• Throughput : The number of tasks completed per unit time. Indicates how much work has been done within an interval.
• Response time : The time elapsed during input arrival and output delivery.
• Utilization : The percentage of time a component(CPU, Channel, storage, file server) is busy.


•The objective of performance testing is to devise test case that attempts to show that the program does not satisfy its performance objectives.
•To ensure that the system is responsive to user interaction and handles extreme loading without unacceptable operational degradation.
•To test response time and reliability by increased user traffic.
•To identify which components are responsible for performance degradation and what usage characteristics cause degradation to occur


Volume Testing


This testing is subjecting the program to heavy volumes of data. For e.g.
Ø A compiler would be fed a large source program to compile.
Ø An operating systems job queue would be filled to full capacity.
Ø A file system would be fed with enough data to cause the program to switch from one volume to another.


Stress Testing


Stress testing involves subjecting the program to heavy loads or stresses. The idea is to try to “break” the system. That is, we want to see what happens when the system is pushed beyond design limits
It is not same as volume testing. A heavy stress is a peak volume of data encounters over a short time


•In Stress testing a considerable load is generated as quickly as possible in order to stress the application and analyze the maximum limit of concurrent users the application can support
•Stress tests executes a system in a manner that demands resources in abnormal quantity,frequency, or volume
Example :
1. Generate 5 interrupts when the average rate is 2 or 3
2. Increase input data rate
3. Test cases that require max. memory

Stress Tests should answer the following questions
•Does the system degrade gently or does the server shut down
•Are appropriate messages displayed ? E.g. Server not available
•Are transactions lost as capacity is exceeded
•Are certain functions discontinued as capacity reaches the 80 or 90 percent level

Security Testing


•Security Testing verifies that protection mechanisms built into the system will protect it from improper penetration.
•Security testing is the process of executing test cases that subvert the program’s security checks


Example :
•One tries to break the operating systems memory protection mechanisms
•One tries to subvert the DBMS’s data security mechanisms
•The role of the developer is to make penetration cost more than the value of the information that will be obtained


Localization Testing


Localization translates the product UI and occasionally changes some settings to make it suitable for another region
•The test effort during localization testing focuses on
Areas affected during localization, UI and content
Culture/locale-specific, language specific and region specific areas


Usability Testing- Human Computer Interactions


Usability is
•The effectiveness, efficiency and satisfaction with which specified users can achieve specified goals in a particular environment ISO 9241-11
•Effective–- Accomplishes user’s goal
•Efficient-- Accomplishes the goal quickly
•Satisfaction–- User enjoys the experience

No comments: