Unit Iv
Unit Iv
Software testing
Activities
Levels of Testing
• Debugging gets started when we start writing the code for the software program. It
progressively starts continuing in the consecutive stages to deliver a software product
because the code gets merged with several other programming units to form a software
product.
• Following are the benefits of Debugging:
• Debugging can immediately report an error condition whenever it occurs. It prevents
hampering the result by detecting the bugs in the earlier stage, making software
development stress-free and smooth.
• It offers relevant information related to the data structures that further helps in easier
interpretation.
• Debugging assist the developer in reducing impractical and disrupting information.
• With debugging, the developer can easily avoid complex one-use testing code to save
time and energy in software development.
Steps involved in Debugging
Steps involved in Debugging
• Identify the Error: Identifying an error in a wrong may result in the wastage of
time. It is very obvious that the production errors reported by users are hard to
interpret, and sometimes the information we receive is misleading. Thus, it is
mandatory to identify the actual error.
• Find the Error Location: Once the error is correctly discovered, you will be
required to thoroughly review the code repeatedly to locate the position of the
error. In general, this step focuses on finding the error rather than perceiving it.
• Analyze the Error: The third step comprises error analysis, a bottom-up
approach that starts from the location of the error followed by analyzing the
code. This step makes it easier to comprehend the errors. Mainly error analysis
has two significant goals, i.e., evaluation of errors all over again to find existing
bugs and postulating the uncertainty of incoming collateral damage in a fix.
• Prove the Analysis: After analyzing the primary bugs, it is necessary
to look for some extra errors that may show up on the application. By
incorporating the test framework, the fourth step is used to write
automated tests for such areas.
• Cover Lateral Damage: The fifth phase is about accumulating all of
the unit tests for the code that requires modification. As when you
run these unit tests, they must pass.
• Fix & Validate: The last stage is the fix and validation that emphasizes
fixing the bugs followed by running all the test scripts to check
whether they pass.
Debugging Strategies
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 Approaches:
The following are a number of approaches popularly adopted by programmers for debugging.
• 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 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.
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