Pages

Tuesday 10 February 2015

Types of Testing in Software Testing

Types of Testing in Software Testing

1.     Describe cyclomatic complexity with example.
Cyclomatic complexity is a software metric that measure the logical strength of the program. It was developed by Thomas J. McCabe. Cyclomatic complexity is calculated by using the control flow graph of the program. In the flow graph, nodes are represented by circle. Areas bounded by edges and nodes are called regions. When counting regions, we also include the area outside the graph as a region.
Complexity is computed in one of three ways:
The total number of regions of the flow graph.
By using the formula defined as:
V(G) = E - N + 2
Cyclomatic complexity, V(G), for a flow graph, G, is also defined as
V(G) = P + 1 ,where P is the number of predicate nodes contained in the flow graph G.
Note: Nodes that contain a condition is called a predicate node and is characterized by two or more edges originating from it.

Find out the Cyclomatic complexity V(G) of the given below flow graph.

Description: http://www.careerride.com/images/testing-interview-1.png
In the above flow graph there are total 9 nodes, 11 edges, and 4 regions.
1. The flow graph has four regions. 
2. V (G) = 11 edges- 9 nodes + 2 = 4.
 
3. V (G) = 3 predicate nodes + 1 = 4.

Control flow graph
Control flow graph enables developers to determine the independent execution paths and design the tests to validate these paths . Using this , the testers can assure that all the paths have been tested at least once in the white box testing .
Example :
 int check_age(int age)
   {
    if (age < 50)
       printf(“you are pretty young \n”);
Else
     {
      if (age <80 )
           printf( “you are old \n”);
      else
          printf(“you are really old \n”);
    }
Return 0;
  }
Here e=7, n=6 hence independent execution paths are 3.


2.     Describe Condition testing in brief.
Condition testing works on logical conditions contained in a program module. A simple condition is a Boolean variable or a relational expression. A relational expression takes the form
E1 <relational-operator>E2
For Example Where E1 and E2 are arithmetic expressions and <relational-operator> is one of the following: <, ≤, =, ≠ (not equal to), >, or ≥. A compound condition is created by using two or more simple conditions, Boolean operators, and parentheses. Conditional error is generated if Boolean variable, relational operator or Boolean operator is incorrectly used.
The purpose of condition testing is to detect errors in the conditions of a program.
3.     What are white-box, black-box and gray-box testing?
Whit-box Testing: It refers to the testing a system with full knowledge and access to all source code and other architecture documents. This testing enables to reveal bugs and vulnerabilities quickly in comparison with trial and error method. More complete testing coverage is ensured by exactly knowing what to test.
Ø  Statement Coverage.
Ø  Try to cover 100% of statement coverage of the code.
Ø  Testing the every possible statement in the code is executed atleast once.
Ø  Cantata++ tool is used to test this coverage.
Ø  Decision Coverage.
Ø  Try to cover 100% of statement coverage of the code.
Ø  Testing the every possible decision conditions like for loop and other conditional loops in the code is executed at least once.       
Ø  TCAT-PATH is used to test this coverage.
Ø  Condition Coverage.
Ø  Try to cover 100% Condition coverage of the code.
Ø  Testing the every possible conditions in the code is executed at least once.
Black-box Testing: It refers to testing a system without knowledge of specification to the internal workings of the system, access to the source code, and knowledge of the architecture. Essentially this approach mimics in a close approach, how an attacker typically follows approach to the application. However, the uncovering of issues or vulnerabilities could be further longer, because of lacking internal application knowledge.
Gray-box Testing: It refers to a testing system by knowing limited information about the internals of the system. The knowledge is always limited for detailed design documents and architecture diagrams. In concise, it is a good blend of black and white box testing, which leverage the strengths of each.
4.     What is Big-bang testing?
Big bang waterfall model delivers the complete solution once and in one go. That’s why it’s termed Big Bang.
Following is the approach:
  • Customer provides complete overall requirements.
  • Design follows
  • The design is built / developed.
  • The development work is tested.
  • The system is implemented.
One should go with Big bang waterfall model if:
  • Contract of work is completely defined and accurate.
  • Requirement and acceptance criteria is completely defined and accurate
  • It is feasible to finish the work within given constraints.
  • No change in requirements is expected.
  • Problem and proposed solution both are clearly understood by all stakeholders.
  • No mistakes can occur in requirements, design phases.
5.     Difference between Verification and Validation?
Verification - is to determine the right thing, which involves the testing the implementation of right process. Ex: Are we building the product right?
Validation - is to perform the things in right direction, like checking the developed software adheres the requirements of the client. Ex: right product was built
6.     Difference between Pilot and Beta Testing.
Pilot testing involves having a group of end users try the system prior to its full deployment in order to give feedback on its performance.
Beta testing is testing of the product in the user environment.
From the definitions, it is evident that beta testing comes at last in development cycle; whereas pilot testing takes place before deployment of the system. Also, beta testing takes place in real time user environment and pilot testing in development environment. A selected group of users do pilot testing whereas beta testing is carried by all users.

 

 

7.     What is Equivalence Partitioning?
Equivalence Partitioning (EP) is the process of methodically reducing the huge set of possible test cases into a much smaller but still equally effective set. The goal of EP is to reduce the set of possible test cases into a smaller, manageable set that still adequately tests the software. Since we are choosing not to test everything, we are taking on risk. So we need to be careful how to choose classes. Also note that EP is a set of test cases that test the same thing or reveal the same bug.
Example: If a student’s Mark Sheet s/w takes numbers only from 0 to 100, we need to check that the system takes all the numbers between 0 and 100 (including both) and it does not take any other number. Now if we have to verify this, ideally we need to make sure system accepts all numbers from 0 to 100 and it does not accept any number <0 and > 100. Testing all these numbers is practically impossible because we can’t test for all number from 0 to -8 and from 101 to +8. So we could partition the i/p data into 2 classes: Valid and Invalid. Where valid class would include all the numbers between 0 to 100 (including both) and invalid class would include numbers <0 and > 100. Thus, we can test for few entries from both the classes and safely say that the s/w works for all the numbers.
8.     Explain Structure-based testing techniques
- Structure-based testing techniques are also termed as white-box testing techniques.
- These are dynamic techniques. 
- They use the internal structure of the software to derive test cases. 
- They are usually termed as 'white-box' or 'glass-box' techniques 
- They need you to have knowledge of how the software is implemented and how it works.
9.     Explain component testing.
- Component testing is also termed as unit, module or program testing. 
- It looks for defects in the software and verifies its functioning. 
- It can be done in isolation from rest of the system depending on the context of the development life cycle and the system. 
- Mostly stubs and drivers are used to replace the missing software and simulate the interface between the software components in a simple manner.
- The stub is called from the software component to be tested while a driver calls a component to be tested.




    10. Explain exploratory testing.

- In exploratory testing approach testers are involved in minimum planning and maximum test execution.
- The planning includes creation of a test charter, a short declaration of the scope of a short time-boxed test effort, the objectives and possible approaches to be used. 
- The test design and test execution are performed parallelly without any formal documentation of test conditions, test cases or test scripts. However, this does not imply that other more formal testing techniques will not be used.

   11. Differentiate between re-testing and regression testing

Regressions testing: 
- It means testing new bug fixes to ensure that they don’t cause problems to occur involving problems fixed earlier. 
- The process here involves running a suite of tests. 
Re-testing: 
- It means testing a single defect that was just fixed. Only one test is performed here. 
- The target is to ensure that the defect that was just fixed was actually fixed properly. 

 


No comments:

Post a Comment