Unit 4
Unit 4
What is Bug?
A bug is the consequence/outcome of a coding fault
What is Defect?
➢ A defect is a variation or deviation from the original business requirements
➢ These two terms have very thin line of difference, In the Industry both are faults that need
to be fixed and so interchangeably used by some of the Testing teams.
➢ When a tester executes the test cases, he might find that actual result vary from expected
results.
➢ This variation in the test result is referred as a Software Defect.
➢ These defects or variation are referred by different names in a different organization
like issues, problem, bug or incidents.
➢ In case you find a defect , What information you will convey to the developer to help him
understand the defect
➢ While reporting the bug to developer, your Bug Report should contain the following
information
Enlist any six attributes of defect. Describe them with suitable example.
Defect Prevention the best method to eliminate the defects in the early stage of testing instead of
finding the defects in the later stage and then fixing it. This method is also cost effective as the
cost required for fixing the defects found in the early stages of testing is very low. However, it is
not possible to remove all the defects but at least you can minimize the impact of the defect and
cost to fix the same.
• Identify Critical Risk: Identify the critical risks in the system which will impact more if
occurred during testing or in the later stage.
• Estimate Expected Impact: For each critical risk, calculate how much would be the
financial impact if the risk actually encountered.
• Minimize expected impact: Once you identify all critical risks, take the topmost risks
which may be harmful to the system if encountered and try to minimize or eliminate the
risk. For risks which cannot be eliminated, it reduces the probability of occurrence and its
financial impact.
• When a deliverable (system, product or document) reaches its pre-defined milestone then
you can say a deliverable is a baseline. In this process, the product or the deliverable moves
from one stage to another and as the deliverable moves from one stage to another, the
existing defects in the system also gets carried forward to the next milestone or stage.
• For Example, consider a scenario of coding, unit testing and then system testing. If a
developer performs coding and unit testing then system testing is carried out by the testing
team. Here coding and Unit Testing is one milestone and System Testing is another
milestone.
• So during unit testing, if the developer finds some issues then it is not called as a defect as
these issues are identified before the meeting of the milestone deadline. Once the coding
and unit testing have been completed, the developer hand-overs the code for system testing
and then you can say that the code is “baselined” and ready for next milestone, here, in
this case, it is “system testing”.
• Now, if the issues are identified during testing then it is called as the defect as it is identified
after the completion of the earlier milestone i.e. coding and unit testing.
• It is almost impossible to remove all the defects from the system and make a system as a defect-
free one. But you can identify the defects early before they become costlier to the project. We can
say that the defect discovered means it is formally brought to the attention of the development team
and after analysis of that the defect development team also accepted it as a defect.
• Steps involved in Defect Discovery are as follows:
• Find a Defect: Identify defects before they become a major problem to the system.
• Report Defect: As soon as the testing team finds a defect, their responsibility is to make the
development team aware that there is an issue identified which needs to be analyzed and fixed.
• Acknowledge Defect: Once the testing team assigns the defect to the development team, its the
development team’s responsibility to acknowledge the defect and continue further to fix it if it is a
valid defect.
• In the above process, the testing team has identified the defect and reported to the development
team. Now here the development team needs to proceed for the resolution of the defect.
• The steps involved in the defect resolution are as follows:
• Prioritize the risk: Development team analyzes the defect and prioritizes the fixing of the defect.
If a defect has more impact on the system then they make the fixing of the defect on a high priority.
• Schedule and Fix the defect: Based on the priority, the development team fixes the defect, higher
priority defects are resolved first and lower priority defects are fixed at the end.
Management Reporting
• It is important that the defect information, which is a natural by-product of the defect
management process, be analyzed and communicated to both project management and
senior management.
• This could take the form of defect rates, defect trends, types of defects, failure costs, etc.
• From a tactical perspective, defect arrival rate (rate at which new defects are being
discovered) is a very useful metric that provides insight into a project's likelihood of
making its target date objectives.
• Defect removal efficiency is also considered to be one of the most useful metrics, however
it can not be calculated until the system is installed.
Information collected during the defect management process has a number of purposes:
Software bug can be defined as the abnormal behavior of the software. Bug starts when the defect
is found and ends when a defect is closed, after ensuring it is not reproduced.
The different states of a bug in the bug life cycle are as follows:
New: When a tester finds a new defect. He should provide a proper Defect document to the
Development team to reproduce and fix the defect. In this state, the status of the defect posted by
tester is “New”
Assigned: Defects which are in the status of New will be approved (if valid) and assigned to the
development team by Test Lead/Project Lead/Project Manager. Once the defect is assigned then
the status of the bug changes to “Assigned”
Closed: After verified the fix, if the bug is no longer exits then the status of bug will be
assigned as “Closed.”
Reopen: If the defect remains same after the retest, then the tester posts the defect using
defect retesting document and changes the status to “Reopen”. Again the bug goes
through the life cycle to be fixed.
Duplicate: If the defect is repeated twice or the defect corresponds the same concept of
the bug, the status is changed to “duplicate” by the development team.
Deferred: In some cases, Project Manager/Lead may set the bug status as deferred.
If the bug found during end of release and the bug is minor or not important to fix
immediately
If the bug is not related to current build
If it is expected to get fixed in the next release
Customer is thinking to change the requirement
In such cases the status will be changed as “deferred” and it will be fixed in the next
release.
Rejected: If the system is working according to specifications and bug is just due to
some misinterpretation (such as referring to old requirements or extra features) then
Team lead or developers can mark such bugs as “Rejected”
Testing tools
Testing tool logo Used
Selenium: Selenium is the most popular automated testing
tool. It supports Automation Testing of web based
applications, wide range of platforms and browsers.
qTest:
FogBugz The FogBugz is a tracking tool which can be used to track the
status of defects and changes in ongoing software projects,
such as application development and deployment
Bugzilla Bugzilla is one of the best defect Tracking System. The tool allows
individual or groups of developers to keep track of outstanding bugs
in their system. It is the best open source software used in the
market by small scale as well as large- scale organizations
a) Quick Attacks:
d) State-Transition Diagrams
e) Use Cases
a) Quick Attacks:
·The quick-attacks technique allows you to perform a cursory analysis of a system in a very
compressed timeframe.
Even without a specification, you know a little bit about the software, so the time spent is also
time invested in developing expertise.
Boundaries and equivalence classes give us a technique to reduce an infinite test set into something
manageable.
They also provide a mechanism for us to show that the requirements are "covered".
• The heart of this method is to figure out what failures are common for the platform,
the project, or the team; then try that test again on this build.
• If your team is new, or you haven't previously tracked bugs, you can still write down
defects that "feel" recurring as they occur—and start checking for them.
d) State-Transition Diagrams:
• Mapping out the application provides a list of immediate, powerful test ideas.
• Model can be improved by collaborating with the whole team to find "hidden"
states— transitions that might be known only by the original programmer or
specification author.
• Once you have the map, you can have other people draw their own diagrams, and
then compare theirs to yours.
• The differences in those maps can indicate gaps in the requirements, defects in the
software, or at least different expectations among team members.
• The map you draw doesn't actually reflect how the software will operate; in other
words, "the map is not the territory."
• Drawing a diagram won't find these differences,
Like just about every other technique on this list, a state-transition diagram can be helpful, but
it's not sufficient by itself to test an entire application.
e) Use Cases:
Use cases and scenarios focus on software in its role to enable a human being to do something.
Use cases and scenarios tend to resonate with business customers, and if done as part of the
requirement process, they sort of magically generate test cases from the requirements.
• Imagine that you have a black-box recorder that writes down every single line of code as
it executes. Programmers prefer code coverage. It allows them to attach a number— an
o People spend a lot of money on regression testing, taking the old test ideas
described above and rerunning them over and over.
o This is generally done with either expensive users or very expensive programmers
spending a lot of time writing and later maintaining those automated tests.
. Weaknesses
o Building a record/playback/capture rig for a GUI can be extremely expensive, and
it might be difficult to tell whether the application hasn't broken, but has changed
in a minor way.
What are the points considered while estimating impact of a defect? Also explain
techniques to find defect.
• Estimate Expected Impact of a Defect, Techniques for Finding Defects, Reporting a
Defect.
• Once the critical risks are identified, the financial impact of each risk should be
estimated. This can be done by assessing the impact, in dollars, if the risk does become
a problem combined with the probability that the risk will become a problem. The
product of these two numbers is the expected impact of the risk.
The expected impact of a risk (E) is calculated as E = P * I, where:
P= probability of the risk becoming a problem and
I= Impact in dollars if the risk becomes a problem.
Give any two root causes of defects. Also give any two effects of defects.
Root of defects:
i. Miscommunication of requirements introduces error in code.
ii. Lack of design Experience.
iii. Lack of coding practice.
iv. Unrealistic time schedule for development.
v. Multiple changes in the requirements.
Effects of defects
i. A defect is an error in coding or logic that causes a program to fail or to produce incorrect
/unexpected results.
ii. It is commonly refers to troubles with the software products, with its external behavior or
with its internal features.
iii. Increased complexity of software.
iv. Programming Errors.
Requirement related defects arise in a product when one fails to understand what is required
by the customer. These defects may be due to customer gap, where the customer is unable to
➢ Design Defects: Design defects occur when system components, interactions between
system components, interactions between the outside software/hardware, or users are
incorrectly designed. This covers in the design of algorithms, control, logic/ data elements,
module interface descriptions and external software/hardware/user interface descriptions.
Design defects generally refer to the way of design creation or its usage while creating a
product. The customer may or may not be in a position to understand these defects, if
structures are not correct. They may be due to problems with design creation and
implementation during software development life cycle.
➢ Coding defects: The requirements have been coded incorrectly due to which behavior
of an implemented software function is not in accordance with the requirement
specification documents. The other frequently occurred defects made by developers are
due to Missed to code for the requirements which listed in requirement specification
document , Coding the requirements which are not specified in the requirement
specification document
➢ Testing Defect: Testing defect are defects introduced in an application due to wrong
testing , or defects in the test artifact leading to wrong testing. Defects which cannot be
reproduced , or are not supported by requirement or are duplicate may represent a false
call
.In this defects includes
1. Test-design defect : test-design defect refers to defects in test artifacts. there can be defects
in test plans, test scenarios, test cases and test data definition which can lead to defect in
software.
2. Test-environment defect: this defect may arise when test environment is not set properly.
test environment may be comprised of hardware, software, simulator and people doing testing.
3. Test-tool defects: any defects introduced by a test tool may be very difficult to find and
resolve, as one may have to find the defect using manual test as against automated tools.