Software Engineering with AI Assistance

Designing Solutions with AI Assistance


Learning Objectives

  • You understand how AI tools can support design work without taking over design decisions.
  • You know how to ask for alternatives, trade-offs, and critique.
  • You can recognize when a design is too complex for the problem at hand.

Design happens before code

Once a task is specific enough to implement, the next question is how the solution should be structured.

For small tasks, design may mean deciding how many functions are needed and how data flows through them. For larger systems, design may involve modules, interfaces, storage choices, and boundaries between deterministic code and model-driven behavior.

In either case, design work can reduce accidental complexity before code is written.

Useful questions to ask

When using AI support during design, the most useful questions are often not “write the whole program” questions. Better prompts ask for:

  • alternative decompositions,
  • likely trade-offs,
  • possible edge cases,
  • or critique of a proposed structure.

As an example, if you are building a command-line program that reads files and produces a report, it is often better to ask for a separation between input reading, analysis, and output formatting than to ask for one large script that handles everything at once.

Example: Small CLI decomposition

Suppose that we want a command-line tool that reads text files and prints a summary report. One reasonable decomposition could look like this:

// fileUtils.js
// analyzer.js
// report.js
// main.js

This is not the only correct design, but it has an immediate advantage: each part has a clear responsibility.

  • fileUtils.js handles reading files,
  • analyzer.js handles the analysis logic,
  • report.js handles output formatting,
  • and main.js coordinates the program flow.

An AI assistant can help propose a decomposition like this, but the engineer still has to decide whether the decomposition makes the system clearer or simply adds unnecessary files.

Loading Exercise...

Ask for critique, not just for solutions

One of the most effective uses of AI in design work is to ask the model to critique a proposal.

For example:

  • “What assumptions does this design make?”
  • “Which part is likely to become hard to test?”
  • “What would be a simpler version of this design?”

These prompts are valuable because they push the interaction toward analysis instead of unreviewed generation.

For a small CLI tool, a critique prompt might be as simple as:

Review the following CLI program design.
Point out:
- unclear responsibilities,
- unnecessary complexity,
- likely testing problems,
- and one simpler alternative if the design is too heavy.

Do not write the whole program.

(current design)

This kind of prompt is especially useful when an earlier AI suggestion already proposed a structure and you now need to decide whether that structure is worth keeping.

For additional details on using models for ideation before selection, see Putting GPT-3’s Creativity to the (Alternative Uses) Test, Brainstorm, then Select: a Generative Language Model Improves Its Creativity Score, and the software-engineering-oriented research agenda Creativity, Generative AI, and Software Development.

Loading Exercise...

KISS Principle

The KISS principle (“Keep it simple, stupid”) is a design philosophy that emphasizes avoiding unnecessary complexity.

AI assistants often suggest more abstraction than a small task needs. Extra modules, wrappers, or patterns are not automatically signs of good design. If a simpler structure is easier to read, test, and maintain, it is usually the better choice.

A practical design habit

Before accepting a suggested design, ask:

  • What is each part responsible for?
  • Could I explain the data flow in a few sentences?
  • Would the program become easier to test?
  • Or am I mostly adding structure because the AI suggested it?

If the answers are unclear, slow down, and try to think whether the design could be kept smaller and more explicit.

Loading Exercise...