UNIT IV
UNIT IV
• Brute Force Method: This is the foremost common technique of debugging however is that the least
economical method. during this approach, the program is loaded with print statements to print the
intermediate values with the hope that a number of the written values can facilitate to spot the statement
in error. This approach becomes a lot of systematic with the utilisation of a symbolic program (also known as a
source code debugger), as a result of values of various variables will be simply checked and breakpoints and
watch-points can be easily set to check the values of variables effortlessly.
• Backtracking: This is additionally a reasonably common approach. during this approach, starting from the
statement at which an error symptom has been discovered, the source code is derived backward till the
error is discovered. sadly, because the variety of supply lines to be derived back will increase, the quantity of
potential backward methods will increase and should become unimaginably large so limiting the utilisation of
this approach.
• Cause Elimination Method: In this approach, a listing of causes that may presumably have contributed to
the error symptom is developed and tests are conducted to eliminate every error. A connected technique of
identification of the error from the error symptom is that the package fault tree analysis.
• Program Slicing: This technique is analogous to backtracking. Here the search house is reduced by process
slices. A slice of a program for a specific variable at a particular statement is that the set of supply lines
preceding this statement which will influence the worth of that variable
Debugging Tools
There are lot of problems at the same time as acting the debugging. These are the
following:
• Debugging is finished through the individual that evolved the software program and
it’s miles difficult for that person to acknowledge that an error was made.
• Debugging is typically performed under a tremendous amount of pressure to fix the
supported error as quick as possible.
• It can be difficult to accurately reproduce input conditions.
• Compared to the alternative software program improvement activities, relatively
little research, literature and formal preparation exist at the procedure of
debugging.
Debugging Guidelines:
Debugging is commonly administrated by programmers supported their ingenuity. The
subsequent are some general tips for effective debugging:
• Many times debugging needs an intensive understanding of the program style. making an
attempt to rectify supported a partial understanding of the system style and
implementation might need an excessive quantity of effort to be placed into debugging
even straightforward issues.
• Debugging might generally even need a full plan of the system. In such cases, a typical
mistake that novice programmers usually create is trying to not fix the error however its
symptoms.
• One should be watched out for the likelihood that a slip correction might introduce new
errors. so when each spherical of error-fixing, regression testing should be administrated.
Types Of Software Testing Techniques
• Static Testing Techniques are testing techniques that are used to find defects in
an application under test without executing the code. Static Testing is done to
avoid errors at an early stage of the development cycle thus reducing the cost
of fixing them.
• Dynamic Testing Techniques are testing techniques that are used to test the
dynamic behaviour of the application under test, that is by the execution of the
code base. The main purpose of dynamic testing is to test the application with
dynamic inputs- some of which may be allowed as per requirement (Positive
testing) and some are not allowed (Negative Testing)
Static Testing Techniques
Static Testing Techniques
• Static Testing Techniques are divided into two major categories:
1. Reviews: They can range from purely informal peer reviews between two developers/testers on the
artifacts (code/test cases/test data) to formal Inspections which are led by moderators who can be
internal/external to the organization.
• Peer Reviews: Informal reviews are generally conducted without any formal setup. It is between peers.
For Example- Two developers/Testers review each other’s artifacts like code/test cases.
• Walkthroughs: Walkthrough is a category where the author of work (code or test case or document
under review) walks through what he/she has done and the logic behind it to the stakeholders to
achieve a common understanding or for the intent of feedback.
• Technical review: It is a review meeting that focuses solely on the technical aspects of the document
under review to achieve a consensus. It has less or no focus on the identification of defects based on
reference documentation. Technical experts like architects/chief designers are required to do the
review. It can vary from Informal to fully formal.
• Inspection: Inspection is the most formal category of reviews. Before the inspection, the document
under review is thoroughly prepared before going for an inspection. Defects that are identified in the
Inspection meeting are logged in the defect management tool and followed up until closure. The
discussion on defects is avoided and a separate discussion phase is used for discussions, which makes
Inspections a very effective form of review
Static Testing Techniques
2. Static Analysis: Static Analysis is an examination of requirement/code or design to
identify defects that may or may not cause failures. For Example- Review the code for
the following standards. Not following a standard is a defect that may or may not cause
a failure. Many tools for Static Analysis are mainly used by developers before or during
Component or Integration Testing. Even Compiler is a Static Analysis tool as it points
out incorrect usage of syntax, and it does not execute the code per se. There are several
aspects to the code structure – Namely Data flow, Control flow, and Data Structure.
• Data Flow: It means how the data trail is followed in a given program – How data gets
accessed and modified as per the instructions in the program. By Data flow analysis,
you can identify defects like a variable definition that never got used.
• Control flow: It is the structure of how program instructions get executed i.e.
conditions, iterations, or loops. Control flow analysis helps to identify defects such as
Dead code i.e. a code that never gets used under any condition.
• Data Structure: It refers to the organization of data irrespective of code. The
complexity of data structures adds to the complexity of code. Thus, it provides
information on how to test the control flow and data flow in a given code.
Dynamic Testing Techniques
Dynamic Testing Techniques
Dynamic techniques are subdivided into three categories:
1. Structure-based Testing:
• These are also called White box testing techniques. Structure based testing techniques are focused
on how the code structure works and test accordingly. To understand Structure-based
techniques, we first need to understand the concept of code coverage.
• Code Coverage is normally done in Component and integration testing. It establishes what code is
covered by structural testing techniques out of the total code written. One drawback of code
coverage is that- it does not talk about code that has not been written at all (Missed requirement),
There are tools in the market that can help measure code coverage.
There are multiple ways to test code coverage:
1. Statement coverage: Number of Statements of code exercised/Total number of statements. For
Example, if a code segment has 10 lines and the test designed by you covers only 5 of them then we
can say that statement coverage given by the test is 50%.
2. Decision coverage: Number of decision outcomes exercised/Total number of Decisions. For
Example, If a code segment has 4 decisions (If conditions) and your test executes just 1, then
decision coverage is 25%
3. Conditional/Multiple condition coverage: It has the aim to identify that each outcome of every
logical condition in a program has been exercised.
Dynamic Testing Techniques
2. Experience-Based Techniques:
These are techniques for executing testing activities with the help of experience gained over
the years. Domain skill and background are major contributors to this type of testing. These
techniques are used majorly for UAT/Business user testing. These work on top of structured
techniques like Specification-based and Structure-based, and they complement them. Here are
the types of experience-based techniques:
1. Error Guessing: It is used by a tester who has either very good experience in testing or
with the application under test and hence they may know where a system might have a
weakness. It cannot be an effective technique when used stand-alone but is helpful when used
along with structured techniques.
2. Exploratory Testing: It is hands-on testing where the aim is to have maximum execution
coverage with minimal planning. The test design and execution are carried out in parallel
without documenting the test design steps. The key aspect of this type of testing is the tester’s
learning about the strengths and weaknesses of an application under test. Similar to error
guessing, it is used along with other formal techniques to be useful.
Test Data
• Test Data :Data created or selected to satisfy the execution
preconditions and inputs to execute one or more test cases.
This method is done with the help of using SQL queries. Here a tester writes the
relevant query and injects it into the database in order to populate the required
data sets with respect to the test cases. This is also an easier method which
generates a large amount of data in just a few minutes. We can update the database
in this scheme if some new datasets are found through other resources like sample
XML documents etc could be updated for future use if required.
Pros:
• It is less time-consuming technique.
• Less expertise required as compared to the above technique as you only need to
write a correct query to populate data required.
Cons:
• If you write any invalid query or incorrect it may populate illogical dataset or may
cause the failure of your database system so keep attention while injecting any
query into database.
4) Third-party tool:
A number of tools are available in the market that is processed or provided
by the out premises tools. These tools first understand the scenarios of your
system under testing and then generates dataset as per the requirement.
These tools are customizable as per your need of the business. These tools
provide wide coverage and accuracy in generating datasets.
Pros:
• These tools are accurate because they first understand the entire system
and then generated the datasets accordingly.
Cons:
• Costlier technique to implement because the price of such a tool is high as
compared to other technique.
• Less coverage in case of heterogeneous testing environment because these
tools aren’t generic in nature.
Test Data Generation Challenges
2. Mostly AI:
https://www.youtube.com/watch?v=XxnfwS7ONok
https://mostly.ai/
3. Datprof:
https://www.youtube.com/watch?v=GoTUQPcCLwo
https://www.datprof.com/
7. Mockaroo:
https://www.youtube.com/watch?v=S_oYFGhZSkQ&list=PLKMZcxOsC3u0Y-4CHg5SDpVjTcrvGttTt
8. GenerateData:
https://www.youtube.com/watch?v=ge5NxDzi5pg&pp=ygUZZ2VuZXJhdGVkYXRhLmNvbSB0dXRv
cmlhbA%3D%3D
2. LambdaTest:
https://www.youtube.com/watch?v=86LQsMtBs5k&list=PLZMWkkQEwOPnfsvd5-cGv
d92waD_e7OK2
3. TestRail:
https://www.youtube.com/watch?v=JNWxtRj6yRI&list=PLYWjxQG8_opcRuakXuoqO
2k_r2q6tNYJW
4. Xray:
https://www.youtube.com/watch?v=uKZng5ZmtJM&t=78s&pp=ygURWHJheSB0ZXN0a
W5nIHRvb2w%3D
Software Testing Tools
5. Zephyr Scale:
https://www.youtube.com/watch?v=uRb4OS_IxTk&pp=ygUZWmVwaHlyIFNjYWxlIHR
lc3RpbmcgdG9vbA%3D%3D
6. Selenium:
https://www.youtube.com/watch?v=FRn5J31eAMw&list=PL9ooVrP1hQOFP9H8Y15D
VGCA6GavhgJ8a
7. Ranorex:
https://www.youtube.com/watch?v=Sub0gIS-a0Q&list=PLHS38HrTXR4PQScNEgtoyb
Kei6bdYlc9y
8. TestProject:
https://www.youtube.com/watch?v=MsgX5oNAh7k&list=PLhW3qG5bs-L_QuqpGY-B-
1ifP1j4ve3fx
Exploratory Testing
• Tester is free to select any possible methodology to test the software.
• It is an unscripted approach to software testing.
• Developers use their learning, knowledge, skills, and abilities to test the
software developed by themselves.
• It checks the functionality and operations of the software as well as
identify the functional and technical faults in it.
• It aims to optimize and improve the software in every possible way. The
exploratory testing technique combines the experience of testers with a
structured approach to testing. It is often performed as a black box
testing technique. 4 Exploratory testing is an unscripted testing
technique.