AAmit’s LibraryLEARN · PRACTISE · REFLECT

Risk and resilience × Software engineering

Business lens: Risk and resilience · Technology lens: Software engineering

Reading scope: Original synthetic teaching; selected primary background and same-author checks are not independent validation.

Engineer the promise

Software engineering organises how requirements become maintained systems. Resilience begins in the requirement: what should happen when a dependency is unavailable, a response is ambiguous or a user repeats an action? For a fictional supplier-order service, write both normal and interrupted behaviour. A specification saying that the system must be reliable gives developers little usable guidance. Describe the accepted transaction, the evidence of completion, the retry boundary and the permitted alternative. The business owner must help define those conditions because the cost of a duplicate purchase or an unrecorded purchase cannot be inferred from code structure alone.

Separate interface and implementation contracts

An interface contract states what callers may expect from a request and its response. An implementation can change while preserving that contract, or it can quietly break it even when the code passes its own local tests. Record fields, units, identifiers, error states and version boundaries. A caller receiving an acknowledgement needs to know whether work is merely queued or actually completed. Procurement explains approval requirements, operations explains dispatch state, finance explains reconciliation and developers translate those meanings into explicit outcomes. A contract review should include the people who rely on the response rather than only the teams that produce it.

Worked acceptance coverage

The fictional release defines twenty acceptance scenarios before testing. Sixteen pass, two fail and two have not been executed. Pass coverage against the complete defined set is 16/20 = 80%. The pass share among executed scenarios is 16/18, about 88.89%. The first measure exposes untested work; the second answers a narrower question. Reporting approximately 89% coverage without naming the denominator can hide the two missing scenarios. A single failed duplicate-purchase scenario may matter more than several passing display scenarios. Counts therefore support review but do not by themselves authorise release. Preserve scenario identities and their business consequences.

Use a failure-oriented review

Choose cases involving delayed acknowledgement, conflicting repeated identifiers, incompatible field versions and an unavailable approval dependency. State the expected business disposition for each. An error message should tell the caller whether retry is permitted, whether the outcome is uncertain and how to consult an owner. The existing API-contract lesson gives a guided setting for those checks. Extend it with the twenty-scenario acceptance register and mark passed, failed and unexecuted rows distinctly. Tests should examine observable outcomes at a defined boundary. Avoid merely testing that a function returns the value its own implementation happens to generate.

Plan change and reversal together

A rollback can restore an earlier application while leaving data already changed by the newer version. Before a release, identify whether the earlier version can interpret the new records and which reconciliation steps are needed. Include a fictitious field-format change and compare forward correction with reversal. A decision owner should explain the business cost and evidence behind the choice. Customer service needs a coherent status message during the transition. Managers should allocate time for rehearsal and review rather than reward only the speed of feature delivery. Reversal is a design question, not a button that guarantees recovery.

Keep evidence useful across teams

Version the acceptance register, contract and configuration used in the exercise. Connect incidents to the relevant scenario instead of building an unstructured collection of blame notes. Where the same failure recurs, ask whether the original assumption, test input or ownership boundary was wrong. Software maintenance is continuous learning when observations change the specification and the next test. The Python testing documentation offers background on assertions and fixtures, but it cannot supply the wholesaler's acceptance decision. A learner portfolio should preserve actual test results separately from the proposed twenty-scenario register and state whether any implementation was run.

Enquiry and progression

Who owns acceptance? Whom does an incompatible response affect? Whose contract version was used? What does acknowledgement mean? Where is reversal unsafe? When is an unexecuted scenario reviewed? Why report both denominators? Which failure blocks release? How is evidence transferred? Foundation study explains requirement and contract. Undergraduate study computes acceptance coverage and drafts error states. Postgraduate study critiques version compatibility, rollback and release incentives. Research study proposes a bounded comparative experiment on contract interpretations with predefined scenarios and observation rules. A passing local exercise is evidence about those tested inputs, not certification that the production service is resilient or that every organisational requirement has been met.

Study questions and answers

Compute the two pass measures.

16/20 = 80% of all scenarios; 16/18 ≈ 88.89% among executed scenarios.

Marking guide: Credit 16/20=80% of all and 16/18=88.89% of executed scenarios; retain unexecuted cases.

Why can rollback fail to restore usable service?

Earlier software may not interpret data already changed by the new version; compatibility and reconciliation must be checked.

Marking guide: Explain changed-data compatibility with older code and the need for reconciliation after rollback.

Can scenario counts authorise release?

No. Business consequence, evidence quality and the importance of failed or untested scenarios also matter.

Marking guide: Release decisions require consequence, evidence quality and significance of failed/untested cases; counts alone do not authorise release.

Practice task

Extend the API-contract lesson with twenty scenario rows, explicit error states and a data-compatibility reversal analysis.

Practice bridge

  1. Extend the API-contract lesson with twenty scenario rows, explicit error states and a data-compatibility reversal analysis.
  2. Reproduce the stated arithmetic, change one valid assumption and distinguish actual lesson observations from the invented case.

Open connected lab

Boundary: Original synthetic teaching connected to an existing bounded or guided lesson. No new executable fixture, catalogue lab or external platform execution claimed.

Sources and further reading

  • Python unittest documentation
    Scope: Selected assertions, fixtures and isolated testing background.
    Access: Free selected official documentation/background page; no enrolment or certificate claim.

Related chapters

Interactive practice

Open workshop · Open runnable practice · Open lab lab-24

Open interactive matrix reading