Skip to content

AI‐Assisted Software Development

Somkiat Puisungnoen edited this page Sep 11, 2025 · 11 revisions

AI-Assisted Software Development

1. Preparation

  • Choose AI
  • IDE or Text editor
  • Version control
  • Prompts

Mindsets

  • AI is a tool
  • Iterative process
  • Verify and understand
  • Be specific in your requirement
  • Lean from AI suggestions

Basic of prompts

Setting your project

I'm starting a new [type of project] using [programming language/framework]. 
Can you suggest a basic file structure and essential dependencies I should consider?

AI's capability

What are the key strengths and limitations I should be aware of when using you for software development tasks?

Create coding plan

I want to build [brief project description]. 
Can you help me break this down into manageable tasks and suggest an order of implementation?

2. Project initial and planning

  • Create knowledge based for your AI assistant
    • Project overview
    • Tech stack
    • Key requirements
    • Constraints
    • Coding style

Example prompt

I'm starting a new project and I'd like to create a knowledge base for you to reference throughout our development process. 

The project is [brief description]. 
We'll be using [tech stack]. 
The key features we need to implement are [list features]. 
Some important constraints to keep in mind are [list constraints]. 
In terms of coding style, we prefer [mention preferences]. 

Can you summarize this information and suggest any additional details we should include in our knowledge base?

Breakdown into small tasks

Based on the project overview we just created, can you help me break down this project into manageable components or modules? For each component, please suggest:
1. A name for the component
2. Its main functionality
3. Potential challenges in implementing it
4. How it might interact with other components

Please also recommend a logical order for developing these components.

Create project roadmap

Using the component breakdown we've created, can you help me develop a project roadmap? Please include:
1. A suggested order for developing the components
2. Estimated time frames for each component (assuming I'm working on this part-time)
3. Potential milestones or checkpoints
4. Any dependencies between components that might affect the development order
5. Suggestions for any proof-of-concept or prototype stages that might be beneficial

3. Design and Architecture

  • Use Think step-by-step prompts
Let's think step-by-step about the architecture for [specific component or system]. 
Please consider:
1. The main functionalities this component needs to support
2. Potential data structures or models
3. Key classes or modules and their responsibilities
4. How this component will interact with other parts of the system
5. Potential design patterns that could be applicable
6. Considerations for scalability and maintainability

For each step, provide a brief explanation of your reasoning.

Use iterative process

Thank you for that initial design. I have a few follow-up questions:
1. What are the potential drawbacks or limitations of this approach?
2. Can you suggest an alternative design that prioritizes [specific concern, e.g., performance, flexibility]?
3. How would this design need to change if we needed to [potential future requirement]?

Generate diagram

Generate Documenting Architecture Decisions

Based on our discussion of the [component/system] architecture, 
can you help me create an Architecture Decision Record (ADR)? Please include:

1. The context and problem we're addressing
2. The options we considered
3. The decision we made
4. The consequences (both positive and negative) of this decision
5. Any related decisions or trade-offs

Database design

We need to design a database schema for [specific part of the system]. 
Based on our requirements, can you suggest an initial schema design? 
Please include tables, key fields, and relationships. 
Also, consider potential indexing strategies for performance.
I'm designing a database for [describe your application]. The main entities are:
[List main entities]

Key requirements:
1. [Requirement 1, e.g., "Must support fast retrieval of user posts"]
2. [Requirement 2, e.g., "Need to track user relationships (followers/following)"]
3. [Requirement 3, e.g., "Must handle large volumes of time-series data for analytics"]

Please suggest a database schema that includes:
1. Tables and their columns (with appropriate data types)
2. Primary and foreign key relationships
3. Any necessary junction tables for many-to-many relationships
4. Suggested indexes for performance
5. Considerations for scalability

Also, please explain the rationale behind your design choices.

API design

We're planning to create a RESTful API for [specific functionality]. 
Can you help design the endpoints we'll need? 
For each endpoint, suggest the HTTP method, URL structure, request/response formats, and any authentication requirements.

Suggestion for scalability of system

As we design our system, we need to ensure it can scale to handle [expected load]. 
Can you review our current architecture and suggest modifications or additional components we might need to ensure scalability? 
Please consider both vertical and horizontal scaling strategies.

4. Generate code

The AI Coding Workflow

  • Start with a clear specification
  • Generate initial code
  • Review and understand
  • Iterate and refine
  • Test and debug
  • Optimize and refactor
  • Repeat !!

5. Testing

Generate test cases

I need unit tests for the following function:
[Paste your function here]

Please generate a comprehensive set of unit tests that cover:
1. Happy path scenarios
2. Edge cases
3. Error conditions
4. Boundary value analysis

For each test case, please:
1. Provide a brief description of what the test is checking
2. Write the actual test code using [preferred testing framework, e.g., pytest]
3. Explain any mock objects or fixtures that might be needed

Also, suggest any additional tests that might be relevant based on common pitfalls or best practices for this type of function.

Security testing

Please review the following code for potential security vulnerabilities:
[Paste your code]

Consider common security issues such as:
1. Injection flaws
2. Broken authentication
3. Sensitive data exposure
4. XML external entities (XXE)
5. Broken access control
6. Security misconfigurations
7. Cross-site scripting (XSS)

For each vulnerability found, explain the risk and suggest secure coding practices to mitigate it.

Generate test data

I need to generate test data for the following database schema:
[Paste your schema here]

Please help me create a test data generation plan:
1. Suggest appropriate ranges or types of values for each field
2. Provide SQL or script to generate a diverse set of test data, including:
   - Normal cases
   - Edge cases
   - Invalid data to test error handling
3. Ensure referential integrity is maintained for related tables
4. Include any specific scenarios or data patterns crucial for thorough testing

The test data should be comprehensive enough to cover various testing scenarios while remaining manageable in size.

Reference websites

Clone this wiki locally