Software Development Task - Code Review ChatGPT Cheat Sheet

Home

Automated Code Review Suggestions

ChatGPT can be used to formulate suggestions or ask relevant questions about the code under review.

Examples:

How can the efficiency of this

{{code snippet}}

be improved?
What would be the impact of refactoring this

{{code snippet}}

?
Can you suggest a better implementation of this

{{function/module/class/method}}

shown in the

{{code snippet}}

?

Testing Suggestions

ChatGPT can provide input about which tests would be beneficial for specific pieces of code.

Examples:

Which test cases would be useful for this

{{code snippet}}

?
What would be a good unit test for this

{{function/method}}

?
What type of integration tests should we consider for this

{{module/class}}

?

Bug Detection

ChatGPT can help identify potential errors or bugs in the code.

Examples:

What bugs can you identify in this

{{code snippet}}

?
This test case failed for this

{{code snippet}}

, what could be the issue?
Can you see any potential flaw in this

{{function}}

that might cause it to break?

Code Optimization

ChatGPT can offer suggestions on how to optimize code for improvement in performance.

Examples:

How can this

{{code snippet}}

be optimized for better performance?
Is there a way to reduce the time complexity of this

{{code logic}}

?
Can this

{{database query}}

be optimized?

Coding Best Practices

ChatGPT can be used to suggest coding best practices or coding standards.

Examples:

Are there any coding best practices violated in this

{{code snippet}}

?
Is this

{{code snippet}}

following our coding standards?
How can I refactor this

{{code snippet}}

to make it more understandable and follow best practices?

Code Explanation

ChatGPT can explain a given piece of code, how it works, and what it does.

Examples:

What does this

{{code snippet}}

do?
Can you explain how this

{{function/method}}

works?
What is the purpose of this

{{class/module}}

in the program?
© 2023 Calum | More Information | Feedback?