AI-Assisted Engineering

LLMs in the SDLC: Requirements, Coding, Testing and Documentation

Most discussion of AI in software development focuses on writing code, which is only one part of the software development lifecycle. We walk through each stage, from requirements and design to testing, review, documentation and operations, and show where LLMs genuinely help, with examples and guardrails for each.

By EthicalHat Research · · 3 min read
Infographic: Where LLMs help across the SDLC

AI coding assistants get most of the attention, but writing code is only one part of delivering software. Studies of developer time consistently show a large share goes to understanding requirements, reading code, testing, reviewing, documenting and supporting systems in production.

With models such as GPT-4o and Claude 3.5 Sonnet, released in May and June, able to handle long documents, images of whiteboards and entire modules of code, LLMs can now contribute across the whole software development lifecycle (SDLC). Here is where they help most, stage by stage.

Requirements

Poorly understood requirements are the most expensive source of defects. LLMs are good at the tedious but valuable work of finding gaps:

  • turning meeting notes or a rough brief into draft user stories with acceptance criteria,
  • listing ambiguous terms and unstated assumptions,
  • enumerating edge cases and error conditions, and
  • checking stories for consistency with existing behaviour.
text
Here is a draft user story and our current refund policy. List:
1. Ambiguities a developer would need resolved
2. Edge cases not covered by the acceptance criteria
3. Conflicts with the refund policy
Do not rewrite the story.

Guardrail: the product owner decides. The AI proposes questions; it does not answer them.

Design

LLMs can help explore options: compare approaches, draft architecture decision records (ADRs), outline data models and identify risks such as scaling limits, failure modes and security concerns. They are particularly helpful as a sounding board for "what could go wrong with this design?".

Guardrail: designs depend on context the model does not have (team skills, existing systems, business constraints), so treat output as input to a human design review.

Build

The familiar territory: generating code, refactoring, explaining unfamiliar code and migrating APIs. By now most teams use assistants here daily.

Guardrail: normal code review, tests and automated security checks for every change.

Test

Testing may be the stage where LLMs add the most underrated value:

  • generating test cases from acceptance criteria, including negative and boundary cases,
  • creating realistic test data (without using production data),
  • writing unit tests for untested legacy code, and
  • suggesting exploratory testing charters for manual testers.
python
# Prompt: "Generate pytest cases for apply_discount() covering boundaries,
# invalid inputs and currency rounding. Use the rules in the docstring only."
@pytest.mark.parametrize("subtotal,code,expected", [
    (Decimal("100.00"), "SAVE10", Decimal("90.00")),
    (Decimal("49.99"),  "SAVE10", Decimal("49.99")),   # below minimum spend
    (Decimal("50.00"),  "SAVE10", Decimal("45.00")),   # exactly at minimum
    (Decimal("100.00"), "save10", Decimal("90.00")),   # codes are case-insensitive
    (Decimal("100.00"), "EXPIRED", Decimal("100.00")),
])
def test_apply_discount(subtotal, code, expected):
    assert apply_discount(subtotal, code) == expected

Guardrail: expected values come from requirements, not from the model's guess or the code's current behaviour.

Review

AI can summarise large pull requests, flag likely issues and check changes against team conventions before a human reviewer looks. That makes human review faster and more focused.

Guardrail: AI review is a first pass. Humans still approve.

Documentation

Documentation has always lagged behind code because writing it is tedious. LLMs change the economics:

  • docstrings and API reference drafts,
  • README and onboarding guides generated from the codebase,
  • release notes from merged pull requests, and
  • keeping docs current by proposing updates alongside code changes.

Guardrail: reviewers check that docs describe what the code actually does, and why.

Operations

In production, LLMs help summarise incidents, explain logs and alerts, draft runbooks and write post-incident reviews. Read-only access to observability data provides most of the value with little risk.

Guardrail: no unreviewed production changes by AI; humans execute remediation.

Putting it together

flowchart TB
  R[Requirements<br/>AI finds gaps] --> D[Design<br/>AI explores options]
  D --> B[Build<br/>AI drafts code]
  B --> T[Test<br/>AI enumerates cases]
  T --> Rv[Review<br/>AI first pass]
  Rv --> Doc[Docs & release notes<br/>AI drafts]
  Doc --> O[Operate<br/>AI summarises]
  O -->|incidents & feedback| R
  H((Human owner<br/>at every stage)) -.-> R
  H -.-> D
  H -.-> B
  H -.-> T
  H -.-> Rv
  H -.-> Doc
  H -.-> O

Adoption advice

  1. Start where the pain is: often requirements clarification, testing or documentation rather than code.
  2. Assign a human owner for AI output at each stage.
  3. Protect data: requirements documents, logs and incident notes often contain sensitive information. Use tools with appropriate data handling.
  4. Measure end-to-end outcomes: lead time, escaped defects and documentation freshness, not tool usage.

The bottom line

The biggest gains from LLMs in software engineering may not come from writing code faster, but from doing the surrounding work (clarifying, testing, documenting and explaining) that teams have always struggled to find time for. With a human owner at every stage, AI can make the whole lifecycle better, not just one part of it.

Our secure SDLC team applies AI across the full SDLC in client projects, with clear ownership and review at every stage.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.