Professional Documents
Culture Documents
Assignment 5 (Se)
Assignment 5 (Se)
Assignment 5 (Se)
2106606 (CSE-A)
ASSIGNMENT-5
Q1. Difference between Black Box Testing and White Box Testing.
Ans. Black Box Testing
In black box testing, the testing team analyzes the workings of an application without first
having an extensive understanding of its internal structure and design. During testing, the
input value is simply compared with the output value. Due to its nature, black box testing is
sometimes called specification-based testing, closed box testing, or opaque box testing.
The black box methodology is used to test most modern software applications. It covers
numerous test cases, allowing maximum bugs to be discovered. This testing method is used at
all stages of the software development cycle.
Black box testing focuses on understanding user experience, which means testers do not
require in-depth technical knowledge to carry it out. It’s a valuable way to provide extensive
testing coverage, especially compared to white box testing, which is sometimes so precise
that testers miss the bigger picture.
This form of testing takes place post-completion of development, and both processes are
independent.
Unlike black box testing, which focuses on ensuring a smooth user experience, white box
testing is intensive. Combined with other bug-quashing techniques, it is a robust quality
assurance tool. This methodology is designed to conduct in-depth simulations of all the
scenarios the application might encounter at the code level.
The granularity offered by white box testing is an effective way to crush bugs. This
transparent and rigorous testing approach also gives insights into all the possible outputs the
application can theoretically generate. White box testing is leveraged to spot hidden internal
errors and optimize code.
It is a way of software testing in which the It is a way of testing the software in which
internal structure or the program or the the tester has knowledge about the internal
code is hidden and nothing is known about structure or the code or the program of the
it. software.
No knowledge of implementation is
Knowledge of implementation is required.
needed.
This testing can be initiated based on the This type of testing of software is started
requirement specifications document. after a detail design document.
Deepak Kumar
2106606 (CSE-A)
It is the behavior testing of the software. It is the logic testing of the software.
Can be done by trial and error ways and Data domains along with inner or internal
methods. boundaries can be better tested.
Ans.
What is Debugging?
Debugging is the process of finding and fixing errors or bugs in the source code of any
software. When software does not work as expected, computer programmers study the code
to determine why any errors occurred. They use debugging tools to run the software in a
controlled environment, check the code step by step, and analyze and fix the issue.
The term debugging can be traced back to Admiral Grace Hopper, who worked at Harvard
University in the 1940s. When one of her colleagues found a moth impeding the operation of
one of the university's computers, she told them they were debugging the system. Computer
programmers were first recorded as using the terms bugs and debugging by the 1950s, and by
Deepak Kumar
2106606 (CSE-A)
the early 1960s, the term debugging was commonly accepted in the programming
community.
Bugs and errors happen in computer programming because it is an abstract and conceptual
activity. Computers manipulate data in the form of electronic signals. Programming
languages abstract this information so humans can interact with computers more efficiently.
Any type of software has several layers of abstraction, with different components
communicating for an application to work correctly. When errors occur, finding and
resolving the issue can be challenging. Debugging tools and strategies help to fix problems
faster and improve developer productivity. As a result, both software quality and the end-user
experience improve.
Error identification
Developers, testers, and end-users report bugs they discover while testing or using the
software. Developers locate the exact line of codes or code module causing the bug. This can
be a tedious and time-consuming process.
Error analysis
Coders analyze the error by recording all program state changes and data values. They also
prioritize the bug fix based on its impact on software functionality. The software team also
identifies a timeline for bug fixing depending on development goals and requirements.
Developers fix the bug and run tests to ensure the software continues to work as expected.
They may write new tests to check if the bug recurs in the future.
The most common debugging strategy is likely the brute force method—despite also being
the least efficient.
Deepak Kumar
2106606 (CSE-A)
As the name suggests, this method lacks an organized, structured approach to resolving
software bugs.
Instead, developers step through the code, trying various fixes until they stumble across a
resolution.
The graph below visualizes the general process
In a recent Reddit thread, one user posted a photo of their CTO‘s debugging process.
Here’s the image:
Deepak Kumar
2106606 (CSE-A)
Although this picture seems absurd to those who aren’t in the know, there’s a good reason
behind it.
This developer is employing rubber duck debugging—a debugging technique where you
explain the bug to a rubber duck, or at least someone who has no prior knowledge of the issue
that’s troubling you.
Sometimes the easiest way to get to the bottom of the problem is to attack it from a new
angle. Rubber duck debugging facilitates this, as you must use plain language to describe the
defect.
As you articulate the issue to the rubber duck, you’ll walk through all its particulars and
hopefully realize your mistake in the process.
Experienced developer David Hayes has also commented on this, emphasizing the
differences in how humans and computers operate:
Bug clustering
You’ll likely encounter similar errors in your software (e.g., your app crashing in several
different locations).
While debugging, it’s helpful to group these comparable bugs together—a practice known
as bug clustering.
The reasoning is simple: by examining seemingly-related defects, you should quickly arrive
at their resolution.
A recent publication can explain why:
Deepak Kumar
2106606 (CSE-A)
Perhaps the most scientific debugging strategy, the cause elimination method employs
deductive techniques to resolve software bugs.
The first step is creating a list of all possible reasons for the defect. They don’t need to be
entirely rationalized—they’re just theories to help assess the situation.
Then, test each hypothesis one by one. As you analyze your codebase, you’ll eliminate
possible causes as you go and should be left one with one sole possible reason.
If that remaining theory is vague, now is the time to refine it further. After that, you should be
able to prove it and solve the software bug.
Backtracking
Binary searching
Similar to program slicing, binary searching also dissects your code into sections. However,
instead of focusing on variables, you’ll search the codebase in halves.
The first step is determining the part of the program hosting the bug—its surface area.
Once you know that, divide the affected code into two halves, and identify which half
contains the bug.
From there, repeat the process, again splitting the code into halves and again diagnosing the
half with the bug.
Then just repeat the procedure until the code portion is small enough it’s obvious where the
defect resides.
The visual below depicts a simplified representation of the process:
Deepak Kumar
2106606 (CSE-A)
Static analysis
Last but not least, static analysis is our final, and perhaps most theoretical, debugging
method.
When using this strategy, developers examine the code in a static environment—without
executing the program or running it through any compilers or debuggers.
While doing so, they also compare the code against coding rules and best practices.
Testing Debugging
Testing is the process to find bugs and Debugging is the process of correcting the
errors. bugs found during testing.
It is the process to identify the failure of It is the process to give absolution to code
implemented code. failure.
Testing Debugging
Testing is initiated after the code is Debugging commences with the execution
written. of a test case.