PadhaikoAll subjects

Recent Trends

Software Engineering (ENCT 352)

Open in the Padhaiko app

9.1 DevOps and continuous deployment pipelines

Definition

DevOps

DevOps is a set of cultural philosophies, engineering practices, and automated tools that unify Software Development (Dev) and IT Operations (Ops) to shorten the systems development lifecycle while delivering features, fixes, and updates reliably and continuously.

The CALMS Framework & DevOps Infinity Loop

DevOps adoption rests on five pillars (CALMS): Culture (shared ownership, blameless postmortems), Automation (build, test, deploy), Lean (small batch sizes), Measurement (telemetry, DORA metrics), and Sharing (transparent docs and runbooks).

The DevOps Continuous LifecycleText
   +--> [ Plan ] --> [ Code ] --> [ Build ] --> [ Test ] --+
   |                                                       |
   +-- [ Monitor ] <-- [ Operate ] <-- [ Deploy ] <-- [ Release ]

Continuous Delivery vs. Continuous Deployment

AspectContinuous DeliveryContinuous Deployment
Automation ScopeAutomates build, tests, and staging verification so code is always deployableAutomates every step all the way into live production
Production GateRequires an explicit manual human approval button/click to releaseZero manual gate—any commit passing the automated pipeline ships to users
Risk Profile & FitPreferred for regulated finance, healthcare, or business-coordinated launchesIdeal for mature SaaS platforms with comprehensive automated tests and telemetry

Four DORA Metrics of DevOps Performance

  1. Deployment Frequency: How often an organization successfully releases to production.
  2. Lead Time for Changes: Time elapsed from a code commit to running successfully in production.
  3. Change Failure Rate (CFR): Percentage of deployments causing a production degradation or rollback.
  4. Mean Time to Recovery (MTTR): How long it takes to restore service after a production failure.

9.2 Continuous integration/continuous delivery (CI/CD) in modern projects

A modern CI/CD pipeline converts every code push into a repeatable, auditable sequence of automated quality gates before software reaches users.

Typical Multi-Stage Modern CI/CD PipelineText
[ Git Push / PR ]
       |
       v
[ 1. Build & Lint ] ----> [ 2. Unit & Static Security Scan (SAST) ]
                                       |
                                       v
[ 4. Staging Deploy & Integration/E2E Tests ] <--- [ 3. Package Container Image ]
       |
       v
[ 5. Production Release Strategy: Rolling / Blue-Green / Canary ]

Zero-Downtime Production Deployment Strategies

Modern Deployment Strategies in CI/CD
StrategyMechanismKey Advantage
Rolling DeploymentGradually replaces old application instances with new ones in small batchesZero extra standby cluster cost; simple recovery
Blue–Green DeploymentMaintains two identical environments (Blue = live, Green = new version); router switches traffic atomicallyInstant rollback by flipping traffic router back to Blue
Canary ReleaseRoutes a tiny fraction of live traffic (e.g., ) to the new version while monitoring error rates/latency before full rolloutLimits blast radius if an unforeseen production defect occurs

9.3 Cloud-native, microservices architectures and infrastructure as code (IaC)

Cloud-Native and Containerization

Cloud-native applications are designed specifically to exploit cloud elasticity, resilience, and managed services—commonly packaging services into lightweight, portable containers (e.g., Docker) orchestrated across clusters (e.g., Kubernetes) with automated health checks, horizontal auto-scaling, and centralized observability (logs, metrics, distributed traces).

Monolithic vs. Microservices Architecture

AspectMonolithic ArchitectureMicroservices Architecture
StructureSingle unified deployable unit containing UI, business logic, and data accessSuite of small, independently deployable services organized around business capabilities
ScalingMust scale the entire application together even if one module is busyScales hot services (e.g., search or billing) independently
Fault IsolationA memory leak or unhandled crash in one module can bring down the whole processFaults remain isolated to one service if timeouts and circuit breakers are used
Operational ComplexitySimple local debugging, testing, and single-artifact deploymentRequires distributed tracing, service discovery, API gateways, and eventual consistency

Infrastructure as Code (IaC)

Definition

Infrastructure as Code (IaC)

Infrastructure as Code (IaC) is the practice of provisioning, configuring, and managing servers, networks, databases, and cloud permissions using version-controlled machine-readable definition files rather than manual click-through console setup.

Declarative IaC Concept (Pseudo-Configuration)Text
resource "cloud_container_service" "api" {
  name          = "enct352-grades-api"
  replicas      = 3
  cpu_limit     = "500m"
  memory_limit  = "512Mi"
  environment   = "production"
}

9.4 AI-assisted software development

Modern software teams integrate Large Language Models (LLMs) and specialized AI developer tools across the SDLC:

Applications and Risks of AI-Assisted Software Development
SDLC ActivityAI CapabilitiesEngineering Risks & Safeguards
Requirements & DesignSummarizing interview transcripts, drafting initial user stories, suggesting edge casesRisk of generic or domain-wrong assumptions; requires stakeholder validation
Coding & RefactoringIn-IDE autocomplete, boilerplate synthesis, legacy language translation, docstringsHallucinated APIs, subtle security vulnerabilities, license compliance; requires strict code review
Testing & QAGenerating unit tests, boundary inputs, and mock fixtures from function specsTests may mirror buggy code if generated from implementation instead of specs; verify with coverage & mutation checks
Debugging & OpsExplaining stack traces, correlating log anomalies, drafting remediation runbooksNever blindly execute AI-suggested production commands or paste secrets/PII into external tools

9.5 Low-code/no-code, green software engineering

Low-Code / No-Code (LCNC) Platforms

Green Software Engineering

Definition

Green Software Engineering

Green Software Engineering is the discipline of designing, building, and operating software systems to minimize greenhouse gas (carbon) emissions and energy consumption across hardware and cloud infrastructure.

Three core principles of Green Software Engineering (Green Software Foundation):

  1. Energy Efficiency: Write algorithms, database queries, and binaries that accomplish work using minimal CPU cycles, memory, and network transfers (right-sizing VMs, avoiding polling loops, caching).
  2. Hardware Efficiency (Embodied Carbon): Extend hardware lifespan and maximize server utilization rather than running idle, over-provisioned machines.
  3. Carbon Awareness: Shift flexible batch jobs (e.g., ML training, nightly analytics) to times or cloud regions powered by cleaner renewable electricity (lower grid carbon intensity).

Software Carbon Intensity (SCI) Formula

The Green Software Foundation quantifies a software system's emissions rate using Software Carbon Intensity ():

where:


Worked Examples

Example 9.1

9.1

An e-commerce platform handles live requests per second and runs a Canary Release for a new checkout service:

  1. During Phase 1, the load balancer routes of traffic to the canary cluster and keeps on the stable cluster. Compute the requests per second handled by each cluster.
  2. Suppose the new version introduces a memory bug spotted after of monitoring, and an automated rollback restores full stability in . Express the Mean Time to Recovery () in hours, and explain how Canary deployment reduced user impact compared to an all-at-once deployment.

Part 1 — Traffic Split Across Canary and Stable Clusters:

  • Canary traffic ():
  • Stable traffic ():

Part 2 — and Blast-Radius Reduction:

Instead of exposing of shoppers () to the buggy checkout, only () were affected before telemetry triggered an automated rollback.

Answer:
  1. Canary cluster handles while the stable cluster handles .
  2. (), and the Canary release capped the failure blast radius to only of live traffic.
Example 9.2

9.2

A nightly data-analytics batch job processes million records per run. Originally it runs on a legacy unoptimized script in a coal-heavy region:

After refactoring inefficient SQL queries (energy efficiency) and scheduling the job in a hydro-powered region (carbon awareness), energy drops to and grid intensity drops to (with unchanged). Compute the Software Carbon Intensity () in per million records before and after optimization, and find the percentage reduction.

Compute Initial : Using :

Compute Optimized :

Compute Percentage Carbon Reduction:

Answer:

dropped from to per million records—a carbon intensity reduction.

Example 9.3

9.3

How to Answer a Past Exam Question: "Compare Monolithic and Microservices architectures, and explain how Infrastructure as Code (IaC) supports modern CI/CD pipelines."

1. Contrast Monolith vs. Microservices Across Four Axes: Compare Deployment unit (single vs. multiple independent services), Scaling (whole app vs. per-service), Fault isolation (shared process vs. isolated boundaries), and Operational complexity (simple local runs vs. distributed networking, tracing, and data consistency).

2. Link IaC to CI/CD Pipelines: Explain that IaC defines servers, containers, networks, and permissions declaratively in Git alongside application code—enabling CI/CD pipelines to spin up identical, reproducible staging and production environments automatically without manual configuration drift.

Answer:

An ideal exam answer contrasts Monolith vs. Microservices across deployment, scaling, fault isolation, and operational overhead, and explains how version-controlled, idempotent IaC lets CI/CD pipelines provision consistent, drift-free cloud environments automatically.


Exercises

Practice Exercises — Recent Trends in Software Engineering

Question 1

Define DevOps and the CALMS pillars. Distinguish clearly between Continuous Integration (CI), Continuous Delivery, and Continuous Deployment, and list the four DORA metrics.

DevOps & CALMS: DevOps integrates development and operations through Culture, Automation, Lean flow, Measurement, and Sharing across the continuous Plan–Code–Build–Test–Release–Deploy–Operate–Monitor cycle.

CI vs. Continuous Delivery vs. Continuous Deployment & DORA Metrics:

  • CI: Frequent merges verified automatically by build and test suites.
  • Continuous Delivery: Code is always production-ready after automated checks, awaiting a manual release approval.
  • Continuous Deployment: Every commit passing automated checks deploys automatically to production with zero manual gate.
  • Four DORA Metrics: Deployment Frequency, Lead Time for Changes, Change Failure Rate (CFR), and Mean Time to Recovery (MTTR).
Answer:

DevOps unifies Dev and Ops via CALMS. CI automates build/test per commit, Continuous Delivery keeps code releasable pending manual approval, and Continuous Deployment releases to production fully automatically—all measured by Deployment Frequency, Lead Time, CFR, and MTTR.

Question 2

Compare Rolling, Blue–Green, and Canary deployment strategies in modern CI/CD pipelines, stating one key benefit and one scenario suited to each.

Three Deployment Strategies:

  1. Rolling: Replaces instances incrementally in batches; requires no duplicate idle cluster and fits standard stateless updates.
  2. Blue–Green: Keeps an identical standby environment (Green) alongside live (Blue) and flips router traffic atomically; enables instant zero-downtime rollback for high-stakes releases.
  3. Canary: Routes a small percentage of real traffic to the new release first to observe real telemetry; ideal for catching subtle production issues with minimal blast radius.
Answer:

Rolling updates instances in batches (low resource overhead); Blue–Green switches traffic between two full environments (instant rollback); Canary exposes a small traffic slice first (minimal blast radius under real load).

Question 3

Explain Cloud-Native Microservices and Infrastructure as Code (IaC). Contrast Monolithic and Microservices architectures and explain why idempotency matters in IaC.

Cloud-Native Microservices & Monolith Comparison: Cloud-native microservices decompose an application into small, containerized, independently deployable and scalable services—trading the operational simplicity of a monolith for independent scaling, polyglot flexibility, and fault isolation.

IaC and Idempotency: IaC manages cloud resources via versioned declarative definitions. Idempotency guarantees that running an IaC script once or ten times yields the exact same desired infrastructure state without duplicating servers or causing configuration drift.

Answer:

Microservices trade a monolith's deployment simplicity for independent scaling and fault isolation. IaC defines infrastructure as versioned code, where idempotency ensures repeated deployments converge to the same consistent state without configuration drift.

Question 4

Discuss AI-assisted software development across coding, testing, and debugging, along with three key risks engineers must guard against. Also compare Low-Code/No-Code (LCNC) platforms against traditional custom coding.

AI-Assisted Development & Three Risks: AI tools accelerate boilerplate coding, unit test drafting, refactoring, and log/stack-trace analysis. Three major risks: (1) Hallucinated APIs or subtle logic bugs, (2) Insecure code or leaking proprietary secrets/PII to external models, and (3) Automation complacency skipping human code review and spec-based testing.

LCNC vs. Custom Coding: LCNC platforms enable rapid visual assembly of standard forms/workflows by citizen developers, whereas traditional coding provides complete algorithmic control, performance tuning, and freedom from platform vendor lock-in.

Answer:

AI assists coding, test generation, and debugging, provided teams guard against hallucinations, security/privacy leaks, and skipped reviews. LCNC accelerates standard internal apps visually, while custom coding remains essential for complex logic, performance, and avoiding vendor lock-in.

Question 5
  1. Define Green Software Engineering and state its three core principles (energy efficiency, hardware efficiency, carbon awareness).
  2. A cloud video-transcoding pipeline processes hours of video per batch using on a grid with carbon intensity and allocated embodied carbon . After optimizing codec threads () and shifting execution to a cleaner off-peak window (, ), compute the Software Carbon Intensity () per video hour before and after optimization and the percentage reduction.

Part 1 — Green Software Engineering Principles: Green software engineering minimizes carbon emissions through energy efficiency (doing more with fewer watt-hours), hardware efficiency (maximizing utilization and extending device life to amortize embodied carbon), and carbon awareness (running flexible workloads when/where grid electricity is cleanest).

Part 2 — Before and After Optimization:

Answer:
  1. Green software engineering minimizes emissions via energy efficiency, hardware efficiency, and carbon awareness.
  2. drops from to per video hour, achieving a reduction.
← Software Configuration Management