Unit 6 Material
Unit 6 Material
1. List set of guidelines for BVA. Also Explain merits and demerits of BVA.
BVA means Boundary value analysis is done to check boundary conditions.
A boundary value analysis is a testing technique in which the elements at the edge of the
domain are selected and tested.
Using boundary value analysis, instead of focusing on input conditions only the test cases
from output domain are also derived.
Boundary value analysis is a test case design technique that complements equivalence
partitioning technique.
Merits of BVA
It is easier and faster to find defects using this technique. This is because the density
of defects at boundaries is more.
Instead of testing will all set of test data, we only pick the one at the boundaries. So,
the overall test execution time reduces.
The test cases generated through BVA are very small.
BVA is the best approach in cases where the functionality of a software is based on
numerous variables representing physical quantities.
Easy to understand
Can control the expenses made on the testing
BVA is the best technique to test the functionality of a test case
Performs the best in revealing potential user input troubles
Demerits of BVA
This technique sometimes fails to test all the potential input values. And so, the
results are unsure.
The dependencies with BVA are not tested between two inputs.
This technique doesn’t fit well when it comes to Boolean Variables.
It only works well with independent variables that depict quantity.
Advantages:
White box testing is very thorough as the entire code and structures are tested.
It results in the optimization of code removing error and helps in removing extra lines
of code.
It can start at an earlier stage as it doesn’t require any interface as in case of black box
testing.
Easy to automate.
Disadvantages:
The goal of WhiteBox testing in software engineering is to verify all the decision
branches, loops, and statements in the code.
Steps in FTR:
1. Concentrate on work product only. That means review the product not the producers.
2. Set an agenda of a review and maintain it.
3. When certain issues are raised then debate or arguments should be limited. Reviews
should not ultimately results in some hard feelings.
4. Find out problem areas, but don’t attempt to solve every problem noted.
5. Take written notes (it is for record purpose)
6. Limit the number of participants and insists upon advance preparation.
7. Develop a checklist for each product that is likely to be reviewed.
8. Allocate resources and time schedule for FTRs in order to maintain time schedule.
9. Conduct meaningful trainings for all reviewers in order to make reviews effective.
10. Reviews earlier reviews which serve as the base for the current review being
conducted.
The very character of emulators and simulators means testing is being conducted in
an environment which is not real.
Example:
In the top-down integration testing, if depth-first approach is adopted then we will
start integration from module M1. Then we will integrate M2, then M3, M4, M5,
M6, and at last M7.
Bottom up integration:
Example
In the last, modules or components are combined together to form cluster 1 and
cluster 2. After this, each cluster is tested with the help of a control program.
The cluster is present below the high-level module or driver.
After testing, driver is removed and clusters are combined and moved upwards with
modules.
Advantages:
It is easy and simple to create and develop test conditions.
It is also easy to observe test results.
It is not necessary to know about the details of the structural design.
Low-level utilities are also tested well and are also compatible with the object -
oriented structure.
Disadvantages:
Towards top of the Hierarchy, it becomes very complicated.
There is no concept regarding early skeletal system.
There will be an impact on sibling and higher-level unit tests due to changes.
A few members of the development team are given the code few days before the walk -
through meeting to read and understand code.
Each member selects some test cases and simulates execution of the code by hand.
The members note down their findings to discuss these in a walk-through meeting where
the coder of the module is present.
Code Inspection
The aim of Code Inspection is to discover some common types of errors caused due to
improper programming.
In other words, during Code Inspection the code is examined for the presence of certain
kinds of errors.
o For instance, consider the classical error of writing a procedure that modifies a
parameter while the calling routine calls that procedure with a constant actual
parameter.
o It is more likely that such an error will be discovered by looking for these kinds
of mistakes in the code.
In addition, commitment to coding standards is also checked.
10. What are the different levels of testing? Briefly discuss the goal of each
level.
Different Levels of Testing:
The levels of software testing involve the different methodologies, which can be used
while we are performing the software testing.
In software testing, we have four different levels of testing, which are as discussed
below:
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
As we can see in the above image that all of these testing levels have a specific objective
which specifies the value to the software development lifecycle.
For our better understanding, let's see them one by one:
Unit testing is the first level of software testing, which is used to test if software modules
are satisfying the given requirement or not.
The first level of testing involves analyzing each unit or an individual component of
the software application.
Unit testing is also the first level of functional testing. The primary purpose of executing
unit testing is to validate unit components with their performance.
A unit component is an individual function or regulation of the application, or we can say
that it is the smallest testable part of the software. The reason of performing the unit
testing is to test the correctness of inaccessible code.
Unit testing will help the test engineer and developers in order to understand the base of
code that makes them able to change defect causing code quickly. The developers
implement the unit.
The second level of software testing is the integration testing. The integration testing
process comes after unit testing.
It is mainly used to test the data flow from one module or component to other
modules.
In integration testing, the test engineer tests the units or separate components or modules
of the software in a group.
The primary purpose of executing the integration testing is to identify the defects at the
interaction between integrated components or units.
When each component or module works separately, we need to check the data flow
between the dependent modules, and this process is known as integration testing.
We only go for the integration testing when the functional testing has been completed
successfully on each application module.
In simple words, we can say that integration testing aims to evaluate the accuracy of
communication among all the modules.
The third level of software testing is system testing, which is used to test the software's
functional and non-functional requirements.
It is end-to-end testing where the testing environment is parallel to the production
environment. In the third level of software testing, we will test the application as a
whole system.
To check the end-to-end flow of an application or the software as a user is known
as System testing.
In system testing, we will go through all the necessary modules of an application and test
if the end features or the end business works fine, and test the product as a complete
system.
In simple words, we can say that System testing is a sequence of different types of tests to
implement and examine the entire working of an integrated software computer system
against requirements.
The last and fourth level of software testing is acceptance testing, which is used to
evaluate whether a specification or the requirements are met as per its delivery.
The software has passed through three testing levels (Unit Testing, Integration Testing,
System Testing). Some minor errors can still be identified when the end-user uses the
system in the actual scenario.
In simple words, we can say that Acceptance testing is the squeezing of all the testing
processes that are previously done.
The acceptance testing is also known as User acceptance testing (UAT) and is done by
the customer before accepting the final product.
Usually, UAT is done by the domain expert (customer) for their satisfaction and checks
whether the application is working according to given business scenarios and real-time
scenarios.
Coding Standards:
Any good software development approach suggests to adhere to some well - defined
standards or rules for coding. These rules are called coding standards.
1. Naming Conventions
Following are some commonly used naming conventions in the coding.
o Package name and variable names should be in lower case.
o Variable names must not begin with numbers.
o The type name should be noun and it should start with capital letter.
o Constants must be in upper case (For example PI, SIZE).
o Method name must be given in lower case.
o The variables with large scope must have long name. For example count_total,
sum, Variables with short scope must have short name. For example i,j.
The prefix is must be used for Boolean type of variables. For example isEmpty or is
Full.
2. Files
Reader must get an idea about the purpose of the file by its name. In some
programming language like Java.
o The file extension must be java.
o The name of the file and the class defined in the file must have the same
name.
o Line length in the file must be limited to 80 characters.
3. Commenting / Layout
Comments are non executable part of the code. But it is very important because it
enhances the readability of the code. The purpose of the code is to explain the logic
of the program.
o Single line comments must be given by //
o For the names of the variables comments must be given.
o A black of comment must be enclosed within / and * /.
4. Statements
There are some guidelines about the declaration and executable statements.
o Declare some related variables on same line and unrelated variables on
another line.
o Class variable should never be declared public.
o Make use of only loop control within the for loop.
o Avoid make use of break and continue statements in the loop.
o Avoid complex conditional expressions Make use of temporary variables
instead.
o Avoid the use of do while statement.
Advantages of Coding Standards:
Example:
13. What are the different testing strategies? Explain any one with suitable
example.
Testing strategies:
1. Unit Testing
2. Integration Testing
3. Validation Testing
4. System Testing
1. Unit testing
Unit testing focus on the smallest unit of software design, i.e module or software
component.
Test strategy conducted on each module interface to access the flow of input and output.
The local data structure is accessible to verify integrity during execution.
Boundary conditions are tested.
In which all error handling paths are tested.
An Independent path is tested.
The unit testing is simplified when a component with high cohesion (with one function)
is designed. In such a design the number of test cases are less and easily predict or
uncover errors.
14. What is black box testing? What are the different black box testing
techniques?
Black - box testing is also known as behavioural testing. It focuses only on the functional
requirements of the software.
The black box testing helps the software developer to derive the sets of input conditions.
These input conditions exercise all the functional requirements for program.
Black - box testing is a different approach and it cannot be the alternative or the
replacement of white - box testing approach It is a complementary testing method that
detects a different class of errors compared to white box testing methods.
Following are categories of errors that can be detected by using black box testing
approach:
o The performance errors or the behavioural errors
o Missing or incorrectly defined functions
o Data structures incorrectly defined and external data base access errors,
o Errors occurred during initialization and termination.
o Errors occurred during interface.
In contrast to white - box testing, where testing begins early in the testing. process, the
black box testing is applied in the final stages of testing.
Different black - box testing methods are:
1. Graph - Based Testing Method
2. Equivalence Partitioning
3. Boundary Value Analysis
4. Orthogonal Array Testing
Graph-Based Testing:
This technique of Black box testing involves a graph drawing that depicts the link
between the causes (inputs) and the effects (output), which trigger the effects.
This testing utilizes different combinations of output and inputs. It is a helpful
technique to understand the software’s functional performance, as it visualizes the flow
of inputs and outputs in a lively fashion.
This technique of Black box testing is widely used to write test cases. It can be useful
in reducing a broad set of possible inputs to smaller but effective ones.
It is performed through the division of inputs as classes, and each class is given a value.
It is applied when the need for exhaustive testing arises and for resisting the
redundancy of inputs.
It is one among the useful and critical Black box testing technique that helps in
equivalence partitioning. BVA helps in testing any software having a boundary or
extreme values.
This technique is capable of identifying the flaws of the limits of the input values rather
than focusing on the range of input value. Boundary Value Analysis also deals with
edge or extreme output values.
In the Figure, one input value at a time is changing in accordance with the input axis.
The results obtained are generally having less coverage of the input values.
An L9 orthogonal array of test cases is created whenever an orthogonal array testing is
conducted. Generally a L9 orthogonal array has an important property called as
balancing property. In this the test coverage more complete with the input domain.
15. What is white box testing? What are the different coverage based testing
strategies.
1. Statement coverage
2. Branch coverage
3. Path coverage
1. Statement coverage:
In this technique, the aim is to traverse all statement at least once. Hence, each line
of code is tested. In case of a flowchart, every node must be traversed at least once.
Since all lines of code are covered, helps in pointing out faulty code.
2. Branch Coverage:
In this technique, test cases are designed so that each branch from all decision points
are traversed at least once.
In a flowchart, all edges must be traversed at least once.
In this technique, control flow graphs are made from code or flowchart and then
Cyclomatic complexity is calculated which defines the number of independent paths
so that the minimal number of test cases can be designed for each independent path.
Steps:
o Make the corresponding control flow graph
o Calculate the cyclomatic complexity
o Find the independent paths
o Design test cases corresponding to each independent path
Flow graph, Cyclomatic Complexity and Graph Metrices are used to arrive at basis
path.
Flow graph notation: It is a directed graph consisting of nodes and edges. Each
node represents a sequence of statements, or a decision point. A predicate node is
the one that represents a decision point that contains a condition after which the
graph splits. Regions are bounded by nodes and edges.
Calculating V(G):
Example:
P1: 1 – 2 – 4 – 7 – 8
P2: 1 – 2 – 3 – 5 – 7 – 8
P3: 1 – 2 – 3 – 6 – 7 – 8
P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8
Graph Matrix: A graph matrix is a square matrix whose size represents the number
of nodes in the control flow graph. If you do not know what control flow graphs are,
then read this article. Each row and column in the matrix identifies a node and the
entries in the matrix represent the edges or links between these nodes.
Conventionally, nodes are denoted by digits and edges are denoted by letters.
Example:
o Let’s convert this control flow graph into a graph matrix. Since the graph
has 4 nodes, so the graph matrix would have a dimension of 4 X 4. Matrix
entries will be filled as follows :
(1, 1) will be filled with ‘a’ as an edge exists from node 1 to node 1
(1, 2) will be filled with ‘b’ as an edge exists from node 1 to node
2. It is important to note that (2, 1) will not be filled as the edge is
unidirectional and not bidirectional
(1, 3) will be filled with ‘c’ as edge c exists from node 1 to node 3
(2, 4) will be filled with ‘d’ as edge exists from node 2 to node 4(3,
4) will be filled with ‘e’ as an edge exists from node 3 to node 4
o The graph matrix formed is shown below :
Software Testing:
Software testing is the process of evaluating and verifying that a software product or
application does what it is supposed to do.
The benefits of testing include preventing bugs, reducing development costs and
improving performance.
The purpose of software testing is to identify errors, gaps or missing requirements in
contrast to actual requirements.
Role of a Software Tester:
Defining the testing activities for subordinates – testers or test engineers.
All responsibilities of test planning.
To check if the team has all the necessary resources to execute the testing activities.
To check if testing is going hand in hand with the software development in all phases.
Prepare the status report of testing activities.
Required Interactions with customers.
Updating project manager regularly about the progress of testing activities.
During black box testing the program White box testing lead to the test the
cannot be tested 100 percent. program thoroughly.
This type of testing is suitable for This type of testing is suitable for
large project. small project.
Example: Search something on Example: By input to check and
google by using keywords verify loops
Black-box test design techniques- White-box test design techniques-
Decision table testing Control flow testing
All-pairs testing Data flow testing
Equivalence partitioning Branch testing
Error guessing