Monday, December 17, 2012

Testing Methods and Methodologies

Static and Dynamic Analysis 

Static Analysis focuses on the range of methods that are used to determine or estimate software quality without reference to actual executions.  Techniques in this area include code inspection, program analysis, symbolic analysis, and model checking.

Dynamic Analysis deals with specific methods for ascertaining and/or approximating software quality through actual executions, i.e., with real data and under real (or simulated) circumstances.  Techniques in this area include synthesis of inputs, the use of structurally dictated testing procedures, and the automation of testing environment generation.


TESTING METHODS :

Test cases are developed using various test techniques to achieve more effective testing. By this, software completeness is provided and conditions of testing which get the greatest probability of finding errors are  chosen. So, testers do not guess which test cases to chose, and test techniques enable them to design testing conditions in a systematic way. Also, if one combines all sorts of existing test techniques, one will obtain better results rather if one uses just one test technique.

Software  can be tested in two ways, in another words, one can distinguish two different methods:
1. Black box testing, and
2. White box testing.

White box testing is highly effective in detecting and resolving problems, because bugs (bug or fault is a manifestation of an error in a software), can often be found before they cause trouble. We can shortly define this method as testing software with the knowledge of the internal structure and coding inside the program . White box testing is also called white box analysis, clear box testing or clear box analysis. It is a strategy for software debugging (it is the process of locating and fixing bugs in computer program code or the engineering of a hardware device),in which the tester has excellent knowledge of how the program components interact. This method can be used for Web services applications, and is rarely practical for debugging in large systems and networks. Besides, white box testing is considered as a security testing (the process to determine that an  information system protects data and maintains functionality as intended), method that can be used to validate whether code implementation follows intended design, to validate implemented security functionality, and to uncover exploitable vulnerabilities.

Black box testing is testing software based on output requirements and without any knowledge of the internal structure or coding in the program . In another words, a black box is any device whose workings are not understood by or accessible to its user. For example, in telecommunications, it is a resistor connected to a phone line that makes it impossible for the telephone company’s equipment to detect when a call has been answered. In data mining, a black box is an algorithm that doesn't provide an explanation of how it works. In film–making, a black box is a dedicated hardware device:  equipment that is specifically used for a particular function, but in the financial world, it is a computerized trading system that doesn't make its rules easily available. In recent years, the third testing method has been also considered  Gray box testing.  It is defined as testing software while already having some knowledge of its underlying code or logic .  It is based on the internal data structures and algorithms for designing the test cases more than black box testing but less than white box testing.  This method is important when conducting integration testing between two modules of code written by two  different developers, where only interfaces are exposed for test. Also, this method can include reverse engineering to determine boundary values.

Gray box testing is non-intrusive and unbiased because it doesn't require that the tester have access to the source code.The main characteristics and comparison between white box testing and black box testing are follows.

Black Box Testing Versus White Box Testing:

Black Box Testing:
 Performing the tests which exercise all functional requirements of a program;
 Finding the following errors:
1. Incorrect or missing functions;
2. Interface errors;
3. Errors in data structures or external database access;
4. Performance errors;
5. Initialization and termination errors.
 Advantages of this method:
 The number of test cases are reduced to achieve reasonable testing;
 The test cases can show presence or absence of classes of errors.

White Box Testing:
 Considering the internal logical arrangement of software;
 The test cases exercise certain sets of conditions and loops;
 Advantages of this method:
 All independent paths in a module will be exercised at least once;
 All logical decisions will be exercised;
 All loops at their boundaries will be executed;
 Internal data structures will be exercised to maintain their validity

Equivalence Partitioning:

This technique divides the input domain of a program onto equivalence classes.
Equivalence classes – set of valid or invalid states for input conditions, and can be defined in the following way:
1. An  input condition specifies a range → one valid and two invalid equivalence classes are defined;
2. An input condition needs a specific value → one valid and two invalid equivalence classes are defined;
3. An input condition specifies a member of a set → one valid and one invalid equivalence class are defined;
4. An input condition is Boolean  → one valid and one invalid equivalence class are defined.

Well, using this technique, one can get test cases which identify the classes of errors.

Boundary Value Analysis

This technique is like the technique Equivalence Partitioning, except that for creating the test cases beside  input domain use output domain.
One can form the test cases in the following way:
1. An input condition specifies a range bounded by values a and b  → test cases should be made with values just above and just below a and b, respectively;
2. An input condition specifies various values → test cases should be produced to exercise the minimum and maximum numbers;
3. Rules 1 and 2  apply to output conditions;
If internal program data structures have prescribed boundaries, produce test cases to exercise that data structure at its boundary.

What is Software Testing Methodologies?


In the field of Software testing we use different types of Software Testing Methodologies. In today’s Software Testing Class, we will see what all Software Testing Methodologies & software testing technique is used in the day today software testing life cycle.

In the Software Development Process different software development approaches are used. A software development process also known as a Software Development Life Cycle (SDLC).

Each process model has its own advantages & disadvantages, the choosing of model is based on the requirement & need of your project to do the success in process of software development.
Here are the few commonly used Software Development Life Cycle used in actual testing:

  1. Waterfall model
  2. V model
  3. Agile model
  4. Spiral model
  5. RUP
  6. RAD
1. Waterfall Model

The Waterfall Model approach is most basic life cycle model, which is the first Process Model begins and used broadly in Software Development to make sure project success. This model is developed by Winston Royce in the early 1970. Waterfall model is software development process sequential process, as flowing progressively downwards like waterfall via multiple phases & these simple sequence of phases has its own defines activities and goals. The Waterfall model is divided into following separate phases:


  • Requirement Gathering & Analysis phase,
  • Software Design,
  • Implementation and Testing
  • Maintenance
All these phases are the sequential phases & next step is totally depends on the previous step, so that second phase is begins as only if the defined set of objectives and goals are completed first.

The stages of “The Waterfall Model” are:

Requirement Gathering & Analysis:
This is the starting phase of the SDLC in which all possible system requirements are captured & analyzed. Software requirements specification includes the complete information about how actual end users are expecting from the system. This document covers all the necessary requirements for the development of project. Finally after completion of requirement gathering & analysis (validation of requirement against the user needs), a Requirement Specification document is created which give out as a input to the next phase of SDLC. In this model once we moved to the next phase then it won’t possible to add or update the requirements.

System & Software Design: Prior to start actual coding, it is mandatory to be aware of what all features we are going to implement & how it would look like? The requirement specifications document created in the first phase is used as the input to this phase & based on this the system design specifications would be prepared. In which all hardware & system requirements would be specified. The system design specifications document prepared in this phase is used as input for the Implementation & Testing phase model.

Implementation & Unit Testing: Upon getting the system design specifications document the actual coding would be started. Before starting the actual coding requirements are divided into the models/units. In the actual coding the initially develop the small programs called units. After implementing all units the integration would be started in the next phase. The developed unit’s model functionality is tested separately in this phase to check whether the unit models are meets the specified requirements & this individual model testing is called as Unit Testing.

Integration & System Testing: In the previous model the system requirements are divided into models & each model is developed & tested separately. In this phase all units are integrated & done the system testing to check whether the all models/units are integrated properly or not & the system as whole doing as mention as per the system requirement document, so we call this phase as the Integration & System Testing. Upon complete testing of software is done then actual Software is successfully send to customer.

Operations & Maintenance: This phase is the never ending phase of the Waterfall Model. The problems are comes in picture after Implementation & Unit Testing phase. The issues found after the implementation phase i.e. not found in the period of the development life cycle. Some of the issues are not catch after testing cycle done so those are implemented in the maintenance phase, so this phase is called as Operations & Maintenance phase.

Advantages and Disadvantages of Waterfall Model:

Advantages of Waterfall Model:
  1. This is linear simple model to implement & easy to maintain.
  2. In the SDLC initial phase spent time on reviewing requirements and design which saves the time later.
  3. Required resources are minimum in this model as compare to other.
  4. After every phase of the model a document in created which help & simpler to understand & design the system.
  5. Upon completion of coding, is done to check for implemented code or correctness of system.
  6. For each stage deadlines can be set which will help to develop the system on decided time frame.
Disadvantages of Waterfall Model: 
  1. The biggest disadvantages of such system is it won’t allow to go back. If the problems in the design phase which creates complication in the implementation phase.
  2. This model is rigid model. Not flexible & make changes is not possible in the development of system.
  3. Unable to start the next phase before completing the previous phase so time consuming.
  4. In the deployment phase all requirements are not covered or all requirements are not cover so adding such requirements may create unsuitable system.
  5. To make it customer happy such new requirement need to be implemented in new version of system which leads to added cost to system development.
2. V-Model 

In the basic Waterfall model process seen some disadvantages or limitations in the model which started a new SDLC model. As we seen in the Waterfall model the issues found in the end of the SDLC, this is due to the testing is occurred in the end phases of the you SDLC. To overcome this problem the V-Model is comes into the picture. It is always better to introduce testing in the early phase of SDLC, as in this model the testing activity gets started from the early phase of the SDLC.


Before starting the actual testing, testing team has to work on various activities like preparation of Test Strategy, Test Planning, Creation of Test cases & Test Scripts which is work parallel with the development activity which help to get the test deliverable on time.

In the V Model Software Development Life Cycle, based on same information(requirement specification document) the development & testing activity is started. Based on the requirement document developer team started working on the design & after completion on design start actual implementation and testing team starts working on test planning, test case writing, test scripting. Both activities are working parallel to each other. In Waterfall model & V-model they are quite similar to each other. As it is most popular Software Testing Life Cycle model so most of the organization is following this model.

The V-model is also called as Verification and Validation model. The testing activity is perform in the each phase of Software Testing Life Cycle phase. In the first half of the model validations testing activity is integrated in each phase like review user requirements, System Design document & in the next half the Verification testing activity is come in picture.

Typical V-model shows Software Development activities on the Left hand side of model and the Right hand side of the model actual Testing Phases can be performed.

In this process “Do-Procedure” would be followed by the developer team and the “Check-Procedure” would be followed by the testing team to meets the mentioned requirements.

In the V-Model software development life cycle different steps are followed however here we will taking a most common type of V-model example. The V-model typically consist of the following phases:

1. Unit Testing: Preparation of Unit Test Cases
2. Integration Testing: Preparation of Integration Test Cases
3. System Testing: Preparation of System test cases
4. Acceptance Testing: Preparation of Acceptance Test Cases


Agile Methodology

What Is Agile?
Agile methodology is an alternative to traditional project management, typically used in software development. It helps teams respond to unpredictability through incremental, iterative work cadences, known as sprints. Agile methodologies are an alternative to waterfall, or traditional sequential development.


There are two methods by which this methodology can be implemented:-
  1. Scrum
  2. Extreme Programming
Scrum: Each iteration would called a scrum which can be a 1-2 Months.In Scrum Client prioritise his requirements what he want first. If developer did not meets all the requirement which was being fixed for a particular scrum than rest of the development part would be transferred to the next scrum (would be delivered in the next build),  means developer can't increase time decided for a scrum.Its fixed.

Extreme Programming (XP): here iteration period would be less then in scrum , which is being 2-4 weeks.Here developer prioritise what to do first on the basis of client requirement. This duration which was being fixed for a iteration, can be increase if the some development part is still pending. The build would deployed with having all the client needs.Thus iteration period is not fixed here it can be increase. at iteration should meets all the client's requirement in this build.

More attension is required for testing in XP.

14 comments:


  1. I actually enjoyed reading through this posting.Many thanks.

    Function Point Estimation Training

    ReplyDelete
  2. This was an awesome information for me thanks for sharing with us. This one is very important knowledge for all of us.

    python training in pune
    python classes in pune
    python institutes in pune
    python training institutes in pune

    ReplyDelete