Se Unit 5
Se Unit 5
TESTING
Software Engineering CO 1
Sr.No. Verification Validation
1 Verification addresses the concern: "Are you building Validation addresses the concern: "Are you
it right?" building the right thing?"
2 Ensures that the software system meets all the Ensures that the functionalities meet the
functionality. intended behavior.
3 Verification takes place first and includes the checking Validation occurs after verification and mainly
for documentation, code, etc. involves the checking of the overall product.
4 Done by developers. Done by testers.
5 It has static activities, as it includes collecting reviews, It has dynamic activities, as it includes
walkthroughs, and inspections to verify software. executing the software against the
requirements.
6 It is an objective process and no subjective decision It is a subjective process and involves
should be needed to verify software. subjective decisions on how well software
works.
Testing −
Debugging −
Software Engineering CO 2
TYPES OF TESTING
MANUAL TESTING
It includes testing a
software manually, i.e., without
using any automated tool or any
script.
Testers use test plans, test cases, or test scenarios to test a software
to ensure the completeness of testing.
AUTOMATION TESTING
It is also known as Test Automation, is when the tester writes scripts and uses
another software to test the product.
It is used to re-run the test scenarios that were performed manually, quickly,
and repeatedly
Apart from regression testing, automation testing is also used to test the
application from load, performance, and stress point of view.
It increases the test coverage, improves accuracy, and saves time and
money in comparison to manual testing.
What to Automate?
The areas at which a user can make transactions such as the login form or
registration forms, any area where large number of users can access the
software simultaneously should be automated.Furthermore, all GUI items,
Software Engineering CO 3
connections with databases, field validations, etc.can be efficiently tested by
automating the manual process.
The tester has no knowledge of the system's internal structure and cannot
access the source code.
While performing a black-box test, a tester will interact with the system's
user interface by providing inputs and examining outputs without knowing
how and where the inputs are worked upon.
Software Engineering CO 4
B. WHITE BOX TESTING
This is the detailed investigation of internal logic and structure of the code.
The tester needs to have a look inside the source code and find out which
unit/chunk of the code is behaving inappropriately
Advantages Disadvantages
Testers know the code, so testing the app is easier. Skilled testers are costly.
Helps in improving the code. Hard to find all errors, as some paths remain
unchecked.
Removes extra code, reducing hidden bugs. Needs special tools for testing and maintenance is
difficult.
Testers’ code knowledge ensures better testing
coverage.
C. GREY BOX TESTING
Having this knowledge, a tester can prepare better test data and test
scenarios while making a test plan.
COMPARISON BETWEEN BLACK, GREY AND WHITE BOX TESTING
Software Engineering CO 5
Black Box Testing Gray Box Testing White Box Testing
Tester doesn’t know the code inside. Tester knows some parts of the Tester knows the full internal code.
code.
Also called closed-box or functional Also called translucent testing. Also called clear-box or structural
testing. testing.
Done by end-users, testers, and Done by end-users, testers, and Mostly done by testers and
developers. developers. developers.
Focuses on what the app should do. Uses diagrams like flowcharts. Focuses on how the app works
inside.
Simple and less time-consuming. Moderate time and effort needed. Most detailed and time-
consuming.
Not useful for testing algorithms. Not useful for testing algorithms. Best for testing algorithms.
Uses trial-and-error testing. Tests some internal data if available. Tests internal data thoroughly.ll
LEVELS OF TESTING
There are different levels during the process of testing.
FUNCTIONAL TESTING
The application is tested by providing input and then the results are
examined that need to conform to the functionality it was intended for.
An effective testing practice will see the above steps applied to the testing
policies of every organization and hence it will make sure that the
organization maintains the strictest of standards when it comes to
softwarequality.
A. UNIT TESTING
Software Engineering CO 6
This type of testing is performed by developers before the setup is handed
over to the testing team to formally execute the test cases.
The developers use test data that is different from the test data of the quality
assurance team.
The goal of unit testing is to isolate each part of the program and show that
individual parts are correct in terms of requirements and functionality.
There is a limit to the number of scenarios and test data that a developer can
use to verify a source code.
After having exhausted all the options, there is no choice but to stop unit
testing and merge the code segment with other units.
B. INTEGRATION TESTING
Software Engineering CO 7
C. SYSTEM TESTING
Once all the components are integrated, the application as a whole is tested
rigorously to see that it meets the specified Quality Standards.
System testing is the first step in the Software Development Life Cycle, where
the application is tested as a whole.
System testing enables us to test, verify, and validate both the business
requirements as well as the application architecture.
D. ACCEPTANCE TESTING
The QA team will have a set of pre-written scenarios and test cases that will
be used to test the application.
More ideas will be shared about the application and more tests can be
performed on it to gauge its accuracy and the reasons why the project was
initiated.
Software Engineering CO 8
Acceptance tests are not only intended to point out simple spelling mistakes,
cosmetic errors, or interface gaps, but also to point out any bugs in the
application that will result in system crashes or major errors in the application.
ALPHA TESTING
This test is the first stage of testing and will be performed amongst the teams
(developer and QA teams).
During this phase, the following aspects will be tested in the application−
Spelling Mistakes
Broken Links
Cloudy Directions
The Application will be tested on machines with the lowest specification to test
loading times and any latency problems.
BETA TESTING
Beta test versions of software are ideally distributed to a wide audience on the
Web, partly to give the program a "real-world" test and partly to provide a
preview of the next release.
Users will install, run the application and send their feedback to the project
team.
The more issues you fix that solve real user problems, the higher the quality of
your application will be.
Software Engineering CO 10
B. ROBUSTNESS TESTING
Software Engineering CO 11
Inn me hum similar to boundary ki
tarah krte h bss jab hum ek ke
critical points lete h toh dussre ki
nominal value lene ki jarurat nhi
C. WORST CASE TESTING uske bhi hume critical lene h
Software Engineering CO 13
- CAUSE EFFECT GRAPH
Some of the important and commonly used non-functional testing types are
a. Performance Testing
Network delay
Client-side processing
Capacity
Stability
Scalability
b. Load Testing
This type of testing identifies the maximum capacity of software and its
behavior at peak time.
Most of the time, load testing is performed with the help of automated tools
such as Load Runner, AppLoader, IBM Rational Performance Tester,
Apache JMeter, Silk Performer, Visual Studio Load Test, etc.
Virtual users VUsers) are defined in the automated testing tool and the
script is executed to verify the load testing for the software.
The number of users can be increased or decreased concurrently or
incrementally based upon the requirements.
c. Stress Testing
For example, it may include taking away some resources or applying a load
beyond the actual load limit.
The aim of stress testing is to test the software by applying the load to the
system and taking over the resources used by the software to identify
the breaking point.
d. Portability Testing
Portability testing includes testing a software with the aim to ensure its
reusability and that it can be moved from another software as well.
Following are the strategies that can be used for portability testing −
In other words the software testing which is performed by the team which
knows the development phase of the software, is known as structural testing.
Software Engineering CO 16
It is related to the internal design and implementation of the software i.e. it
involves the development team members in the testing team.
1. Mutation testing
It is used to check the quality of the test case that should fail the mutant code.
When we identify various errors, it implies that either the program is correct or
the test case is inefficient in locating the fault.
It used to cause an error in the program, which implies that the mutation
testing is performed to evaluate the test case's productivity.
2. Slice-based testing
It was initially created and established to keep the software.
The basic idea is to sort the complete code into small chunks and then
evaluate each portion carefully.
Software Engineering CO 17
The slice-based testing is very beneficial for the maintenance of the software
along with fixing the application too.
Note: The developers can use these four types of structural testing as per their
requirements.
In this testing, the entire test is based on how the control is executed during
the code.
The complete information of all the software's features and logic is necessary
to execute the control flow testing.
In this testing method, the control flow graph of a program is designed to find
a set of linearly independent paths of execution.
To design test cases using this technique, four steps are followed :
CONTROL FLOW GRAPH Directed graph which represents the control structure
of a program or module. V, E has V number of nodes/vertices and E number of
edges in it.
Software Engineering CO 18
A control graph can also have :
Junction Node – a node with more than one arrow entering it.
Decision Node – a node with more than one arrow leaving it.
Region – area bounded by edges and nodes (area outside the graph is also
counted as a region.).
DD PATH GRAPH
The second step is to draw a DD path graph from the flow graph.
The nodes of flow graph, which are in a sequence are combined into a single
node.
Software Engineering CO 19
Software Engineering CO 20
INDEPENDENT PATHS
An independent path in the control flow graph is the one which introduces at
least one new edge that has not been traversed before the path is defined.
Software Engineering CO 21
NOTE CONTROL FLOW GRAPH IS NOT UNIQUE
Graph Matrices
Whenever graphs are used for testing, we are interested to find independent
paths.
Graph matrix is a square matrix with one row and one column for every node
in the graph.
Size of the matrix (i.e., the number of rows and columns) is equal to the
number of nodes in the flow graph.
There is a place to put every possible direct connection between any |node
and any other node.
If there are several links between two nodes, then the entry is a sum ; the ‘+ʼ
sign denotes parallel links.
Software Engineering CO 22
Graph matrix is nothing but the tabular representation of a flow graph.
Software Engineering CO 23
The Kth power of matrix represents all paths of K links long.
Software Engineering CO 24
It implements a control flow graph and analysis the points where the codes
can change the data.
If we execute the data flow testing technique, the information is kept safe and
unchanged during the code's implementation.
Some Terminology
Software Engineering CO 25
Structural testing also contains some open-source and commercial tools that
have their functionality.
Some of the most commonly used tools for structural testing are as follows:
Cucumber, JBehave , Cfix , JUnit
Software Engineering CO 26