Part IV — Process and methodology · Lesson 8

Agile development and software methodology

~15 min of reading, plus collapsed slide details2 figures

In this lesson

  1. What is a software process, and what is wrong with the waterfall?
  2. What does the Agile Manifesto ask for?
  3. Who does what in Scrum, and with which artifacts?
  4. How does a Sprint run?
  5. What does a development methodology provide?
  6. How do you write a requirements specification?
  7. How do you design, and how do you document a design?
  8. What does this mean for the exam project?
  9. Check your understanding

The lesson in one paragraph. The waterfall runs the stages of development one after the other and assumes the future can be predicted. Unstable requirements, design choices that only appear while coding, and late testing break that assumption. Agile development instead welcomes change: working software is delivered in short iterations, and each one brings feedback. Scrum turns this into roles (Product Owner, Team, Scrum Master), artifacts (the backlogs and the increment) and time-boxed events around the Sprint. Whatever the process, the stages still exist: a complete, verifiable requirements specification, then architectural and detailed design, all documented as they evolve. This material matters mainly for how you organise, build and document your exam project, not for concept questions.

1. What is a software process, and what is wrong with the waterfall?

A software process says how teams are organised, who does which task, and how development activities flow. The reference is the waterfall, which nobody uses in pure form: each stage starts when the previous one ends, possibly with a different team, and each produces an artifact.

  1. Requirements engineering → the specification: which behaviour fulfils the requirements?
  2. Architectural design → the system architecture: which macro-structure?
  3. Detailed design → the detailed design document: which micro-structure?
  4. Implementation → the first working code: which runnable code?
  5. Testing and maintenance → correct, tested code: which requirements are met?
  6. Deployment → the running system: is it successfully online?

The waterfall is predictive: it requires foreseeing the future. It breaks on unstable requirements (a change freezes everything until all stages are redone), on detailed design that only emerges while coding and testing, and on late testing (code piles up on buggy abstractions).

From the slides: waterfall variants and process types
Waterfall variantIdea
With feedbackGoing back is the norm: during each stage, the result of the previous one can be revised.
With overlapping stagesStages hand over smoothly, and the different teams keep interacting throughout.
IncrementalWork is split into isolated increments (releases), built one by one at different times.
Process typeFirst deliveryLater deliveries
Predictiveall features, full accuracynone
Iterativeall features, partial accuracyincrease accuracy
Incrementalsome features, full accuracyadd features
Agilesome features, partial accuracyadd features and accuracy

Real processes add feedback, overlapping stages or increments. Agility combines iterative and incremental development: deliver some features early with partial accuracy, then add features and accuracy, to get feedback from early versions of the system.

From the slides: prototypes

Early prototypes are horizontal (a thin layer across the whole system, such as the full UI with no logic) or vertical (one feature through all layers). They improve requirements, create a shared vision and a better design, but can also narrow the vision and create impatience, pressure, expectations and a bias towards code.

2. What does the Agile Manifesto ask for?

The manifesto and its twelve principles

The Agile Manifesto (agilemanifesto.org, 2001), signed by the practitioners of the Agile Alliance, grew out of a critique of the waterfall. Its key idea: do not refuse change, embrace it. It is a set of guidelines, not a process.

Beyond the slides: the four values

The manifesto opens with four values: individuals and interactions over processes and tools; working software over comprehensive documentation; customer collaboration over contract negotiation; responding to change over following a plan. The items on the right still matter, but the ones on the left matter more.

The twelve principles; the six that most affect coding are in bold:

  1. Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.
  2. Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage.
  3. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.
  4. Business people and developers must work together daily throughout the project.
  5. Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.
  6. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.
  7. Working software is the primary measure of progress.
  8. Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.
  9. Continuous attention to technical excellence and good design enhances agility.
  10. Simplicity — the art of maximizing the amount of work not done — is essential.
  11. The best architectures, requirements, and designs emerge from self-organizing teams.
  12. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

Principle 7 is the sharpest contrast with the waterfall: only running software can be tried and produce feedback, while a finished-looking document can still predict the future wrongly. Principles 9 and 10 tie agility to code quality: without good design and simple code, frequent change becomes impossible.

Agility as the course’s philosophy

Development is broken into short pieces and periods. In each period:

  1. identify and analyse the (new) requirements;
  2. identify the main architectural decisions;
  3. write the key interfaces;
  4. write deep tests, preparing for continuous testing;
  5. develop code until the tests pass;
  6. review, improve and refactor the code before merging it upstream.

Continuous-integration tools support it, and interactions between people count for more than processes and tools. Steps 4–6 are the TDD of lesson 1.

Agile methodologies include Lean (efficiency, eliminating waste), XP (core engineering practices such as TDD and pair programming) and Scrum (a project-management wrapper). Most companies adopt some agile principles but fear to embrace them all; Scrum needs trust, experience and tailoring.

From the slides: Lean, XP and Scrum in full
MethodologyWhat it isContent
Leanlean manufacturing and lean IT principles applied to software, aiming at the highest efficiencyeliminate waste, amplify learning, decide as late as possible, deliver as fast as possible, empower the team, build quality in, see the whole
XP (Extreme Programming)a set of core engineering practices essential to every agile projectrelease planning, iteration planning, acceptance tests, stand-up meetings, pair negotiation, TDD, pair programming, code quality
Scruma project-management wrapper for agile projectsroles (e.g. Product Owner), artifacts (e.g. Product Backlog), meetings (e.g. Sprint Retrospective)

3. Who does what in Scrum, and with which artifacts?

Scrum is an iterative, incremental framework for managing product development, in which a self-organising team works as a unit towards a common goal. It answers how to split months of work into milestones and a large development among team members, how to regulate relations between team, product manager and stakeholders, and how to choose priorities and track progress.

From the slides: origin of Scrum

From Takeuchi and Nonaka’s paper “The New Product Development Game” (1986); Jeff Sutherland and Ken Schwaber applied it separately and coined the term in 1993 (a scrum is the rugby formation, mischia in Italian). The course follows “The Scrum Primer 2.0”. Scrum encourages co-location, daily face-to-face contact, or close online collaboration.

Roles

Artifacts

The Product Backlog is the prioritised, emergent list of customer-centric items for the whole project, more fine-grained at the top. Each item has a position, a description and a relative size estimate in points, so that the team’s velocity (points per Sprint) emerges. Most items should deliver customer value.

From the slides: kinds of Product Backlog items

The Sprint Backlog breaks the items chosen for one Sprint into estimated tasks assigned to people, usually shown on a to-do / in-progress / done board. Changes to the target go into the next Sprint; a dramatic change stops the current one.

The increment is the set of items completed in a Sprint, the “potentially shippable increment”. An item counts only when it meets the Definition of Done agreed at the start (for example: thorough passing tests, nothing broken, documented, meeting quality criteria, acceptance-tested); otherwise it moves to a later Sprint.

4. How does a Sprint run?

A Sprint is a time-boxed iteration of 1–4 weeks (shorter is more agile). Sprints follow one another, each producing a potentially shippable increment.

ProductBacklog Sprint Planningwhat + how SprintBacklog Sprint: 1–4 weeks tasks: to do → in progress → done Daily Scrum every day (15 min) burndown updated daily Retrospectivethe process Sprint Reviewthe product Incrementmeets the DoD next Sprint
One Sprint. Product Backlog Refinement runs alongside, using at most about 10% of the Sprint, and prepares the top of the Product Backlog for the next planning. The PO decides when an increment is actually released.
EventParticipantsTime-boxResult
Sprint Planning (part 1, part 2)whole Scrum Team; PO optional in part 21 h per part per week of SprintSprint Goal; Sprint Backlog
Daily ScrumTeam required, PO optional, SM usually present15 min, every daysynchronisation, obstacles surfaced
Product Backlog RefinementTeam and PO; SM only in early Sprints≤ 10% of the Sprint (sometimes more)items ready for the next 1–2 Sprints
Sprint Reviewwhole Scrum Team, possibly stakeholders and users1 h per week of Sprintproduct inspected and adapted
Sprint RetrospectiveTeam, SM; PO optional45 min per week of Sprintprocess improvements to try

Sprint Planning

Part 1 (what): the Scrum Team discusses the top items with the PO and agrees a Sprint Goal, a summary of the objective that leaves the exact items flexible. Part 2 (how): the team forecasts how many items it can finish, from its velocity and assuming 4–6 productive hours per person per day, and breaks them into tasks. The team decides, not the PO: it commits to a forecast.

Daily Scrum and the burndown

Every day, standing, 15 minutes: each member says what they did, what they will do, and what is in the way. Technical discussion happens in follow-up meetings. The Sprint Backlog is updated daily and the burndown chart plots the remaining points.

20151050 01234567 day of the Sprint points remaining day 3: blocked ideal 2 points left: item back to the backlog
An illustrative one-week Sprint forecast at 20 points (five items). The flat stretch shows an obstacle reported at the Daily Scrum. At the end one item is not done: it returns to the Product Backlog (the Sprint is never extended), and the velocity for this Sprint is 18 points.

Refinement, review and retrospective

Backlog Refinement splits, re-estimates and re-prioritises items for the next Sprints, so that planning is quick. The Sprint Review inspects the product: a conversation between PO and team around live software, not a slide demo. The Retrospective inspects the process: what works, what doesn’t, what to try; the next planning follows immediately.

From the slides: more on planning, the Sprint Backlog, review and retrospective

In planning part 1 the team focuses on what the PO wants and why; in part 2 it starts from the top of the Product Backlog and may pick items further down, and communicates its forecast to the PO (optional in part 2). Sprint Backlog tasks are assigned not only by volunteering or skill, typically one task per person at a time, partly dynamically. The Daily Scrum requires the team; the PO is optional and the SM usually present. Refinement involves the SM only in early Sprints. The review, often mislabelled a “demo”, is how the PO sees where the product is going and the team learns about the PO and the market; stakeholders and users may attend. For retrospectives there is a whole catalogue of techniques (“agile retrospectives”), looking at strengths as well as weaknesses.

From the slides: task boards, releases and continuous integration

The Sprint Backlog board can be physical (sticky notes on a wall) or in a tool such as Trello, possibly integrated with the repository. The PO decides when and what to release. Delivery must be quick, which takes the right technology; without it a dedicated “Release Sprint” is needed. Continuous integration and delivery tools add new code to the code base quickly, run automatic regression tests before releasing, and release automatically. Team effectiveness usually grows from Sprint to Sprint.

5. What does a development methodology provide?

Without a methodology you just start programming, which cannot handle complexity or changing requirements and works only for a handful of programmers. A methodology identifies the stages and their products, adopts suitable principles and techniques, and sets up a process to allocate and control tasks: its goal is to make development predictable. Its ingredients are principles, architecture, specification, verification, process, management and tools; its steps are those of section 1; its process can be predictive, iterative or agile.

From the slides: what a software engineer needs, definitions, and the ingredients in detail

Companies look for “software engineers” with some mix of programming, system design, project tools, team management, stakeholder skills, “AI” and the newest technologies. What is really needed: experience in building systems and in joining and guiding teams; the ability to work with people as well as machines; a balance between idealism and pragmatism (good and on time); a focus on the process, not only the result.

Definitions: “an organized approach to the design, development, use and maintenance of software”; “methods, tools and techniques used for developing software, especially when it consists of thousands of lines of code and involves many person-months”; the field of systems “so large or so complex that they are built by a team or teams of engineers”; “the theories, methods and tools which are needed to develop software”.

Ingredients: principles; architecture (design and architectural patterns, modularisation for distributed systems); specification (Petri nets, process algebras, UML, DSLs); verification (testing, code analysis, symbolic execution, simulation, model checking, debugging); process; management (planning and coordinating people); tools (compilers, IDEs, version control, repositories, build tools, deployment). Processes: waterfall, spiral, XP, Scrum.

The principles are the seven of lesson 1 (abbreviated here RF, SOC, M, A, AOC, G, I); incrementality is a quality of processes, which Sprints put into practice.

Software is more than code

Software is code, data and documentation. Project documentation records the path from requirements (what) to implementation (how): it is the team’s reference, tracks goals, choices and their motivations, mediates conflicts, and tells you why a problem happened and where to act. It is part of the software, so the software principles apply to it, and it evolves with the code rather than being written afterwards.

From the slides: the kinds of artifacts

6. How do you write a requirements specification?

A stakeholder is anyone involved who is not a developer; a requirement records a stakeholder’s need; a requirement specification says precisely what will be done to meet it. The software requirements specification (SRS) covers everything that grounds design and implementation.

Complete, not partial

The course follows the completeness school: the SRS characterises the system’s behaviour and qualities fully, filling the gaps the stakeholders left, because a system’s behaviour must be understood before design decides how the software is organised. In an agile process the specification is ongoing and may be completed during or after development. The key rule: from the same specification, two independent teams should build equivalent systems. That is also what makes good tests possible and third-party code checkable.

For example, “there are 4 types of enemies, as in the standard Pacman” becomes a specification only once each enemy’s target is stated (Blinky chases the player’s position, Pinky a point four spaces ahead, and so on); only then can the result be judged objectively.

From the slides: the four Pacman enemies

Kinds of requirements

Business (why the software is strategic, and how success is judged), functional (what it does: user requirements on interaction, system requirements on internal rules), non-functional (qualities such as performance and reliability) and implementation requirements (constraints on production, such as technologies, which must not anticipate design decisions). They are recorded as user stories, use cases, prototypes, UML diagrams, formulas, pseudo-code and tables.

From the slides: the requirement types in full
KindQuestionContent
BusinessWhy is this software strategic?High level: project goals, customers’ hopes, developers’ goals. They must say how you judge whether the project succeeded.
Functional, userHow do end users use the result?How users interact with the software, and the input/output constraints.
Functional, systemHow does the system work internally?Its rules of behaviour, norms and constraints.
Non-functionalWhat qualities must the running system have?Performance, scalability, reliability, user-friendliness…
ImplementationWhat constraints apply to production, and why?Technologies, training, material, internal quality. They anticipate details of architecture, design or process, but must not anticipate design decisions.

Verifiable and traceable

A requirement must be validatable; otherwise it is a principle. “The system should be fast” is not a requirement; “a search returns within 200 ms with 1000 concurrent users” is. Requirements are numbered so that design and code can refer to them, and each records how it was validated: user requirements by acceptance tests, system requirements by automated tests, non-functional ones by stress or acceptance tests.

From the slides: bad requirements, the five-step process and the SRS recipes

Bad requirements:

The process:

  1. Feasibility study: can the users’ needs be met, and cost-effectively?
  2. Requirements analysis: derive abstract requirements by observing existing systems, discussing with users and analysing tasks; this may involve system models such as a domain model.
  3. Requirements definition: turn the analysis into a structured set of requirements (functional, non-functional…) that customers can understand.
  4. Requirements specification: make them detailed and precise. The result is the basis for a contract and for checking that development complies.
  5. Requirements maintenance: retrofit choices and features that emerge during development into the document, and complete it afterwards to formalise the result.

Recipes for an SRS:

  1. Visionary: business requirements say what a successful project is, i.e. the high-level acceptance criteria.
  2. Verifiable: almost by definition, clearly stated and factual.
  3. Result-complete: every feature of the system can be traced to a requirement; otherwise it is an arbitrary, unmotivated choice.
  4. Agreement-complete: detailed enough to define a contract with the customer.
  5. Iterative: in modern approaches the specification is software too, and evolves with the code.
  6. Self-contained: the document stands on its own.
  7. Prescriptive: different teams would develop it into “equivalent” systems.

The team must also become expert in the domain. The domain model describes its terminology, structure and behaviour completely, usually with UML diagrams and prose, and need not match the design.

From the slides: the domain model in practice

Developers must become experts in the domain at hand (covid infection, chess rules, agriculture, ships and aliens) and reach a shared understanding of it. Use class diagrams with good names and few methods, object, sequence and activity diagrams, whatever is needed, each with a prose description explaining its concepts precisely. Development itself is the realm of the coding techniques covered throughout the course; deployment and maintenance are framed today as continuous integration and delivery.

7. How do you design, and how do you document a design?

Design turns the specification into a schema developers can implement: a graph of entities (types, components) and relations (uses, inherits, calls), refined iteratively from architecture down to interfaces, data structures and algorithms. It is creative work guided by patterns and principles. There is no design without a description: organisation that is not documented looks as if it “just happened”.

Architectural and detailed design

Architectural design takes the strategic decisions: frameworks, paradigms, the main subsystems with their boundaries, contracts and roles, possibly using architectural patterns (layers, MVC, entity–control–boundary, space-based, client–server, peer-to-peer, 2/3-tier, publish–subscribe). It is technology-deferring. Detailed design takes the tactical decisions of how code is organised, using design patterns (lesson 1) and idioms; it is technology-dependent and complete: a choice not written down is not a choice.

From the slides: architecture vs architectural pattern, and the design recipes

An architecture divides the system into named components with roles and interactions; an architectural pattern is a template to instantiate in (parts of) it. The same holds for a design and a design pattern. Layers: horizontal layers each using the one below; MVC: model, view and controller separate data, presentation and input; ECB: entity (domain objects), control (use-case logic), boundary (interfaces to actors and systems).

RecipeArchitectural designDetailed design
Technologydeferring: described independently of technologiesdependent: technology constrains the developer, so it is decided here
Completenessabstract but complete: abstract boundaries, but roles and interactions clearly statedcomplete: a choice that is not written here is not a choice, it “happened”, and its implications are probably not understood
Purposerequirement-enabling: any choice needed to guarantee the requirements is taken hereformal but still abstract: captured in UML diagrams, but not just a picture of the implementation
Evolutioniterative: it is software and evolves with the code, though usually not muchiterative: it evolves with the code, usually often
Scopeself-contained: requirements + architecture stand on their ownself-contained: requirements + architecture + detailed design stand on their own

Formalisms and UML

Eventually a design becomes formal. UML diagrams are design tools, not bureaucracy: structural (class, component, object, package) and behavioural (state machine, activity, sequence, use case). Concurrency and distribution also use nets (automata, Petri nets, workflows) and process algebras. Testing and continuous integration/delivery complete the stages (lesson 1).

From the slides: what each UML diagram shows
DiagramShows
Classentities, their properties and relations, in OO terms that also apply to code
Objecta snapshot of part of the heap, to clarify an example collaboration
Componentparts of the code providing a functionality: what they provide and require, and how they connect
Packagehow the code is structured in (sub)packages, and what each package does
Sequencehow objects call each other’s methods: low-level dynamic collaboration
Activitya workflow of activities, with choice points and parallel activities
Statepart of the system state as a finite-state automaton
Use casescenarios in which external actors use the system

8. What does this mean for the exam project?

Documentation is software: apply DRY and KISS to it, grow it alongside the code, and use it to make explicit the choices the code does not show. For the exam it ends up in the project report, which must help the teacher evaluate the project, already answer questions about it, and discuss and motivate the key decisions.

The course proposes a Scrum-inspired process for a team project:

The repository then tells the story: backlogs, sprint reports and commit history show the process, the tests show the Definition of Done at work, and the report explains the requirements and design choices.

Check your understanding

Why is the waterfall called predictive, and which three problems follow from that?

Each stage is completed before the next starts, so everything must be foreseen at the beginning. Changing requirements force all stages to be redone, many design choices only emerge while coding and testing, and testing at the end means building on top of buggy abstractions.

Compare predictive, iterative, incremental and agile processes.

Predictive delivers all features with full accuracy at once. Iterative delivers all features with partial accuracy and then improves it. Incremental delivers some features with full accuracy and then adds more. Agile delivers some features with partial accuracy, then adds features and accuracy, for the sake of early feedback.

Why is working software the primary measure of progress?

Only running software can be tried by stakeholders and produce real feedback. Documents and designs can look complete while being wrong about the future, which is the waterfall’s weakness.

Who decides what goes into a Sprint?

The PO orders the Product Backlog and explains goals in part 1 of Sprint Planning. The team decides how much it can do, forecasting from the top of the backlog using its velocity, and commits to that forecast.

Why should the Scrum Master not be the Product Owner?

The SM is a coach who helps everyone apply Scrum. A PO who also coached the team would turn into a micro-manager, undermining the team’s self-organisation and its right to decide the forecast.

What is the Definition of Done, and what happens to an item that is not done at the end of the Sprint?

The criteria, agreed at the start, for an item to count as finished: e.g. thorough passing tests, nothing broken, documentation, quality criteria, acceptance tests. An unfinished item goes back to the Product Backlog for a later Sprint; the Sprint is not extended.

How do the Sprint Review and the Sprint Retrospective differ?

The review inspects the product increment, with the PO and possibly stakeholders, using live software. The retrospective inspects the process and the environment: what works, what doesn’t, what to try next.

State the key rule for a requirements specification, and fix “the system should be fast”.

Two independent teams starting from the same specification should build equivalent systems. “Fast” is not verifiable; a requirement must state a measurable threshold under stated conditions, and say how it will be validated (for instance by a stress test).

Is choosing MVC an architectural or a detailed design decision? And using Observer inside the model?

Choosing MVC is architectural: it fixes the main subsystems and their roles, independently of technology. Using Observer inside the model is detailed design: a class-level choice made with a design pattern.

Where this lesson comes from

Decks: 08-Agility (processes, waterfall and variants, the Agile Manifesto, Lean/XP/Scrum, Scrum roles, artifacts and events, the proposed project process) · 08b-Methodology (software engineering and its ingredients, artifacts and documentation, requirements specification, design, UML, recipes, documentation for the exam) · 01-quality, section “Software methodologies and the agile manifesto” (critique of the waterfall, the principles that most affect coding, agility as the course philosophy). The software-engineering principles are in lesson 1. The burndown numbers in section 4 are an illustration, not from the slides.