While debates persist in media and professional communities regarding the advantages and drawbacks of generative AI in software development, engineers seeking innovation and efficiency are already actively integrating it into daily work.
The emergence of ChatGPT, a powerful and widely available large language model (LLM), has stirred the quest for perfection in code and product quality.
Find out the most valuable use case of ChatGPT for software developers and a list of use cases that align with NDA with prompts and outputs examples.
Table Of Content:
1. ChatGPT Use Cases Classification Based on Type of Communication
2. ChatGPT Common Use Cases for Software Developers
- Writing Unit-Tests Example
- Writing Regular Expressions
- Create Source Code Snippet by NL Description: from Simple to Complex
- Create Boilerplate Code by NL
- Naming
- Search Information: Patterns, Libs, Existing Solution
- Discussing How to Solve the Problem
3. ChatGPT Plugins for Software Development
- Web Developer Plugin
- Check Website Down Plugin
- Cloud Diagram Generation Plugin
- SEO CORE AI Plugin
- ChatGPT Code Interpreter
4. NDA Issue—Can One Share Source Code with ChatGPT?
Read also: AI-Powered Coding Assistants—Friend or Foe for Developers?
ChatGPT Use Cases Classification Based on Type of Communication
From the programming point of view, interaction with ChatGPT can be split into two categories:
- entering code into ChatGPT—Programming Language (PL)
- asking questions in a common way—Natural Language (NL)
Such distinction provides a more structured and transparent approach to utilizing the model’s capabilities.
Prompt context | Answer | Use Case |
PL | PL | Bug fixing |
NL | Provide source code and ask to explain it | |
NL | PL | Naming—create name by purpose of var, class, or function |
Boilerplate code | ||
Code snippets | ||
Pattern implementation | ||
NL | Search information—patterns, libs, existing solution | |
Discuss something—how to solve the problem | ||
PL+NL | PL | Unit test generation |
Performance optimization | ||
Change request implementation | ||
NL | Provide source code, define context in NL, and ask to explain it |
Now, having a more organized understanding of common ChatGPT use case types, let’s delve specifically into real examples of prompts to streamline programming in various scenarios.
ChatGPT Common Use Cases for Software Developers
Utilizing the practical experiences shared by our engineers, we’ve made a list of typical use cases where ChatGPT accelerates the completion of coding tasks.
Whether it’s regular expressions, unit tests, code snippet writing, or seeking the most optimal solution, ChatGPT effortlessly handles diverse aspects of software engineering.
Writing Unit-Tests Example
Chat GPT can help in writing unit tests for JavaScript / Typescript applications, simplifying the process and ensuring quality code.
Prompt: Write down Karma unit-tests for the given Angular Directive + **Directive Code**
Writing Regular Expressions
Prompt: Write a typescript angular method to replace variables enclosed in <$…$> with their corresponding values from the passed vars object. If a value for a particular variable is not found in vars, the variable in the source string is not replaced. Make the syntax as compact as possible using all the features of TS.
Create Source Code Snippet by NL Description: from Simple to Complex
Prompt 1: What is in C# date time format for this sample Jan 24, 2023, 15:56.
Prompt 2: Write code to create file from stream.
Prompt 3: Write C# code to delete files and folder from location list.
Create Boilerplate Code by NL
Prompt: I have class with two properties. Can I use it for data binding in ASP.Net controller.
Naming
Prompt: How to name a service that defines surface and calculates its volume.
Search Information: Patterns, Libs, Existing Solution
Prompt 1: I need to calculate surface volume. Is there any lib for this task. In C#.
Prompt 2: What is a Visitor pattern?
Discussing How to Solve the Problem
Prompt: I used Autofac as a DI in my Xamarin Forms application. I want to migrate to MAUI. Should I replace Autofac?
As you can see, ChatGPT presents various opportunities for task automation, promising time savings and improved product quality. Yet, the real game-changer emerges when applying ChatGPT plugins specifically designed for software developers. Keep reading to discover the hands-on applications of ChatGPT Plugins that we’ve put to the test.
ChatGPT Plugins for Software Development
To make the chatbot even smarter, you can install plugins in your ChatGPT. There are dozens of different plugins to choose from in the ChatGPT store. To assist you, we’ve experimented with the most popular plugins available and compiled a list of those we believe would be most beneficial for developers.
Keep in mind that you’ll need to enable the plugin beta feature before accessing the store or these plugins.
Web Developer Plugin
The Web Developer Plugin for ChatGPT enhances developers’ workflow by providing instant code assistance, syntax checking, learning resources, and real-time debugging insights within their development environment. It streamlines web development, promotes best practices, and keeps developers informed about the latest technologies.
Prompt: Create simple HTML page with CSS and JS. H1 title = ‘Web Dev Plugin Demo’
p in the center of the page with count
2 buttons which increment and decrement count
And give me the link
Check Website Down Plugin
The Check Website Down Plugin is valuable for software developers, offering quick and efficient monitoring of website status. It ensures prompt detection of downtime, enabling developers to swiftly address issues, minimize disruptions, and maintain optimal website performance.
Prompt: https://example_website.com
Cloud Diagram Generation Plugin
The Cloud Diagram Generation Plugin is valuable for software developers, offering efficient creation of visual representations for cloud architectures. It simplifies complex structures, aiding in clear communication, collaboration, and streamlined development of cloud-based applications.
With this plugin, you will be able to effortlessly create professional-looking diagrams that clearly show the relationships between your various systems and components.
Prompt:
Result:
SEO CORE AI Plugin
The SEO CORE AI Plugin is invaluable for software developers, providing advanced AI-driven insights to optimize website content for search engines. It enhances SEO strategies, boosts visibility, and streamlines the development of search engine-friendly applications.
Prompt: Give recommendations for improvements of https://example_website.com
As a result, ChatGPT will output a list of recommendations to improve SEO settings of a specific website page like title tag, meta description, h1 tag, content, URL, will suggest a number of backlinks with the required websites, etc.
ChatGPT Code Interpreter
The ChatGPT Code Interpreter offers real-time code interpretation and execution assistance.
It accelerates debugging, aids in code comprehension, and enhances the overall development workflow.
Note: To access Code Interpreter’s functionality, you need a ChatGPT plus account.
Prompt:
Result:
ChatGPT plugins and ChatGPT Code Interpreter can save developers time across a variety of tasks even though this functionality is still in Beta, and their effectiveness is poised to improve over time.
And the final yet crucial question—how to navigate ChatGPT and its plugins’ capabilities without breaching privacy policies and respecting NDA? Feeding source code and sensitive corporate data into the large language model may lead to massive leaks of proprietary information. How to address this challenge?
NDA Issue—Can One Share Source Code with ChatGPT?
It’s important to approach the use of ChatGPT for source code review with caution, especially when dealing with sensitive information covered by nondisclosure agreements (NDAs).
Certain use cases from the programming language (PL) and PL+NL classification rows could potentially breach NDAs. ChatGPT clearly states that all provided information can be reviewed by its engineers, and any sensitive information cannot be used in a prompt.
However, there are specific cases from the natural language (NL) classification row that may not pose a risk of NDA breaches:
Answer in PL:
- Create source code snippet by NL description: Generating code based on a natural language description can be a safe and helpful way to explore potential solutions without revealing proprietary details.
- Create boilerplate code by NL requirements: Similarly, generating boilerplate code based on natural language requirements can be a useful exercise without disclosing sensitive information.
- Naming — “does my var or function name sound good?”: Seeking advice on variable and function names without providing the actual source code may not expose proprietary details.
Answer in NL:
- Search information—patterns, libs, existing solution: Using ChatGPT to search for general information, patterns, libraries, or existing solutions can be done without revealing specific proprietary code.
- Discuss how to solve the specific problem: Engaging in discussions about problem-solving strategies or high-level approaches, without divulging specific code details, can be a safe use of ChatGPT.
All in all, it’s crucial to avoid sharing confidential source code or any proprietary information that could violate legal agreements.
Summary
The most valuable application (without any risks of NDA violation) of ChatGPT for software developers is code snippet generation. It can generate boilerplate code based on “Stack overflow” in seconds, saving the developer’s time.
To maximize effectiveness, engineers should:
- adhere to NDA principles,
- clearly define tasks,
- specify the context (programming language and framework),
- provide detailed information for iterative improvements,
- utilize ChatGPT plugins and Code Interpreter,
- and consider upgrading to ChatGPT Plus for uninterrupted server access and the latest features.
***
This is the first article in the publication series devoted to AI-augmented software development.
Stay tuned and explore further ChatGPT functionalities for managers and other AI assistants for software developers: GitHub Copilot, Tabnine, AWS Codewhisperer, and Bito. Reach out in case you have any questions or seek support.