12 Marks ST Important Questions
12 Marks ST Important Questions
2. Logical Bugs
Do you know Logical bugs are common in software
development and can be quite challenging to identify and fix?
Unlike syntax errors, which are relatively easy to spot due to
their violation of the programming language’s rules, logical
bugs occur when the code does not produce the expected
output or behavior.
In the image shown below, the user’s action of clicking on the
“Blog” page in Testsigma is depicted. It would be considered a
logical bug if the user is redirected to the “Support” or any
other page.
3. Workflow Bugs
This bug can be a major hindrance to productivity and
efficiency in any organization. These bugs refer to glitches,
errors, or bottlenecks within a workflow process, causing team
members delays, confusion, and frustration.
Let’s consider an example to explain this concept. Upon
accessing the website – Testsigma.com on the below-
mentioned page, the user is expected to be redirected to the
documents page upon clicking the “Doc” icon. However, this
expected behavior does not occur. In that case, it can be
inferred that a workflow bug exists within the system.
4. Unit Level Bugs
Unit-level bugs refer to the defects or errors at the smallest
testable component of a software system, known as a unit.
These units can be functions, methods, classes, or modules.
When developers write code, they break it into smaller units
to make it more manageable and easier to test.
Explaining a unit-level bug through an example is a simple
task. The image shows no action after clicking the “Schedule
a Demo” button. Based on this observation, it can be
concluded that the issue is a unit-level bug, which pertains to
a defect that occurs at the smallest unit of code – a module,
function, or statement.
5. System-Level Integration Bugs
System-level integration bugs refer to the issues that arise
when different components or subsystems of a complex
system fail to work together seamlessly. These bugs can
occur for various reasons, such as incompatible interfaces,
module miscommunication, or inadequate testing.
Consider an example scenario –
Suppose we have a web application with multiple modules
like user registration, login, checkout and payment
processing. Different teams develop each module, which must
be integrated for the application to function correctly. The
application throws an error when the user clicks on “Proceed
to Payment” – means the system failed where the checkout
was integrated with payment. This will be an example of a
system-level integration bug.
6. Out of Bound Bugs
Out Of Bound Bugs occur with logical and arithmetic errors
exceeding the allowable boundaries of a specified operation.
Consider the following scenario in which a user attempts to
schedule a Demo in Testsigma. Upon navigating to
the TimeSlot page, the user incorrectly selects a date one
day before the current date, July 18th, 2023. As a result, the
Demo gets scheduled for July 17th, 2023, which is outside the
acceptable range of dates. This can be categorized as an out-
of-bounds bug.
7. Security Bugs
These are persistent and concerning issues in the world of
technology. These bugs refer to vulnerabilities or flaws in
software, hardware, or systems that malicious actors can
exploit to gain unauthorized access, steal sensitive
information, disrupt services, or cause other harmful
consequences.
So, here is an example of a security flaw. Look at the image
below where the user enters the wrong combination login on
Testsigma login page, it lets the user in! This is a major
software flaw because it exposes the site to security risks.
This will enable anyone to log in to the application. It’s a
security bug.
Common Examples of Software Bugs
Software bugs are flaws within a program that prevents it from
performing correctly and can be caused by design or coding
errors. Common examples of software bugs include:
Unexpected program crashes
Results that don’t match expectations,
The program encountering an infinite loop,
Incorrect calculations,
Data missing from a database
Malfunctioning user interface elements,
Unresponsive API
Security vulnerabilities
Errors with file permissions
Unnatural slowness
Compatibility issues
Impact of Software Bugs!
Software bugs can have far-reaching consequences on
software systems, businesses, and users alike. The following
points outline the primary effects of software bugs:
Extended Development Time: Software bugs can lead to
a prolonged development period, as they need to be
found, identified, and corrected.
Increased Cost: Investigating and fixing software bugs
can be expensive and time-consuming, increasing
development costs.
Reduced System Quality: Bugs may prevent a software
system from functioning properly, decreasing system
quality.
User Frustration: Software bugs can create confusion,
frustration, and dissatisfaction, leading to a poor user
experience.
Regulatory Compliance Violations: Software bugs can
sometimes cause a business to violate the applicable
regulatory standards.
2. Explain about path instrumentation.
Ans: Path Instrumentation
Path instrumentation confirms that the outcome was achieved
by the intended path.
The displayed image is an example of a routine for the
assumed input value x=4
If it yields the same output y=5 for all the case statements
then it said to be co-incidental correctness
Otherwise it detects a bug
Link Counter
A less disruptive (and less informative) instrumentation
method is based on outcomes
Instead of a unique link name to be pushed into a string when
the link traversed, we simply increment a link counter, we now
confirm that the path length is expected
The same problem that led thus to double link markers also
leads us to double link counters.
3. Discuss in detail Domain and Path Testing.
Ans: Domain testing and path testing are both software
testing techniques that help identify issues in a program:
Domain testing
A software testing method that involves inputting data into an
application and evaluating the outputs to ensure that the
application accepts the data and produces the expected
results. Domain testing is an example of partition testing,
which divides a program's input space into domains. Domain
boundaries are where most domain bugs occur.
Path testing
A software testing technique that helps identify issues in a
program's code that could impact its performance and
functionality. Path testing is a white box testing technique that
analyzes a program's control-flow graph to find paths of
execution. It's often used by software programmers to unit
test code.
## Domain and Path Testing
## Domain Testing
### Overview
Domain testing is a technique that evaluates the behavior of a
program based on specific sets of input values, known as
domains. The primary goal is to verify that the software
correctly handles valid inputs while rejecting invalid ones. This
method can be categorized into two types based on its
application:
- **Functional Testing**: When based on specifications,
focusing on what the software should do.
- **Structural Testing**: When based on implementation
details, focusing on how the software is constructed.
### Advantages
- **Efficient Use of Resources**: By concentrating on specific
input ranges, domain testing allows for more effective
allocation of testing resources.
- **Enhanced Test Coverage**: It helps ensure that all
relevant scenarios are tested, particularly those that may lead
to errors[4].
- **Improved Software Quality**: Identifying edge case issues
contributes to building more robust applications.
## Path Testing
### Overview
Path testing is a structural testing technique that focuses on
executing various paths through a program's control flow
graph. The objective is to ensure that all possible execution
paths are tested at least once, which helps uncover logical
errors in the code.
### Advantages
- **Comprehensive Coverage**: Path testing ensures that all
logical paths are executed, reducing the likelihood of
undetected errors.
- **Focus on Logic Flaws**: It specifically targets logical errors
that may not be evident through other testing methods[5].
## Conclusion
Both domain and path testing play crucial roles in software
quality assurance by focusing on different aspects of program
behavior. Domain testing emphasizes input validation and
boundary conditions, while path testing concentrates on
execution logic. Together, they provide a comprehensive
approach to identifying and resolving potential issues within
software applications.
4. Explain the concept of design tables in software
testing and discuss their structure and importance.
Ans: A "design table" in software testing, also known as a
"decision table," is a tabular structure used to systematically
define various input conditions and their corresponding
expected outcomes, essentially helping testers create
comprehensive test cases by considering all possible
combinations of conditions within a system with complex
business rules, ensuring thorough test coverage and
identifying potential logical errors.
Structure of a Design Table:
Conditions:
The top row of the table lists all the relevant input conditions
that can affect the system's behavior, often represented as
Boolean values (True/False) or discrete values.
Actions:
The next row(s) define the possible actions or outputs that the
system should perform based on the conditions.
Rules:
Each row below the conditions and actions represents a
unique combination of conditions (a "rule") and specifies the
corresponding expected action for that scenario.
Importance of Design Tables:
Comprehensive Test Coverage:
By systematically listing all possible combinations of
conditions, design tables help ensure that all potential
scenarios are tested, reducing the risk of missing edge
cases.
Clear Test Case Design:
The tabular format makes it easy to visualize and understand
the relationships between input conditions and expected
outcomes, facilitating clear test case creation.
Identifying Logical Errors:
When reviewing the rules in a design table, testers can readily
identify potential inconsistencies or illogical behaviors in the
system's logic.
Documentation and Communication:
Design tables act as valuable documentation for both testers
and developers, clearly outlining the expected behavior under
different conditions.
Example Scenario:
Imagine testing a discount calculation feature on an online
store.
Conditions:
o Customer is a member (True/False)
o Order total exceeds $50 (True/False)
o Current promotion active (True/False)
Actions:
o Apply 10% discount
o Apply 15% discount
o Apply no discount
Rules:
o Rule 1: (Member = True, Total > $50, Promotion =
True) - Apply 15% discount
o Rule 2: (Member = True, Total > $50, Promotion =
False) - Apply 10% discount
o Rule 3: (Member = False, Total > $50, Promotion =
True) - Apply 10% discount
Key Points:
Design tables are particularly useful when testing
complex business rules with multiple conditions and
interactions.
While creating a design table, it's important to identify all
relevant conditions and ensure that all possible
combinations are considered.
Design tables can be used in conjunction with other
testing techniques like equivalence partitioning and
boundary value analysis to further enhance test
coverage.
1. Condition Stubs : The conditions are listed in this first
upper left part of the decision table that is used to
determine a particular action or set of actions.
2. Action Stubs : All the possible actions are given in the
first lower left portion (i.e, below condition stub) of the
decision table.
3. Condition Entries : In the condition entry, the values are
inputted in the upper right portion of the decision table. In
the condition entries part of the table, there are multiple
rows and columns which are known as Rule.
4. Action Entries : In the action entry, every entry has
some associated action or set of actions in the lower
right portion of the decision table and these values are
called outputs.
Types of Decision Tables :
The decision tables are categorized into two types and these
are given below:
1. Limited Entry : In the limited entry decision tables, the
condition entries are restricted to binary values.
2. Extended Entry : In the extended entry decision table,
the condition entries have more than two values. The
decision tables use multiple conditions where a condition
may have many possibilities instead of only ‘true’ and
‘false’ are known as extended entry decision tables.
Applicability of Decision Tables :
The order of rule evaluation has no effect on the
resulting action.
The decision tables can be applied easily at the unit level
only.
Once a rule is satisfied and the action selected, n
another rule needs to be examined.
The restrictions do not eliminate many applications.
Example: https://www.guru99.com/decision-table-testing.html
5. Describe briefly the Flow/Graphs and Path testing.
Ans: Flow graphs and path testing are techniques used in
software engineering to analyze and test programs:
Flow graphs
A pictorial representation of a program's structure, similar to a
topographic map. Flow graphs focus on a program's control
flow, and don't show the details of what's inside a process
block.
Path testing
A family of test techniques that involve selecting a set of test
paths through a program. The basis path testing method is a
white box technique that analyzes a program's control flow
graph to find linearly independent paths of execution.
Control flow graphs
A graphical representation of a program's control
structure. Control flow graphs can be used to clarify control
flow and data flow issues.
## Flow Graphs and Path Testing
****Flow Graphs****
****Path Testing****
INTRODUCTION:
o Data Flow Testing Strategies are structural
strategies.
o In contrast to the path-testing strategies, data-flow
strategies take into account what happens to data
objects on the links in addition to the raw
connectivity of the graph.
o In other words, data flow strategies require data-
flow link weights (d,k,u,c,p).
o Data Flow Testing Strategies are based on selecting
test path segments (also called sub paths) that
satisfy some characteristic of data flows for all data
objects.
o For example, all subpaths that contain a d (or u, k,
du, dk).
o A strategy X is stronger than another strategy Y if
all test cases produced under Y are included in
those produced under X - conversely for weaker.
TERMINOLOGY:
1. Definition-Clear Path Segment, with respect to
variable X, is a connected sequence of links such
that X is (possibly) defined on the first link and not
redefined or killed on any subsequent link of that
path segment. ll paths in Figure 3.9 are definition
clear because variables X and Y are defined only on
the first link (1,3) and not thereafter. In Figure 3.10,
we have a more complicated situation. The
following path segments are definition-clear: (1,3,4),
(1,3,5), (5,6,7,4), (7,8,9,6,7), (7,8,9,10), (7,8,10),
(7,8,10,11). Subpath (1,3,4,5) is not definition-clear
because the variable is defined on (1,3) and again
on (4,5). For practice, try finding all the definition-
clear subpaths for this routine (i.e., for all variables).
2. Loop-Free Path Segment is a path segment for
which every node in it is visited atmost once. For
Example, path (4,5,6,7,8,10) in Figure 3.10 is loop
free, but path (10,11,4,5,6,7,8,10,11,12) is not
because nodes 10 and 11 are each visited twice.
3. Simple path segment is a path segment in which
at most one node is visited twice. For example, in
Figure 3.10, (7,4,5,6,7) is a simple path segment. A
simple path segment is either loop-free or if there is
a loop, only one node is involved.
4. A du path from node i to k is a path segment such
that if the last link has a computational use of X,
then the path is simple and definition-clear; if the
penultimate (last but one) node is j - that is, the path
is (i,p,q,...,r,s,t,j,k) and link (j,k) has a predicate use -
then the path from i to j is both loop-free and
definition-clear.
STRATEGIES: The structural test strategies discussed
below are based on the program's control flowgraph.
They differ in the extent to which predicate uses and/or
computational uses of variables are included in the test
set. Various types of data flow testing strategies in
decreasing order of their effectiveness are:
1. All - du Paths (ADUP): The all-du-paths (ADUP)
strategy is the strongest data-flow testing strategy
discussed here. It requires that every du path from
every definition of every variable to every use of
that definition be exercised under some test.
https://www.geeksforgeeks.org/state-transition-testing/