Integrating ChatGPT-4 Into Your Development Process
ChatGPT Generated Logo

Integrating ChatGPT-4 Into Your Development Process

ChatGPT has taken the tech world by storm with the usual, perhaps warranted in this case, hype. One prediction is that major tasks normally associated with highly trained humans like lawyers, doctors and programmers will be performed by this class of intelligence emulators. My exploration into the capabilities of ChatGPT and in particular ChatGPT-4 have convinced me that… not quite yet!

However, it has also convinced me that, as a powerful research and programming assistant, ChatGPT excels in three main areas where every other search tools fail miserably.

First: ChatGPT’s native language capabilities means that it ‘understands’ the questions that you are asking so it can respond with a narrowly focused answer. No more tedious searches for that one flower of knowledge in the weed filled garden of that is the Web! Ask a precise question and ChatGPT will give you a precise answer. If your question is not specific enough as indicated by the response: edit it and ask again. The answer will get more focused as you nail down your requirements.

Second: ChatGPT’s ability to follow the application development process as one continuous conversation from initial requirements through UML architecture, coding, deployment and full round trip model updates means that refinements can be easily applied without error prone manual intervention. It can track the evolution of the product as requirements change or testing exposes issues requiring model updates.

Third: ChatGPT is a pretty good full stack coder when given explicit instructions! A model can be created in UML then coded into an Angular/Material Application, a Java REST service, a SQL update script and a Docker deployment all based on conversational input. The responses are in code snippet form so there is some cut and paste involved, although ChatGPT can wrap the response in a Linux 'echo' shell script to create multiple individual files.

For this blog we will be starting a simple project called Brainstorm. We will be assuming several roles as is typical of a medium complexity project, starting with Project Manager, Software Architect, Backend and UI Developers and Devops Engineer Devops. The process will proceed as one conversation with ChatGPT using typical Scrum ‘story’ form.

Prerequisites

This Blog assumes you are familiar with the Agile software development process as followed by Scrum practitioners and have some background in the technologies around Enterprise Application Development using typical tools of the trade: Java/SpringBoot, Angular/Material, SQL database and Docker. It also assumes that you use an IDE to like VSCode or IntelliJ to develop and run application code.

Getting Started

The first and only setup step, as of this writing is to get a ‘Research Account’ with OpenAI to use to interact with ChatGPT-4.

Start the Conversation

Assuming that we have a ChatGPT-4 Research Account and have the browser open to the request page we will start the conversation by introducing ourself as the Project Manager starting the project. A typical introductory conversation would be:

Request (Project Manager):

As Ken the Project Manager I will be managing a Software Development Project called 'Brainstorm'. 

This will be a Web and Mobile Application for capturing Ideas from Users 

and promoting the winning Ideas based on Users' votes. 

The Votes will be tabulated and displayed after a Voting Session.

Response (ChatGPT):

That sounds like an exciting project, Ken! As the project manager for the "Brainstorm" software development project, you have an important role in ensuring its successful completion. Here are some key steps and considerations you may want to keep in mind:

  1. Project Scope and Requirements: Clearly define the scope of the project by identifying the specific features and functionalities you want to include in the web and mobile application. Collaborate with stakeholders and gather detailed requirements to ensure a thorough understanding of what needs to be developed.
  2. Project Team and Roles: Assemble a project team consisting of developers, designers, testers, and other relevant roles. Clearly define their responsibilities and establish effective communication channels to ensure everyone is on the same page.
  3. Project Plan and Timeline: Create a project plan that outlines the major tasks, milestones, and deliverables for the entire project. Develop a realistic timeline, considering the scope, available resources, and any dependencies. Identify critical paths and allocate sufficient time for testing and quality assurance.
  4. Agile Methodology: Consider adopting an Agile development methodology, such as Scrum or Kanban, which can provide flexibility and adaptability to changing requirements. Break down the project into smaller iterations or sprints, allowing for incremental development and regular feedback from stakeholders.
  5. User Interface and Experience: Pay attention to the design and usability of the application. Work closely with designers to create an intuitive user interface that encourages user engagement and captures ideas effectively. Conduct user testing and gather feedback to continuously improve the user experience.
  6. Development and Testing: Coordinate with the development team to ensure the timely implementation of features. Encourage collaboration and regular communication within the team. Implement a robust testing strategy to identify and fix bugs early in the development cycle.
  7. Security and Privacy: Prioritize the security and privacy of user data. Implement appropriate measures to protect sensitive information and comply with relevant data protection regulations. Conduct security audits and penetration testing to identify and mitigate any vulnerabilities.
  8. Deployment and Launch: Plan the deployment process carefully, considering both web and mobile platforms. Ensure compatibility across different devices and browsers. Perform thorough testing in staging environments before releasing the application to production.
  9. Continuous Improvement: After the initial launch, gather feedback from users and stakeholders. Use this feedback to identify areas for improvement and plan future updates and enhancements. Maintain a feedback loop and prioritize feature requests based on user needs.
  10. Project Communication: Maintain regular and transparent communication with stakeholders throughout the project. Provide status updates, address concerns promptly, and manage expectations effectively.

Remember, successful project management involves careful planning, effective coordination, and continuous evaluation. By following these steps and adapting to any challenges along the way, you can increase the likelihood of a successful outcome for the "Brainstorm" project. Good luck!

Comment:

As we can see the response is an accurate description of a software project with specific details that we put in our request like the name of the project and the technologies however it is somewhat general in nature. To get more specifics we will jump to step 6 assuming that we have spent a working retreat week in Bali to get the project kicked off :)

Start the Project and Move Forward

Request:

Ken here. I have completed steps 1 through 5 and have the team together.

Chris will be doing the Software Architecture

Philip will be designing and coding the Angular app

Ashley will be coding the Java service

Scott will be doing the Devops

We will be using Jira/Kanban for project management

Response:

Great progress, Ken! It's good to hear that you've completed the initial steps and have your team in place. Here are some further considerations based on the roles you've assigned and the tools you plan to use:

  1. Software Architecture (Chris): Ensure that Chris collaborates closely with the development team and stakeholders to design a scalable and robust software architecture. This involves defining the system components, their interactions, and any external integrations. Encourage regular communication between Chris and the developers to address any architectural challenges that may arise during implementation.
  2. Angular App Development (Philip): Philip will be responsible for designing and coding the Angular app. Make sure Philip is familiar with the project requirements and works closely with the design team to create an intuitive and user-friendly interface. Encourage code reviews and regular integration with the Java service to ensure smooth integration between the frontend and backend components.
  3. Java Service Development (Ashley): Ashley will be coding the Java service. Ensure that Ashley understands the project requirements and collaborates closely with Philip to establish seamless integration between the frontend and backend components. Encourage code reviews, unit testing, and adherence to coding standards to maintain code quality and reduce potential issues down the line.
  4. DevOps (Scott): Scott's role as a DevOps engineer is crucial for ensuring efficient deployment, monitoring, and maintenance of the application. Scott should collaborate with the development team to establish automated build and deployment pipelines, implement infrastructure as code, and set up monitoring and alerting systems. This will help streamline the development and deployment processes, enabling faster iterations and timely bug fixes.
  5. Project Management (Jira/Kanban): Using Jira with Kanban boards is a great choice for project management. Set up the Kanban boards to visualize the project tasks, their statuses, and any blockers. Encourage the team to update task progress regularly, add new tasks, and provide comments or attachments where necessary. Regularly review the Kanban boards in team meetings to track progress, identify bottlenecks, and adjust priorities as needed.

In addition to these considerations, encourage regular communication and collaboration among team members. Conduct daily stand-up meetings to discuss progress, address any challenges, and provide support to team members. Foster a culture of continuous improvement and knowledge sharing within the team.

By leveraging the strengths of each team member and utilizing the project management tools effectively, you'll be well-positioned to drive the "Brainstorm" project towards success. Keep up the good work, Ken!

Comment:

Again somewhat general although ChatGPT provided more specifics on the Software Architecture step. It is time to hand it over to Chris the Software Architect. At this point ChatGPT does not support collaborative conversations so for the sake of this exercise we will use the same conversation to continue the process.

Request (Chris):

Chris here, I have studied the requirements and have decided on the following technologies for the Brainstorm application:

PlantUML for UML design

Java/SpringBoot for backend services

Postgres database

Angular/Material UI

Docker compose deployment.

Response:

Hi Chris! It's great to hear that you have studied the requirements and made decisions regarding the technologies for the Brainstorm application. Your chosen tech stack looks solid. Here are some considerations for each technology:

  1. PlantUML: Using PlantUML for UML design is a good choice. It allows you to create diagrams that can be easily version controlled and shared with the team. Ensure that the UML diagrams accurately represent the system architecture, database design, and any other relevant components. This will serve as a valuable reference for the development team and stakeholders.
  2. Java/Spring Boot: Opting for Java with Spring Boot for backend services is a popular and powerful choice. Spring Boot provides a robust framework for building RESTful APIs and managing the application's business logic. Make sure that the backend services are designed with scalability, maintainability, and security in mind. Leverage Spring Boot's features, such as dependency injection and built-in security mechanisms, to streamline development.
  3. Postgres Database: Selecting Postgres as the database management system is a reliable choice. It offers a wide range of features, including support for complex queries, data integrity, and scalability. Ensure that the database schema is designed to efficiently store and retrieve the required data. Consider implementing appropriate indexes and relationships to optimize performance.
  4. Angular/Material UI: Choosing Angular with Material UI for the frontend development is a powerful combination. Angular provides a robust framework for building dynamic and responsive single-page applications. Material UI offers a set of pre-designed components and styles that align with modern design principles. Ensure that the UI is intuitive, user-friendly, and consistent across different devices and browsers. Leverage Angular's reactive forms and data binding capabilities to enhance user interactions.
  5. Docker Compose: Deploying the application using Docker Compose allows for consistent and reproducible environments across development, testing, and production. Containerization helps manage dependencies and simplifies the deployment process. Ensure that the Docker Compose configuration includes all necessary services and dependencies, such as the application, database, and any additional components required for the deployment.

Remember to document the configuration and setup instructions for each technology to facilitate smooth onboarding and future maintenance. Encourage collaboration and knowledge sharing among the team members to ensure everyone is familiar with the chosen technologies.

By leveraging these technologies effectively, you can build a scalable, maintainable, and user-friendly Brainstorm application. Best of luck, Chris, and I'm here to assist if you have any further questions!

Get Down To Details

Because I am feeling lazy today I will ask ChatGPT to do my job as Architect and hopefully take an early lunch :)

Request

Chris here, I need a plant UML class diagram for the Brainstorm application.

Response:

Certainly, Chris! Here's a sample PlantUML class diagram for the Brainstorm application:

@startum
class User {
  - id: int
  - username: string
  - email: string
  - password: string
  - createdAt: datetime
  - updatedAt: datetime
  + getIdeas(): Idea[]
  + getVotes(): Vote[]
  + createIdea(title: string, description: string): Idea
  + voteForIdea(idea: Idea): void
}


class Idea {
  - id: int
  - title: string
  - description: string
  - createdAt: datetime
  - updatedAt: datetime
  + getAuthor(): User
  + getVotes(): Vote[]
  + addVote(vote: Vote): void
}


class Vote {
  - id: int
  - user: User
  - idea: Idea
}


class VoteSession {
  - id: int
  - startDate: datetime
  - endDate: datetime
  - isOpen: bool
  - winningIdeas: Idea[]
  + open(): void
  + close(): void
  + tabulateVotes(): void
  + addIdeaToWinners(idea: Idea): void
}


class Notification {
  - id: int
  - message: string
  - createdAt: datetime
  + sendToUser(user: User): void
}


class Database {
  - connection: string
  + saveUser(user: User): void
  + saveIdea(idea: Idea): void
  + saveVote(vote: Vote): void
  + getUsers(): User[]
  + getIdeas(): Idea[]
  + getVotes(): Vote[]
}


User "1" --> "0..*" Idea
User "1" --> "0..*" Vote
Idea "1" --> "0..*" Vote
VoteSession "1" --> "0..*" Idea
Vote "1" --> "0..1" User
Vote "1" --> "0..1" Idea
User "1" --> "0..*" Notification
Database "1" --> "0..*" User
Database "1" --> "0..*" Idea
Database "1" --> "0..*" Vote


@endumll        

Comments

Not a bad guess at the model based on the first conversation with Ken but I don’t think I will be taking an early lunch. Several issues jump out at me:

  • Some methods reference missing fields
  • I want a general, attributes-only model, that will be used for describing the JSON data, the database fields and UI form details… No methods needed
  • The Database Class is not needed since that is handled by SpringBoot DataSource configuration.
  • I want to use UUIDs to enable clustered scaling
  • I would like to use a base class to handle some details for the sub classes
  • I forgot to add a package - this is required for Java and helps to keep things organized
  • I want the diagram to be named for later reference.

UML Refinement

We will provide some more specific detail to narrow the response down. Editing the request and resubmitting generally works best rather than just submitting a new, slightly changed, one which can get ChatGPT confused and frustrated.

Edited Request:

Chris here, I need a plant UML class diagram for the Brainstorm application.

Name the diagram 'Brainstorm UML Model'

Use the package 'com.brainstorm'.

Create the classes with attributes - no methods.

The model will include a base class called BaseEntity with UUID for id and typical attributes.

Other classes, with typical attributes include: User, Vote, Idea and VotingSession. Create the relationship links based on:

Voting session has Ideas, startTime and endTime

Ideas have Votes

Votes have Users

Add the inheritance notation for all classes.

Response:

Certainly, Chris! Here's a PlantUML class diagram for the Brainstorm application, incorporating the classes you mentioned along with their attributes and the specified relationships:

@startuml BrainstormUMLMode


package com.brainstorm {
  
  abstract class BaseEntity {
    +id: UUID
    +createdAt: LocalDateTime
    +updatedAt: LocalDateTime
  }
  
  class User {
    +firstName: String
    +lastName: String
    +email: String
    +password: String
  }
  
  class Vote {
    +user: User
    +voteCount: int
  }
  
  class Idea {
    +title: String
    +description: String
    +creator: User
    +votes: List<Vote>
  }
  
  class VotingSession {
    +ideas: List<Idea>
    +startTime: LocalDateTime
    +endTime: LocalDateTime
  }
  
  VotingSession -- "1..*" Idea
  Idea "1..*" -- "0..*" Vote
  Vote "1" -- "0..1" User
  
  BaseEntity <|-- User
  BaseEntity <|-- Vote
  BaseEntity <|-- Idea
  BaseEntity <|-- VotingSession
}


@endumll        

In this diagram, the BaseEntity class serves as the base class for other classes, providing common attributes such as id, createdAt, and updatedAt. The User class represents users of the application, with attributes like firstName, lastName, email, and password. The Vote class represents individual votes and includes the user who cast the vote and the voteCount. The Idea class represents ideas submitted by users, including attributes like title, description, creator, and a list of associated votes. The VotingSession class represents a session in which voting takes place and includes attributes such as ideas, startTime, and endTime.

The relationships are represented using association lines. The VotingSession has a one-to-many relationship with Idea, as indicated by the "1..*" multiplicity on the VotingSession end and no multiplicity on the Idea end. The Idea class has a one-to-many relationship with Vote, indicating that an idea can have multiple votes. Finally, the Vote class has a one-to-one relationship with User, as indicated by the "0..1" multiplicity on the Vote end and no multiplicity on the User end.

I've also added the inheritance notation with the <|-- symbol to show that all the classes inherit from the BaseEntity class.

Please note that this diagram represents the class structure and relationships as you specified, but it does not include any methods. Let me know if you need any further assistance or if you have any additional requirements!

Render and Review Your Model

PlantUML was chosen as the UML technology because ChatGPT seems to understand it, probably because it is text based and concise. To render your diagram use the on-line rendering tools at: PlantUML Web Server. Simply copy/paste the above PlantUml definition into the text area and hit Submit. You should see your UML diagram:

No alt text provided for this image

If you need to keep things internal you can run the PlantUML docker image locally and use the VSCode PlantUML plugin to automatically render your UML diagram - just ask ChatGPT and follow the instructions:

Request

As Architect I need to run the PlantUML service using docker-compose while editing and viewing diagrams using VSCode.

Manual Refinement

Assuming that we are using VSCode and the PlantUML extension or the online tool we can edit the class diagram and view the model changes as they are made. Once we have presented and reviewed the model with the team we will let ChatGPT know that there is an updated diagram so that that will become the basis for downstream developments.

Request

I have updated the model as follows:

@startuml BrainstormUMLModel

skinparam groupInheritance 2

package com.brainstorm {

abstract class BaseEntity {

+id: UUID

+createdAt: DateTime

+updatedAt: DateTime

}

class User {

+firstName: String

+lastName: String

+email: String

+password: String

}

class Vote {

+user: User

+voteCount: int

}

class Idea {

+title: String

+description: String

+creator: User

+votes: List<Vote>

}

class VotingSession {

+name: String

+ description: String

+ideas: List<Idea>

+startTime: DateTime

+endTime: DateTime

}

VotingSession o--> "1..*" Idea

Idea "1..*"*--> "0..*" Vote

Vote "1" o--> "0..1" User

BaseEntity <|-- User

BaseEntity <|-- Vote

BaseEntity <|-- Idea

BaseEntity <|-- VotingSession

}

@enduml

Lets keep that and name it 'Brainstorm UML Model'

Response:

Certainly, Chris! Here's the updated PlantUML class diagram for the Brainstorm UML Model, with the modifications you specified:

@startuml BrainstormUMLMode


title Brainstorm UML Model


skinparam groupInheritance 2
package com.brainstorm {
  
  abstract class BaseEntity {
    +id: UUID
    +createdAt: DateTime
    +updatedAt: DateTime
  }
  
  class User {
    +firstName: String
    +lastName: String
    +email: String
    +password: String
  }
  
  class Vote {
    +user: User
    +voteCount: int
  }
  
  class Idea {
    +title: String
    +description: String
    +creator: User
    +votes: List<Vote>
  }
  
  class VotingSession {
    +name: String
    +description: String
    +ideas: List<Idea>
    +startTime: DateTime
    +endTime: DateTime
  }
  
  VotingSession o--> "1..*" Idea
  Idea "1..*"*--> "0..*" Vote
  Vote "1" o--> "0..1" User
  
  BaseEntity <|-- User
  BaseEntity <|-- Vote
  BaseEntity <|-- Idea
  BaseEntity <|-- VotingSession
}


@endumll        

I have renamed the diagram to "Brainstorm UML Model" as requested. The modifications include adding the name attribute to the VotingSession class and the description attribute to both VotingSession and Idea classes. The relationship links and inheritance notations remain the same as before.

Please let me know if there is anything else I can assist you with!

Summary

The requirements description was detailed enough to create a model sufficient to move on to creating a POC application. Using the Scrum ‘story’ form in our requests has the advantage that it can be understood and approved by none-technical stakeholders. The advantage for Chris the Architect is that he can work at an abstract level and not have to deal with the syntactical minutia of the design language… in this case PlantUML.

The UML diagram will be used to generate the database create script, the SpringBoot service and the Angular UI in future posts.

Next Steps

Check back for the following posts:

Create the Postgres Database

Create the Java Service Code

Create the Angular Application

Package and Deploy the Application

To view or add a comment, sign in

More articles by Christopher Smith

  • Integrating ChatGPT - DevOps

    Introduction In a previous article in this series: Integrating ChatGPT - Team Collaboration we covered using ChatGPT to…

  • Integrating ChatGPT - Team Collaboration

    Introduction In the first episode of this series, Integrating ChatGPT-4 Into Your Development Process, we covered using…

    1 Comment

Others also viewed

Explore content categories