Paradigmi di Programmazione e Sviluppo — Prof. Viroli

Agile Development and Software Methodology

Agile Development and Software Methodologya.a. 2025/2026

In this lesson

1. Software Processes and the Waterfall Model

Every software project follows some kind of process, whether explicit or implicit. A software process describes how teams are organised to develop a system, which tasks are appointed to people, and the workflow of development activities. The classical reference is the Waterfall model, which structures development into sequential macro-stages:

  1. Requirements Engineering — elicitation, analysis, specification of what the system must do.
  2. Architectural Design — defining the software macro-structure, key components and their interactions.
  3. Detailed Design — refining the architecture into class-level decisions, interfaces, and algorithms.
  4. Implementation — actual coding: choosing technologies and writing working software.
  5. Testing & Maintenance — verification, validation, bug fixing, and evolution. This is the most resource-demanding phase.
  6. Deployment — releasing the running system into production.
Key insight

The Waterfall is a predictive method: it requires foreseeing the future. Requirements instability is its primary weakness — if requirements change, the whole sequence must restart from the beginning.

Waterfall Variants

Real projects rarely follow a pure waterfall. Three common adaptations address its rigidity:

VariantIdeaKey characteristic
Waterfall with feedbackEach phase can revise the previous oneGoing back is treated as the norm, not an exception
Overlapping phasesPhases have smooth transitionsDifferent teams keep interacting throughout
Incremental waterfallIsolated increments delivered at different stagesPartial releases provide some features early

Process Model Types Compared

ModelFeatures deliveredAccuracy
Predictive (Waterfall)All at onceFull accuracy from the start
IterativeAll featuresPartial accuracy initially, improved in later versions
IncrementalSome features earlyFull accuracy for delivered features
AgileSome features earlyPartial accuracy initially, improved iteratively
Editor's note

Agile combines iterative and incremental approaches: it delivers working software frequently, each iteration adding features and improving accuracy based on feedback.

2. Agile Software Development

The Agile Manifesto (2001, agilemanifesto.org) was signed by many practitioners of the Agile Alliance. It started from criticising the waterfall model and its inability to handle change. The key idea: do not refuse change, rather embrace it.

The 12 Principles of Agile Software

These principles deeply influenced modern software development:

  1. Highest priority: satisfy the customer through early and continuous delivery of valuable software.
  2. Welcome changing requirements, even late in development.
  3. Deliver working software frequently (weeks to months, preferring shorter timescales).
  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.
  6. The most efficient and effective method of conveying information is face-to-face conversation.
  7. Working software is the primary measure of progress.
  8. Agile processes promote sustainable development: constant pace indefinitely.
  9. Continuous attention to technical excellence and good design enhances agility.
  10. Simplicity — the art of maximising the amount of work not done — is essential.
  11. The best architectures, requirements, and designs emerge from self-organising teams.
  12. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts.
The examiner will ask

You should be able to explain the Agile principles and contrast them with the Waterfall approach. The examiner may ask: "Why is 'working software' the primary measure of progress, rather than documentation or design completeness?"

Example Agile Methodologies

MethodologyFocusKey practices
LeanHighest efficiencyEliminate waste, amplify learning, decide as late as possible, deliver fast, empower the team, build quality in, see the whole
XP (Extreme Programming)Core engineering practicesRelease planning, iteration planning, acceptance tests, stand-up meetings, pair programming, TDD, code quality
ScrumProject management wrapperRoles (PO, SM, Team), artifacts (backlogs), time-boxed sprints, ceremonies
Industry reality

Most industries claim they use "agile methods", but many just inherit some principles without fully embracing them all. Scrum is widely adopted, but needs trust, experience, and tailoring.

3. Scrum: Roles and Artifacts

Scrum is an iterative and incremental agile framework for managing product development. It enables teams to self-organise by encouraging close collaboration. The name comes from the rugby term "scrum" (Italian: mischia), coined by Jeff Sutherland and Ken Schwaber in 1993, inspired by a 1986 paper by Takeuchi and Nonaka.

Scrum Roles

RoleGoalKey responsibilities
Product Owner (PO)Maximising return on investmentInteracts with customers, identifies features, creates and maintains the priority list (Product Backlog). The PO understands product development and continuously interacts with the team, reviewing sprint results.
Development TeamBuild the product the PO indicatesCross-functional, self-organising, 5–9 people, 100% dedicated. They estimate time, decide which items to implement, and provide ideas to the PO.
Scrum Master (SM)Help the group learn and apply ScrumA coach, not a manager or leader. Helps smooth coordination between PO and Team. Not the PO (which would create micro-management). Can be an external counsellor.

Scrum Artifacts

ArtifactDescription
Product BacklogA prioritised list of customer-centric features. Exists and evolves over the project lifetime. Each item has: priority position, description, estimation size (relative points). Items include new features, major improvements, research work, bug fixes, and bootstrap activities.
Sprint BacklogA refinement of the Product Backlog portion for the current Sprint. Each item is broken into Sprint tasks with estimates and person-task assignments. Often rendered as a physical or digital board with columns: To-Do, WIP, Done.
IncrementThe sum of all completed Product Backlog items at the end of a Sprint. Must meet the Definition of Done.
Definition of Done

An item is "done" when it meets agreed criteria: thorough and non-failing tests, no breakage of existing code, proper documentation, acceptance testing, and quality criteria. This impacts the notion of "potentially shippable increment".

4. Scrum: Ceremonies and Sprint Lifecycle

A Sprint is a time-boxed iteration (1–4 weeks; shorter means more agile). The entire development happens within sprints, each producing a potentially shippable increment.

Part 1 (WHAT): Review high-priority items, discuss goals and context with the PO. Result: Sprint Goal — a summary statement of the Sprint objective.

Part 2 (HOW): Forecast the amount of items completable, considering team velocity. The team commits to a forecast, not the PO. Duration: ~1 hour per part per week of Sprint.

15 minutes daily at the appointed time (team standing). Each member reports: (i) what was done, (ii) what will be done, (iii) what obstacles exist. No in-depth technical discussion — that happens in follow-up meetings. The team updates the Sprint Backlog daily and plots the Sprint burndown chart to track progress.

Inspection and adaptation of the product increment. Whole team + stakeholders. Key for the PO to understand product evolution. Involves live demo of working software, not slides. Duration: ~1 hour per week of Sprint.

Inspection and adaptation of the process, not the product. Discuss what is working and what is not, and what changes to try. Focus on both positive and negative aspects. Next Sprint Planning comes immediately after. Duration: ~45 minutes per week of Sprint.

Product Backlog Refinement

Ongoing activity (max 10% of Sprint time) where the team splits big items, analyses, re-estimates, and re-prioritises for future Sprints. Doing this properly makes Sprint Planning quick and effective.

The examiner will ask

Be prepared to explain: What is the Sprint Goal? Who decides what goes into a Sprint? What happens if work cannot be completed within the Sprint? How does the burndown chart help track progress?

5. Software Engineering Principles

These principles form the foundation of good software engineering practice. You should be able to explain each one and give examples of its application.

AcronymPrincipleMeaningExamples
RFRigour and FormalityDescribe behaviour as precisely as mathematics wouldFinite state machines, DSL-like APIs, rule-like specifications in tests
SOCSeparation of ConcernsMaster complexity by grouping issues, consider each in isolationSplit teams, divide tests (unit/integration/acceptance), separate functional from non-functional requirements
MODModularityDivide software in modules with high cohesion and low couplingPackage structure, nested classes, deployment artifacts (JARs, DLLs)
ABSAbstractionIdentify key aspects and ignore unnecessary detailsInterfaces, API layers, DSLs, choosing the right paradigm
AOCAnticipation of ChangeCreate the ground for flexible reactivity to likely changesAbstract classes, constants instead of magic numbers, encapsulate implementation choices
GENGeneralitySolve a more general problem than the one at handParameterise implementation choices, support more input cases than currently needed
INCIncrementalityReason in terms of smaller and smaller incrementsVersion numbering, Scrum sprints, TDD red-green-refactor cycles
Key idea

These principles are well-known and universally agreed upon — yet developers often believe they have "no time" to follow them. The real skill is knowing when to apply each one judiciously.

6. Requirement Specification

Requirement specification is the phase that grounds all subsequent design and implementation. The goal is to turn abstract stakeholder needs into well-engineered, precise descriptions of what the system will do.

Types of Requirements

TypeQuestion answeredExamples
Business RequirementsWhy is this software strategic?Project goals, ROI expectations, success criteria
Functional RequirementsWhat functionalities does the system provide?User requirements (how users interact) and System requirements (internal behaviour, rules, constraints)
Non-functional RequirementsWhat qualities must the system have?Performance, scalability, reliability, security, usability
Implementation RequirementsWhat constraints exist on production?Technologies, training, internal quality standards
Common pitfalls

A requirement must be verifiable. Bad examples: "the user can insert a product" (what data?), "the system should be fast" (how fast?), "the code should be modular" (that is a principle, not a requirement).

Requirements Engineering Process

  1. Feasibility study — estimate whether user needs can be satisfied cost-effectively.
  2. Requirements analysis — derive abstract requirements from existing systems, user discussion, task analysis.
  3. Requirements definition — translate analysis into a structured set of requirements (functional, non-functional, etc.).
  4. Requirements specification — make requirements detailed and precise, suitable for a contract.
  5. Requirements maintenance — retrofitting new choices/features as they emerge during development.

The Domain Model

Software developers must become experts in the domain at hand. A domain model is a formal description of key aspects of the domain that the software is about. It should be complete and cover all useful information about terminology, structure, and behaviour. UML diagrams (class, object, sequence, activity) with prose descriptions are the typical formalism.

The examiner will ask

You should understand the Pacman example: the requirement "there are 4 types of enemies" must be specified precisely — Blinky targets the player's current location, Pinky targets four spaces ahead, Inky uses Blinky's position as reference, and Clyde flees when too close. The specification makes the system objectively verifiable.

7. Design: Architectural and Detailed

Design turns the requirement specification into a detailed implementation schema. It is an iterative, creative process based on experience, patterns, and principles.

Architectural Design

Defines the strategic aspects: frameworks, tools, paradigms, high-level principles, main sub-systems and their boundaries, contracts, and roles.

Detailed Design

Defines the tactical aspects: class-level decisions, interfaces, data structures, algorithms. Can rely on design patterns (GoF) and programming idioms.

Architectural Patterns

PatternDescriptionWhen to use
LayersOrganise code into horizontal layers (presentation, business logic, data access)Standard enterprise applications
MVCModel-View-Controller: separate data, presentation, and user input handlingGUI applications, web frameworks
ECBEntity-Control-Boundary: domain entities, use case controllers, and interface boundariesUse-case driven design
Space-basedShared tuple spaces for distributed coordinationDistributed/concurrent systems
Publish-subscribeEvent-driven communication between componentsEvent-driven architectures, decoupled systems
Editor's note

Architecture and architectural patterns are distinct: an architecture is a division into named components with defined roles and interactions; an architectural pattern is a reusable template. The same relationship holds between "design" and "design patterns".

Design Recipes

StageKey recipes
Architectural design Technology-deferring, abstract but complete, requirement-enabling, iterative, self-contained
Detailed design Technology-dependent, complete, formal (UML), still abstract, iterative, self-contained
Requirement specification Visionary, verifiable, result-complete, agreement-complete, iterative, self-contained, prescriptive

8. UML Diagrams

Unified Modelling Language (UML) diagrams are the standard visual formalism for documenting software design. They serve as powerful design tools, not just bureaucratic documentation.

DiagramFocusUsed for
Class diagramEntities, properties, and relations (OO terminology)Static structure, types and their relationships
Object diagramSnapshot of a portion of the heapClarifying example collaborations between objects
Component diagramCode portions providing functionalityWhat components provide/require, how they connect
Package diagramOverall code structure in (sub-)packagesHigh-level organisation, package features
Sequence diagramObject method calls over timeLow-level dynamic collaboration
Activity diagramWorkflow of activitiesChoice points, multiple activities, process flow
State diagramSystem state as finite automatonState-dependent behaviour, lifecycles
Use case diagramScenarios for external actorsSystem boundary, actor interactions

9. Documentation and the Exam Project

Documentation is an essential part of quality software. Key facts to remember:

Exam project process

The suggested process for the course project adapts Scrum: one student acts as client/domain expert, another as Product Owner. Sprints should be short (~1 week, ~15 hours of work). The team maintains a Sprint Backlog, holds frequent meetings, and produces brief reports at each Sprint's end, kept under version control.

Check Your Understanding

Explain the difference between predictive, iterative, incremental, and agile process models. Which one does Scrum belong to?

Predictive (Waterfall) delivers all features at once with full accuracy planned upfront. Iterative delivers all features but with partial accuracy, improving over time. Incremental delivers some features early with full accuracy. Agile combines iterative and incremental: delivers some features early with partial accuracy, then adds features and improves accuracy. Scrum is an agile framework.

What are the three Scrum roles, and what is the primary responsibility of each?

Product Owner: maximises ROI, maintains the Product Backlog, interacts with customers. Development Team (5-9 people): self-organising, cross-functional, builds the product, estimates and decides Sprint items. Scrum Master: coach who helps the group learn and apply Scrum, smooths coordination, not a manager or leader.

What is the Definition of Done, and why is it important?

It is an agreed-upon set of criteria that must be met for an item to be considered "done". Facets include: thorough and passing tests, no breakage of existing code, documentation, quality criteria, acceptance testing. It impacts the notion of "potentially shippable increment" and ensures consistent quality across the team.

What does "Rigour and Formality" mean in software engineering? Give an example.

It means describing or enacting behaviour as precisely as mathematics would. It is key where errors would incur high technical debt. Examples: using finite state machines, Petri nets, DSL-like APIs for configuration, rule-like specifications in tests.

Why must a requirement be verifiable? Give an example of a bad (non-verifiable) requirement and how to fix it.

A requirement that cannot be objectively validated is not a true requirement — it is just a principle. Bad: "the system should be fast". Fixed: "the system should respond to user queries within 200ms under a load of 1000 concurrent users".

Explain the difference between architectural and detailed design. Give an example of each.

Architectural design defines strategic aspects: which architectural pattern (MVC, Layers), which technologies, high-level module boundaries. Detailed design defines tactical aspects: which classes, interfaces, and design patterns (GoF). Example: choosing MVC is architectural; deciding to use the Observer pattern within the Model is detailed design.