CS FundamentalsVery hardProduct-company placement
Assertion (A): A test suite that mocks every collaborator of every class can pass while the integrated system fails. Reason (R): Mocks encode the test author's assumptions about how collaborators behave, and those assumptions can be wrong or become outdated.
- A. Both A and R are true and R explains A
- B. Both A and R are true, but R does not explain A
- C. A is true but R is false
- D. A is false but R is true
Correct answer: A. Both A and R are true and R explains A
Over-mocked tests verify code against imagined collaborators. Integration and contract tests check the assumptions against real implementations.
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
- A single-page app makes 30 sequential API calls to render a dashboard, each taking about 40 ms of network round trip. The team cannot…
- A Scrum team's velocity over 6 sprints was 20, 22, 35, 21, 23 and 19 points; sprint 3 included a one-off batch of over-estimated stories…
- An enterprise service-level agreement promises 99.95% monthly availability with service credits, the internal SLO is 99.99%, and the…
- A team makes 'Developers must not deploy on Fridays' a rule after two weekend outages. A senior engineer argues the rule treats the…
- A brand-new repository's first commit contains a.txt (content 'hello'), src/b.txt and src/c.txt, where b.txt and c.txt have identical…
- In a hexagonal (ports-and-adapters) architecture, the order-processing core defines an interface OrderRepository, implemented by a…