Skip to content

50.003 - Introduction to Agentic Software Development

Learning Outcomes

By the end of this unit, you should be able to

  1. Explain what Agentic AI is.
  2. Articulate the motivation and concerns of using Agentic AI in software development.
  3. Describe the role of the V-Model in the context of human-AI collaboration.
  4. Apply the sandwich approach when working with Agentic AI tools.

Agentic AI

An Agentic AI system is built around an LLM (Large Language Model) that

  • has access to read the environment, and
  • is given limited control to modify the environment.

In the context of software development, the "environment" refers to the codebase, file system, terminals, APIs, and other tools that a software engineer would typically interact with.

Why Agentic AI in ESC?

This module introduces Agentic AI not to circumvent your thinking and learning.

  • You should practice software design and development manually when you are learning.
  • You will develop senior developer sense, experience, and good "taste" through manual practice.

The goal is to offer a "sneak preview" into what Agentic AI in software development looks like, specifically:

  • What to use
  • When to use
  • How to use

Why Agentic AI in Software Development?

There are several claimed benefits, each worth examining critically.

Hype and Vibe?

Much of the initial enthusiasm is driven by hype. It is worth being cautious about what AI tools can genuinely deliver.

Reduce (re)search time?

AI tools can help retrieve common patterns and solutions quickly. However, a software engineer might argue: if it is a common pattern, it should be turned into a library.

Reduce boilerplate code?

AI can generate repetitive scaffolding code. Again, the software engineering response is that common patterns deserve proper abstraction.

Shorten time-to-market process?

For startup applications where building quickly matters more than long-term maintainability, this argument holds more weight. See: https://www.youtube.com/watch?v=RNJCfif1dPY&t=1046s

Reduce SWE dev workload?

This is an open question. The key concern is: can the AI-generated code survive in production?

What is Software Engineering?

The following definition is from Wikipedia:

"Software engineering is a branch of both computer science and engineering focused on designing, developing, testing, and maintaining software applications. It involves applying engineering principles and computer programming expertise to develop software systems that meet user needs. The terms programmer and coder overlap software engineer, but they imply only the construction aspect of a typical software engineer workload. A software engineer applies a software development process, which involves defining, implementing, testing, managing, and maintaining software systems, as well as developing the software development process itself."

Which Parts Can't Be Done by LLM?

Examining the definition above, LLMs are not good at the higher-order engineering concerns: understanding user needs, defining requirements, making architectural decisions, and governing the overall software development process. These activities require deep contextual understanding, judgment, and accountability that LLMs do not possess.

As Leslie Lamport aptly put it:

"Coding is to programming, what typing is to writing."

The implication is that writing code is a mechanical task; the thinking that goes behind it is what constitutes software engineering.

The V-Model for SWE

The V-Model describes the software development lifecycle, mapping development activities on the left side to corresponding testing activities on the right side.

(src: https://medium.com/software-engineering-kmitl/v-model-3a71622b3d82)

How AI Agents Fit into the V-Model

The role of humans and AI agents in the V-Model has evolved over time.

The traditional way - humans perform all activities across the entire V-Model.

AI coding assitant (most common) - humans perform the high-level design and specification work. AI agents assist with the lower-level detailed design and implementation. For AI agents to be useful at the coding stage, humans must provide detailed designs: function signatures, type annotations, input and expected outputs.

Autonomous agents - agents can pick up a task, a ticket, or a pull request, and carry out coding and unit testing with minimal human prompting for each step.

Team lead model - you act as a team lead over a swarm of AI agents. You define tasks, review output, and make architectural decisions while the agents do the implementation work.

Vibe coding - you provide high-level goals and the AI does everything. This is only appropriate if you are a CEO-level stakeholder with no engineering responsibility.

Close collaboration - a human-AI collaborative model applies at every stage of the V-Model: requirements, design, coding, and testing. However, people might argue that applying AI to every single component indiscriminately likely yields no productivity gain.

Concerns

Despite the benefits, there are significant concerns when relying on Agentic AI in software development.

  • Accountability - who is responsible when AI-generated code causes a system failure? It is the human engineer for now.
  • Reliability - AI-generated code may not be correct, secure, or efficient.
  • Maintainability - code that was not reasoned through by a human is often harder to maintain.
  • Security - AI tools may introduce vulnerabilities, especially if operating with insufficient context.

A Sandwich Approach

Many practical approaches to integrating Agentic AI into software development can be generalized into the sandwich model, where human effort wraps around the AI's contribution.

  • Human First - divide the task into small pieces, give a clear specification, and develop some examples by hand.
  • AI Second - based on the specification and the examples, the AI develops the missing components.
  • Human Again - verify the developed components rigorously.

Human First (Setting the Context)

Divide a task into small pieces

  • Perform system and component level design before involving AI.

Give a clear intention and specification, as detailed as possible

  • Use case documents, user stories, sequence diagrams, ER diagrams, class diagrams, and product requirement documents (PRDs).
  • Test case documents.
  • Project directory guides, system component guides, and existing API documentation.

Develop some examples by hand

  • Implement 50%–90% of a feature manually before asking the AI to complete it. This is because the AI will search for example and reference from the related modules and similar sibling features before recalling from its pre-trained data.
  • Write 10%–20% of the unit tests by hand to establish a reference pattern. Each test case is often a standalone function with a separate set of input and expected output. The dependency and coupling are less compared to the feature code.

AI Second (Agent Workflows)

When delegating to an AI agent:

  • Set clear and general rules, best practices, and DOs and DON'Ts in an AGENTS.md file.
  • For example: always adhere to the type signature, don't delete existing code, compile and test before moving on to the next step.
  • Context prompts should consist of the design documents, PRD, existing code, and function signatures.
  • For example: state what to build and what counts as task completion.
  • Keep instructional prompts simple and short.
  • Create a sandbox environment:
  • Use a separate git branch.
  • Use a separate container.
  • Use a separate database or API access, for instance via MCP.

Human Again

When reviewing AI-generated output, apply the following rules.

Rule 1: AI is not thinking; it is always guessing. Every model hallucinates. Always be skeptical.

Rule 2: You must always review and test the AI output, every single line, every single file.

Rule 3: If you do not understand the AI output, there are only two possibilities: * You are not knowledgeable enough to review it — stop using AI and learn first. * The AI is hallucinating — stop using AI and do it yourself.

Rule 4: The more detailed your specification, and the smaller the task, the easier the review process. Do not throw a big task at AI and expect it to complete it perfectly.

More techniques for working effectively with Agentic AI tools will be discussed in the Term 6–8 electives.

Further Readings

  1. https://sausheong.com/from-vibe-coding-to-agentic-engineering-1ca3ca72b5ac
  2. https://dev.to/ziv_kfir_aa0a372cec2e1e4b/why-the-v-model-is-the-natural-way-to-work-with-ai-coding-agents-17g6
  3. https://medium.com/software-engineering-kmitl/v-model-3a71622b3d82