Lecture 3
1. Software Testing - Bug
software bug in the application indicates a deviation, fault, error, mistake, or flaw
there. This results in the software not working as expected. The deviations observed
can vary from a simple feature not working to unexpected crash while it is being
used.
2. What is a Software Bug?
A bug is an unofficial name given to defects when the software requirements are not
satisfied. This mainly happens when there is coding error from the developers,
ambiguous requirements, strict deadlines, very complex application, testing process
not as per standards etc. A bug comes into picture only while test cases are
executed or while simply verifying the software.
In the entire process of testing, there is enormous focus on determining,
communicating, examining, and fixing bugs. So while it is created by the tester, it is
expected that it is described nicely with adequate evidence on the summary,
expected outcomes, actual outcomes, steps to reproduce it, screenshots of failure,
logs, environment details, severity, and priority etc. This helps the developer to find
the root cause of the bug, and to fix it quickly.
3. Various Terminologies Used for Software Bugs
There are various types of terminologies used for software bugs. They are listed
below −
Defect − A defect is logged by a test engineer whenever the functionalities of the
software are not working as per the requirements.
Bug − A bug is an unofficial name given to a defect, and it is logged by test
engineers.
Error − An error points to a coding error in the software. It can be created by both
the developers and testers.
Issue − An issue is a concern from the customer side when the software is not
adhering to the business requirements.
-2-
Failure − When a large number of defects come up in a software, they lead to its
failure.
Mistake − Inconsistency observed in a project document is called a mistake.
4. Why is a Software Bug Encountered?
A software bug is encountered because of the reasons listed below −
Code Missed
Sometimes it is seen that a particular feature of a software is missed or not yet
developed. For example, suppose in an e-commerce application, the add to cart
functionality is missed by the developer, because of that the test case to verify that
feature would fail. This is due to the missing code around a particular feature in the
software.
Code Improper
Sometimes it is seen that a specific feature of a software is not working as per
requirements. For example, suppose in an e-commerce application, the product
search functionality is unable to fetch the searched product, the test cases to verify
product search functionality have failed. This is due to the improper code around the
search feature.
Code Supplemental
Sometimes it is seen that an additional feature of a software has been implemented
which may not be required by the customers as per the requirements in the current
release. For example, suppose in an e-commerce application, an extra functionality
of product return has been implemented. This resulted in unnecessary wastage of
time and effort.
-3-
How is a Software Bug Identified?
To identify a software bug, the testers verifying it have a thorough understanding of
its features and functionalities. They also have an overview of the outline of the code.
Finally, they have the understanding of any undesired results, or failures in the
software. Some steps to identify bugs are listed below − Sighting
When testing a software, the tester should always have a mindset to look for a bug.
One of the ways of doing this is being very attentive to every detail in the software.
This helps in sighting discrepancies in data, code, identifying broken lines on the
web page etc.
Testing
Once a probable bug is discovered, it is very important to confirm that by either
running some mandatory tests on the software or by updating the code on our own
to reach a conclusion.
Inspection
It is seen that it is not always possible to find bugs without external help. Assistance
from other team mates while inspecting the code to find anomalies there or while
detecting errors in the software help a lot in identifying bugs.
5. Software Testing - Code Freeze
Each step in the software development life cycle (SDLC) has specific roles to play
for the product development. Code freeze is an activity where the developers pause
to make any further code changes. There are three types of freezes in SDLC,
namely requirement freeze, code freeze, and feature freeze.
-4-
What is a Code Freeze?
Code freeze is stopping any modification in the code for a certain period of time. It
generally takes place at the later stages of SDLC, while the software is being
planned for a release. Thus, it is done to limit further changes to the software just
before being shipped to the customers.
A code freeze is implemented to avert a situation where the developers make
changes to the code at the last moment, and impact its stability. As a code freeze is
announced, there are no possibilities to make any updates to the software.
However, in case of unavoidable circumstances, where critical bug fixes need to be
made, code changes can be pushed by the developers only after a thorough review
and approvals from the project stakeholders. Post code fix stage, the software is
considered ready for production deployment.
This concept is generally followed in the waterfall model of development. However, it
is not widely accepted in the Agile framework since it is redundant there and does
not follow the principles of agile. Moreover, it brings down the software quality and
slows down production release.
Why is Code Freeze Important?
Code freeze is important for the reasons listed below :
- It avoids potential risks on the code stability.
- It does not allow the developers to make recurrent changes to the software.
- It provides flexibility to the developers to integrate multiple modules without
worrying about unforeseen errors.
- It helps to continue a good site performance by stopping service disturbances.
-5-
Advantages of Code Freeze
- Restricts unforeseen modifications and errors during code changes.
- It confirms a stable software.
- Code freeze period can be utilized by developers for other code optimization
projects.
Disadvantages of Code Freeze
- It can result in poorly developed code due to strict project timelines.
- It requires approval from project stakeholders before starting a code freeze.
- It requires approval from project stakeholders to make critical bug fixes during a
code freeze.
- The developers are not fully occupied with work during the code freeze period.
How to Implement a Code Freeze?
Implementing a code freeze involves activities before, during, and after the freeze
period.
i. Preparation (Before the Freeze)
Complete all planned work: Ensure all intended features and modifications are
integrated and stable before the freeze starts.
Resolve existing bugs: Identify and fix as many defects as possible to give the
QA team a cleaner baseline.
Perform initial testing: Conduct thorough unit and integration testing to confirm
no new errors have been introduced by recent changes.
Perform security testing: Complete proper security sweeps to identify
vulnerabilities ahead of time.
Communicate effectively: Provide ample notice to all stakeholders (developers,
testers, product teams, etc.) about the start date, end date, and implications of
the freeze. Clear communication helps manage expectations across the entire
organization.
-6-
Obtain necessary approvals: Ensure project stakeholders have signed off on
the plan to proceed with the freeze.
Document procedures: Create guidelines for how to handle exceptions and
what constitutes a "critical bug fix" that would be allowed during the freeze.
ii. Execution (During the Freeze)
Halt new development: Strictly enforce the rule that no new features or non-
critical changes are merged into the frozen branch.
Focus on testing and bug fixing: The main activity during this period is intensive
testing, including regression testing, performance testing, and user
acceptance testing.
Manage critical bug fixes: Only allow show-stopping, customer-impacting, or
system-crashing issues to be addressed, and only after a formal review and
approval process (often by a change control board).
Utilize non-deployment time: Developers can use this time to work on other
tasks that don't involve deploying to the main branch, such as reducing
technical debt, planning future road maps, or documentation.
Monitor continuously: Keep a close eye on system performance and logs to
quickly identify and respond to any incidents.
iii. Post-Freeze (After the Freeze/Release)
Review and address remaining issues: Analyze and resolve any lingering
problems identified during the testing phase.
Integrate stabilized code: Ensure a smooth integration of the now-stable frozen
code into the main branch or production environment.
Prepare for deployment: Finalize release notes and coordinate with operations
teams for a successful software launch.
Conduct a post-freeze review: Hold a review meeting to discuss lessons
learned and identify areas for process improvement for future freezes.
-7-
6. Software Testing - Code Inspection
The software development life cycle (SDLC) consists of multiple stages. Each and
every stage of it plays an important role towards software development. Inspection
is a critical step for the complete building of the software.
The focus is not only in creating the software but also in verifying the entire code
used for building it and detecting faults in them. This is known as code verification.
It is of two types listed below −
Dynamic Technique − It is done by running the software by feeding some inputs to
it. Then the output it generates is examined to find issues in the code.
Static Technique − It is done by running the software conceptually without any data
and inputs. The static techniques include reading through the code, static analysis,
code reviews, inspections etc.
What is Code Inspection?
The code inspection is done to review the code of the software and detect errors in it.
It reduces the probability of fault multiplication and defects being detected at the
later stages of SDLC by streamlining the bug identification procedures. Thus code
inspection is a part of code review.
How Does the Code Inspection Work?
The moderator, author, reader, and recorder forms a part of the code inspection
team. All relevant documents are made available to this team to plan for the future
course of actions in this regard. If the inspection team is unaware of the project, the
author gives an introduction of the project and the outline of code to the inspection
team.
The inspection team then checks every piece of code as per the inspection
checklists. Once inspection has been completed, the inspection team informs the
findings of the reviewed code to the respective team members.
-8-
Why is Code Inspection Done?
The code inspection is done for the reasons listed below −
- It detects faults in the software code.
- It identifies if there are any needs for process improvements.
- It validates if the correct coding standards are followed in the project.
- It involves peer review of the code.
- It records and documents all the bugs in the code.
7. Advantages of Code Inspections
The advantages of code inspection are listed below −
- It is done to enhance the software quality.
- It identifies bugs in the software code.
- It suggests various process improvements in the project.
- Educates the team how to leverage from past mistakes.
- It detects inefficiency in the code and project.
Disadvantages of Code Inspections
- It is a time-consuming process.
- It requires extensive planning and execution.
What are the Code Inspection Checklists?
The common code inspection checklists are listed below −
- If the code is readable.
- If the code is maintainable.
- If there is efficient coding.
- If the code is incorporating all the software requirements.
- If the code has been created keeping in mind all the security features.
- If the code has the correct formatting, indentions, comments etc.
- If the code has been unit tested.
- If the code is as per the standards.
-9-
- If the code has all the relevant documentations and references.
The code inspection checklists followed in various projects, and organizations may
differ from one another based on the multiple factors. Also, the checklist items for
code inspections are revisited frequently to incorporate new changes. They assist
the inspection procedure but not a replacement for human code review and
knowledge.
What are the Errors that are Generally Detected During the Code Inspections?
The errors that are generally detected during the code inspections are listed below −
Data Errors − Some of the data errors are −
- The variables are not initialized correctly before actually using them.
- The constants have no proper names.
- There is buffer overflow.
Control Errors − Some of the control errors are −
- The conditions in the conditional statements are not correct.
- The loop is not ending correctly.
- All the code snippets do not correct brackets.
Input/Output Errors − Some of the input/output errors are −
- All the input variables remain unutilized.
- All the output variables are not assigned values.
- Some of the input values get corrupted.
Interface Errors − Some of the interface errors are −
- The methods and functions do not have proper parameters.
- The formal and actual parameters are not matching.
- The parameters are not appearing in the correct sequence.
- The parameters are not sharing the same memory structure.
- 10 -