Assignmment STQA Practical
Assignmment STQA Practical
Assignmment STQA Practical
In the following code, how would you create test cases to achieve 100% statement coverage?
def process_order(order):
if order.status == "paid":
Q-1 print("Processing payment")
if order.status == "shipped":
print("Shipping order")
print("Order complete")
Given the following code, how would you ensure 100% branch coverage?
def check_discount(price, is_member):
if is_member:
if price > 100:
Q-2 return price * 0.9
else:
return price
else:
return price
In the following code, what test cases would you design to achieve condition coverage?
def apply_discount(price, is_member, season):
if is_member and season == "summer":
Q-3 return price * 0.8
else:
return price
For the following code, how would you design test cases to achieve Decision/Condition coverage?
def calculate_fee(amount, is_student):
if amount > 50 and is_student:
return amount * 0.8
Q-4 elif amount <= 50 or not is_student:
return amount
else:
return 0
For the code below, which test cases are necessary to achieve multiple condition coverage?
def check_discount(price, is_member, is_vip):
Q-5 if price > 100 and is_member and is_vip:
return price * 0.7
elif price <= 100 or not is_member or not is_vip:
return price
In the following code, what test cases would you create to cover variable definitions and usages for Dataflow coverage?def update_balance(account):
Q-6 if account.balance > 0:
account.balance -= 10
else:
account.balance += 5
Given the following code, which mutations would you apply for mutation testing?
def is_eligible_for_discount(amount, age):
if amount >= 100 and age >= 18:
Q-7 return True
else:
return False
UNIT-3
Q-1 Given a program that takes an input integer value for the number of items in a shopping cart (1 to 100 items). What are the boundary values you would test for this scenario?
Q-2 How would you test the robustness of a system that accepts numeric inputs for a salary field, where the acceptable range is 0 to 100,000? Provide examples of valid and invalid inputs.
Q-3 For a system where users can select an age group (Child: 0-12, Teen: 13-19, Adult: 20-64, Senior: 65+), how would you apply Equivalence Partitioning to test the age input?
Q-4 You are testing a field where a user must enter their phone number in the format (XXX) XXX-XXXX. What are some invalid inputs you would check for using Syntax Testing?
Q-5 For an ATM system, there are multiple states like Idle, User Authentication, Pin Entry, Transaction, and Logout. What types of state transitions and conditions would you test?
Q-6 A unit test is written for a function that converts temperature from Celsius to Fahrenheit. The input is a floating-point number. What edge cases or test cases would you consider for unit testing?
Q-7 You are testing a web-based login page. The valid inputs are an email address and a password, both of which are required. How would you perform black-box testing for this page?
UNIT-4
Q-1 Can you provide examples of functional test cases for an e-commerce website?
Q-2 How would you test the security of a banking application as part of non-functional testing?
Q-3 How would you design an acceptance test plan for a newly developed CRM software?
Q-4 What are the critical factors to consider when performing performance testing on a high-traffic website?
Q-5 In what scenarios would automated regression testing be more beneficial than manual testing?
Q-6 Which view of software quality is most important when developing a high-performance system, and why?
Q-7 How would you implement a quality standard framework (e.g., ISO 9001) for a software testing team in an Agile environment?
UNIT-5
Q-1 How does encapsulation in object-oriented programming present unique challenges in software testing?
Q-2 What are some specific testing techniques suited for non-OO software but unsuitable for OO software, and why?
Q-3 Which aspects of a class (such as methods, attributes, or interactions with other classes) need the most focus during testing?
Q-4 In what scenarios would state-based testing be more advantageous than traditional functional testing?
Q-5 How do ISO 9000 standards apply to software testing processes and documentation?
Q-6 How do you address conflicts or disagreements between developers and QA personnel?
Q-7 How does progressing to higher levels in the CMM impact a company's software development practices?