WorksheetsLogic-Based Testing Quiz
Total questions: 60
Worksheet time: 3600secs
What is the primary goal of logic-based testing in software testing?
To check syntax errors
To ensure all logical paths in the code are tested
To optimize the program’s execution speed
To verify UI design elements
In logic-based testing, which condition must be met for a student to take an online exam?
The student is registered OR the exam is scheduled
The student is registered AND the exam is scheduled AND the student has not attempted it
The exam is scheduled AND the student is registered
The student has not attempted the exam OR the exam is scheduled
Which of the following is a real-world example of logic-based testing?
Verifying spelling errors in a document
Testing conditions in a traffic light control system
Checking internet connectivity
Ensuring a website loads fast
In logic-based testing, what happens when an invalid condition is met?
The program crashes
The system executes an error-handling message
The program bypasses the condition
The test case is ignored
What is the role of logical constructs in programming?
To minimize memory usage
To control program execution flow based on conditions
To optimize user interface design
To manage database connections
Which logical construct is used in the condition: if (A AND B) then execute?
OR
NOT
AND
XOR
Which of the following test cases should be considered for logic-based testing of a program checking if a number is positive and even?
Positive even number
Positive odd number
Negative even number
All of the above
What is tested in hardware logic testing?
User interface responsiveness
Logical circuits of hardware components
Internet speed
Application database
In a logic circuit with an AND gate, what will be the output when inputs A=1 and B=0?
1
0
-1
None
In a washing machine, logic testing ensures:
The drum rotates correctly
The "Wash" button activates the motor and water valve
The user can set a timer
The display screen functions properly
Which of the following is a type of specification system?
Formal specifications
Semi-formal specifications
Informal specifications
All of the above
What is an example of a semi-formal specification?
Z notation
UML diagrams
Requirement documents
Pseudocode
What is the primary use of decision tables?
To simplify code logic
To define complex decision-making logic in software testing
To create UI layouts
To optimize memory usage
Which notation is used in decision tables?
Y for Yes, N for No, and "-" for Don't care
A for Accept, R for Reject
1 for True, 0 for False
X for Don't know
Which is NOT a component of a decision table?
Condition stubs
Action stubs
Loops
Condition entries
What is a path expression used for in software testing?
To describe all possible execution paths in a program
To represent class hierarchies
To verify database transactions
To debug syntax errors
What does the "+" operator signify in path expressions?
Sequential execution
Alternative paths
Looping
Boolean negation
Which real-world scenario can be represented using path expressions?
Logging into an online banking portal
Checking spelling errors in a document
Measuring CPU temperature
Changing screen brightness
Boolean Algebra is primarily used for:
Decision-making in software testing
Memory management
Image processing
Data encryption
The result of AND operation between A=1 and B=0 is:
1
0
-1
Undefined
What does the NOT operator do?
Negates the value of an operand
Adds two Boolean values
Multiplies two Boolean values
Inverts a logical condition
According to the identity rule in Boolean algebra:
A + 0 = A
A + 1 = 0
A . 1 = 0
A . A = 0
What is the result of applying the idempotent law on A + A?
A
0
1
A’
What is the result of A + A'?
0
1
A
Undefined
Which rule states that A + AB = A?
Idempotent law
Absorption law
Involution law
Distributive law
What is the result of applying the involution law on NOT(NOT A)?
A
NOT A
A AND A
A OR A
According to the absorption rule, A + AB simplifies to:
A
B
AB
A + B
Which of the following Boolean expressions is always equal to 1?
A + A'
A ⋅ A'
A + 0
A ⋅ 1
According to the distributive law, (A + B) ⋅ C simplifies to:
A ⋅ C + B ⋅ C
A ⋅ B + C
A + B ⋅ C
(A + B) + C
What does A + A = A represent in Boolean algebra?
Idempotent law
Complement law
Absorption law
Associative law
What is the primary advantage of logic-based testing?
It reduces software execution time
It ensures all logical conditions in a program are tested
It eliminates the need for functional testing
It automates the entire testing process
Which of the following best describes a logical error in a program?
A syntax error that prevents compilation
A program running but not producing the expected output due to incorrect logic
An error in variable declaration
A missing user interface element
Which logical condition will always evaluate to true?
(A AND B) OR (A AND NOT B)
(A OR B) AND (A AND B)
(A AND A')
(A OR NOT A) AND (B OR NOT B)
In a traffic light control system, which logic condition ensures a smooth transition from "Go" to "Stop"?
IF green light is ON AND pedestrian button is pressed, THEN turn yellow
IF red light is ON AND cars are waiting, THEN turn yellow
IF green light is OFF AND pedestrian button is pressed, THEN reset system
IF yellow light is ON AND timer is 10 seconds, THEN turn green
In digital circuit testing, which method is used to verify the correctness of logic gates?
Boundary value analysis
Truth table verification
Equivalence partitioning
Decision table testing
A flip-flop circuit is tested using hardware logic testing. What does it verify?
The transition between logic states
The speed of execution
The size of the circuit
The cost efficiency
Formal specifications in software testing are beneficial because:
They provide a mathematical representation of software behavior
They replace the need for requirement documents
They eliminate the need for software testing
They allow informal descriptions of functionality
A state transition diagram is an example of:
Formal specification
Semi-formal specification
Informal specification
None of the above
What is the primary reason for using a decision table in test case design?
To visualize and test all possible input conditions
To eliminate software coding errors
To reduce the number of UI tests required
To improve application security
In a decision table, an entry with a "-" symbol signifies:
The condition is irrelevant for that rule
The condition is mandatory for that rule
The condition is always false
The action is always performed
What happens when a decision table is too large due to multiple conditions?
It is split into multiple smaller decision tables
It is removed from testing
It is replaced with a truth table
It is converted into a flowchart
What does the closure (*) operator in a path expression represent?
Sequential execution of statements
An optional condition in the execution path
A loop that repeats a certain execution path
An exclusive OR operation
How does path expression testing benefit software development?
It ensures that all possible execution paths are analyzed
It speeds up code compilation
It eliminates syntax errors automatically
It reduces the memory usage of the software
Which of the following represents an alternative execution path in path expressions?
A . B
A + B
A * B
A / B
Which Boolean operation is used to check if at least one condition is true?
AND
OR
NOT
XOR
If A = 1 and B = 0, what is the output of A ⋅ B + A'?
0
1
-1
Undefined
How can Boolean expressions be simplified in software testing?
Using Karnaugh Maps (K-Maps)
Using brute force execution
By replacing variables with constants
By increasing the number of test cases
What does A ⋅ (B + C) = A ⋅ B + A ⋅ C represent in Boolean algebra?
Distributive law
Absorption law
Associative law
Idempotent law
The complement of a Boolean variable A is represented as:
A'
A + 1
A - 1
A AND 0
In Boolean algebra, A + 1 always evaluates to:
1
A
0
A
What does the entry in the KV chart box represent for a single variable?
The sum of all truth values
Whether the function is true or false for that value
The probability of the variable being 1
The number of variables used
How many possible functions can be represented in a two-variable KV chart?
8
16
32
64
What is the primary advantage of using KV Charts in Boolean algebra?
They increase the number of test cases
They reduce Boolean algebraic manipulations to graphical representations
They eliminate all logical errors
They reduce the number of Boolean variables
In a two-variable KV chart, a pair of adjacent boxes can be adjacent in which directions?
Horizontally and diagonally
Vertically and diagonally
Horizontally and vertically
Only horizontally
In a single-variable KV chart, what does a ‘1’ in a box indicate?
The variable's value is FALSE
The variable's value is TRUE
The variable is eliminated from the expression
The variable is unused in the function
How many different Boolean functions can be represented in a three-variable KV chart?
64
128
256
512
In a three-variable KV chart, which of the following groupings is NOT valid?
A single box
A group of 2 boxes
A group of 6 boxes
A group of 8 boxes
What is the key characteristic of a KV chart representation?
Each box represents an elementary term of the variables
Diagonal adjacency is allowed
It works best for more than six variables
It eliminates all logical expressions
How is negation of a KV chart achieved?
By flipping the positions of 0s and 1s
By rotating the chart by 90 degrees
By multiplying the values of adjacent boxes
By grouping all 1s together
If a KV chart has two 1’s that are not adjacent, how are they represented?
By adding them using a plus sign
By subtracting them
By negating one of them
By considering only the first 1
