CS FundamentalsHardProduct-company placement
The condition `x > 5 and x >= 0` (x an integer) is mutated four ways. Which mutant is equivalent, so that no test can kill it?
- A. `x > 5 or x >= 0`
- B. `x >= 5 and x >= 0`
- C. `x > 5 and x <= 0`
- D. `x > 5 and x > 0`
Correct answer: D. `x > 5 and x > 0`
Whenever x > 5 holds, both x >= 0 and x > 0 hold, so changing the second test never alters the result. x = 5 kills the >= 5 mutant, x = 0 kills the 'or' mutant, and x = 6 kills the <= 0 mutant.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Under basic COCOMO organic mode (Effort = 2.4 × KLOC^1.05 person-months), how does productivity in LOC per person-month for a 100 KLOC…
- Application A maintains the Customer master data. A separate Payroll application reads that customer data from A's database to print…
- A customer-maintenance screen lets users add, change and delete customers, each with its own processing. A search screen shows customer…
- What does this code print? python ops = [lambda x: x k for k in range(1, 4)] print([op(10) for op in ops])
- What does this code print (lines joined by ' / ')? python def tag(name): def deco(f): print(name) def w(): return f'<{name}>' + f() +…
- In this Observer code, handler a unsubscribes itself the first time it runs. What does it print (lines joined by ' / ')? python class Bus…