EE Eugenio Estrada
Back to blog

The Importance of Context in the Age of AI

Artificial Intelligence Software Engineering Testing Architecture
Listen to article
💡

TL;DR: Context remains king

  • The AI bottleneck: Writing code is easy; the real challenge today is context. Without functional (business) and technical (architecture) guardrails, AI generates generic, insecure, or redundant code.
  • Software physics don't change: Performance (N+1 queries), security (OWASP Top 10), and resilience still demand human architectural choices.
  • Acceptance testing as a shield: Defining BDD/Gherkin tests beforehand gives the AI a living spec and shields the codebase against silent regressions.
  • A new engineering role: The developer evolves from writing syntax to being a context engineer who models, designs, and validates.

The rush to adopt Large Language Model (LLM) coding assistants has radically accelerated the speed at which we write software. Tools like GitHub Copilot, ChatGPT, and autonomous coding agents allow us to generate dozens of lines of code in seconds. However, this speed has brought about a “productivity illusion”: writing code faster does not necessarily translate into solving problems better.

As we delegate more mechanical tasks to Artificial Intelligence, one factor emerges as the true bottleneck of modern software engineering: context. Without full context, both at a functional and technical level, AI is blind.


1. The Two Sides of Context: Functional and Technical

Language models do not possess a mental model of your application, nor do they understand your business goals; they simply predict the next most probable token based on their training. Therefore, the developer must act as the keeper of context on two essential fronts:

Functional Context (The Business Domain)

This represents the why and for whom of the software. It includes business rules, user expectations, and product strategic goals.

  • The risk: Without functional boundaries, AI will generate generic code structures that often contradict real-world domain logic. For instance, when designing a checkout system, the AI might write technically flawless code that completely ignores local tax regulations or the company’s internal refund policies.

Technical Context (The Architecture and Environment)

This represents the where and how of the software. It encompasses infrastructure constraints, specific technical debt, legacy integrations, and the security policies of the stack.

  • The risk: Without this context, AI tends to import redundant libraries or propose solutions incompatible with the current environment (e.g., suggesting memory-intensive architectures for serverless environments with strict cold start limitations). As highlighted by the revealing GitClear (2024) Report, AI-assisted development is causing a worrying rate of code duplication and churn, precisely due to the lack of a holistic understanding of the existing codebase.

2. The Physics of Software Does Not Change in the Age of AI

It is easy to get carried away by how easily an AI generates a script, but the fundamental problems of software engineering remain exactly the same. The physics of software systems has not been rewritten:

  • Scalability and Performance: AI excels at writing code that “works” at a unit level, but often ignores algorithmic complexity. It is common to see it generate inefficient nested loops or the classic N+1 query problem in relational databases, issues thoroughly analyzed in classic literature like Martin Kleppmann’s Designing Data-Intensive Applications.
  • Security: AI models have been trained on millions of public repositories, many of which contain historical vulnerabilities. A rigorous NYU study (2021) showed that nearly 40% of the code generated by AI-based assistants contained common security flaws from the OWASP Top 10 list, such as dependency injections or lack of input sanitization.
  • Concurrency and Integrity: AI tends to ignore race conditions and rarely structures robust ACID transactions on its own, unless the developer explicitly instructs it on how to handle database isolation levels and locks.
  • Single Point of Failure (SPOF): AI usually codes for the happy path. Designing fault tolerance through circuit breakers, retry limits with exponential backoff, and fallbacks remains an indispensable human architectural decision.

3. Acceptance Testing: The Ultimate Safety Net

In this new paradigm, how do we validate that AI-generated code is correct and does not introduce unwanted side effects? The traditional answer remains the strongest: acceptance testing.

Acceptance tests (often written in structured languages like Gherkin under Behavior-Driven Development / BDD methodologies) formalize functional context into an executable test suite.

  1. Living Specification: An acceptance test defines the expected behavior of the system with mathematical precision before the production code is even written. We can feed this test to the AI so it knows exactly what code to generate to pass it.
  2. Regression Prevention: Since LLMs refactor code incrementally, fixing a bug in one endpoint can easily break a business rule in another module of the system. As Martin Fowler points out in his classic Refactoring, a robust test suite is the only real enabler for continuous changes. Acceptance tests act as an unyielding barrier against regressions caused by the speed of AI.

4. Technical Responsibility: Defining the “How”

Delegating code does not mean delegating architecture. Deciding whether your system should use Hexagonal Architecture, follow Domain-Driven Design (DDD) principles, or structure itself under a classic MVC pattern is a decision that the human engineer must make.

When you decide on the architecture and document it through clear guidelines in your workspace (for instance, via project-specific code rules and agent configuration files), you ensure the AI adheres to your design principles (Clean Architecture by Robert C. Martin). You stop receiving messy code and start receiving components that fit like Lego blocks into your system.


Conclusion: From Programmer to “Context Engineer”

The syntax of programming languages has become a commodity. The distinguishing value of a software engineer today does not lie in memorizing APIs or writing code quickly, but in the ability to orchestrate context:

  1. Model the business problem with precision (functional context).
  2. Design the architecture and constraints that mitigate scalability, concurrency, and security issues (technical context).
  3. Validate with acceptance tests to shield the software against regressions.

AI is a spectacular copilot, but the pilot is still the one who decides the route, anticipates the storm, and ensures the plane lands safely at the correct destination.

Share this post