Execution and iteration × Programming
Business lens: Execution and iteration · Technology lens: Programming
Reading scope: Original subject-specific synthetic case, not exhaustive coverage or an established named framework.
Foundation: executable rules need a business contract
Execution turns a plan into work; iteration revises that work using evidence. Programming makes rules executable and repeatable. Their intersection begins with an agreed contract for an action, such as accepting a production request. Without a clear contract, code can automate ambiguity and produce the same wrong result consistently.
Define inputs, intended output, allowed states and exception ownership. A program receiving an order does not know whether the customer approved the current proof unless that evidence is represented and interpreted. Ask what the machine can check and what remains a human decision. Faster processing is useful only within a suitable outcome boundary.
Undergraduate: trace the action and its exceptions
Sales submits an order, design names a proof version, an authorised confirmation is recorded and production receives a request. Identify the exact handoff at each step. Missing version, duplicate request and conflicting approval should produce understandable outcomes rather than silently proceed. Specify who receives an exception and what information they need.
Consider a retry after a network interruption. The sender may not know whether the first request was processed. Accepting it twice can duplicate work; rejecting every retry can leave work unresolved. A request identifier and a record of the accepted payload can help distinguish a repeat from a conflict. Classroom fixtures do not establish production durability.
Framework: contract, validate, act, observe, revise
Use an original contract–validate–act–observe–revise worksheet. Describe the action, check inputs against explicit rules, perform the intended bounded operation, record the result and review errors. Separate validation from authorisation. A well-formed customer identifier is not evidence that its bearer may change an order.
Handle exceptions precisely. Reject a negative quantity when the contract requires nonnegative work, but explain the rule and correction route. Catching every error and displaying success conceals failures. Logs should be understandable and proportionate; they should not expose confidential customer content merely because detailed debugging information is convenient for the developer.
Worked case: reconcile repeated events
Use invented requests R1 for order O1, the same R1 and O1 repeated, then R2 for order O2. Under a bounded single-process fixture, the repeat should not create a second accepted event. Two distinct requests produce two accepted events. If R1 is later reused for O2, the conflict should be rejected rather than reinterpret the earlier request.
Explain the limitations. An in-memory register can be lost when the process stops, and concurrent workers may need additional coordination. Correct behaviour in a classroom sequence does not guarantee dependable processing after a crash. The existing workshop demonstrates the idea while leaving persistent storage, recovery and real authorisation for further engineering.
Postgraduate: release learning and organisational effects
Iteration should respond to evidence rather than merely change a release number. Record the problem addressed, the proposed rule, expected consequences and conditions for rollback or revision. A developer and manager may agree that a retry check is useful while disagreeing about which business action should be idempotent. Clarify the decision boundary first.
Consult staff who resolve exceptions. A new validation rule may reduce invalid submissions while increasing manual work or confusing customers. Inspect end-to-end burden and accessibility. Local routines and global time zones can affect support ownership. Software changes should preserve understandable commitments rather than force every department to adopt an unsuitable interpretation of the workflow.
Research and portfolio: evaluate dependable work
A research question could examine whether an explicit request contract improves detection of duplicate and conflicting actions. Define a test set containing valid, invalid, repeated and ambiguous cases. Assess correct detection separately from recovery and user understanding. A test suite can establish behaviour within its cases without proving that every real-world failure is covered.
Submit the contract, state sketch, request sequence, expected results, error messages and release-review memo. Ask who authorises action, whom a duplicate harms, whose record is authoritative, what is validated, where state persists, when retries occur, why an exception exists, which alternative is feasible and how learning revises the contract. The synthetic exercise is not a complete deployment or a reliability certification.
Study questions and answers
Distinguish validation from authorisation.
Validation checks the input against a stated contract. Authorisation concerns legitimate permission to act. A well-formed identifier alone does not grant permission.
Marking guide: Credit input-contract validation versus legitimate permission to act. Explain why a well-formed ID does not authorise the operation.
What happens to R1/O1, repeated R1/O1 and R2/O2?
The bounded fixture accepts two distinct events and treats the exact repeat as already recorded. Reusing R1 with O2 is a conflict. This says nothing about restart durability.
Marking guide: Credit two distinct accepted events, exact repeat as already recorded and R1/O2 as identity conflict. State that the bounded fixture does not prove restart durability.
Why evaluate recovery separately?
Correct rejection can still leave users unable to proceed. Examine explanation, ownership, persistent state and feasible correction, not merely a success count.
Marking guide: Credit explanation, ownership, persistent state and feasible correction after rejection. Correct rejection or a success count alone does not establish recovery.
Practice task
Submit the distinct portfolio artefacts specified in the reading and compare the relevant existing workshop with this case.
Sources and further reading
- Python errors and exceptions
Scope: Selected primary guidance, not complete certification or course review.