Slide 1

Slide 1 text

Explainable AI Dr. Kla Tantithamthavorn Senior Lecturer in Software Engineering Monash University, Australia http://chakkrit.com @klainfo Software Engineering in the Age of Generative AI

Slide 2

Slide 2 text

Dr. Kla Tantithamthavorn ● Expertise in Explainable AI and Software Engineering ● Co-authored the first online book on Explainable AI for Software Engineering (http://xai4se.github.io), attracting over 20,000 page views from 83 countries worldwide ● Co-edited an IEEE Software Special Issue on XAI for SE ● Awarded ARC DECRA Fellowship, JSPS Fellowship, ACM SIGSOFT Distinguished Paper, Distinguished Reviewer ● Received strong media attention from Gizmodo, Australian Cyber Security Magazine, TechXplore, Cybersecurity Connect, Australian Computer Society, etc Learn more http://chakkrit.com/

Slide 3

Slide 3 text

AI Has Emerged as a Powerful Tool for Software Companies Syntax-Aware On-the-Fly Code Completion, Wannita Takerngsaksiri, Chakkrit Tantithamthavorn, Yuan-Fang Li, Under Review at IEEE Transactions on Soft. Eng. (2023)

Slide 4

Slide 4 text

Generative AI (ChatGPT, LLMs, etc.) ● Since its introduction in November 2022, ChatGPT has rapidly gained popularity due to its remarkable ability in language understanding and human-like responses ● Generative AI is a type of artificial intelligence that is capable of creating original and unique content, such as images, videos, music, or text. It works by learning patterns and styles from existing data and generating new content. ● ChatGPT, based on GPT-3.5 architecture, has shown great promise for revolutionizing various research fields, including code generation, testing, and bug fixing, improving efficiency, enhancing creativity, and reducing costs.

Slide 5

Slide 5 text

What Software Engineering Tasks that ChatGPT Can Help?

Slide 6

Slide 6 text

ChatGPT for Software Planning (Generate Business Requirements)

Slide 7

Slide 7 text

ChatGPT for Software Planning (Generate User Stories)

Slide 8

Slide 8 text

ChatGPT for Software Design

Slide 9

Slide 9 text

ChatGPT for Software Design (Generate a Class Diagram)

Slide 10

Slide 10 text

ChatGPT for Software Design (Generate a State Diagram)

Slide 11

Slide 11 text

ChatGPT for Coding

Slide 12

Slide 12 text

ChatGPT for Coding

Slide 13

Slide 13 text

ChatGPT for Software Testing

Slide 14

Slide 14 text

ChatGPT for Software Testing (Generate acceptance test cases)

Slide 15

Slide 15 text

ChatGPT for Software Testing (Generate test cases)

Slide 16

Slide 16 text

ChatGPT Is Dumber Than You Think Here is the fundamental problem with ChatGPT: it can provide answers and information that no one ever knows for sure is true because it is not referenceable.

Slide 17

Slide 17 text

Challenge 1: ChatGPT Can’t Generate High-Quality Code We analyzed 4,066 ChatGPT- generated code implemented in two popular programming languages, i.e., Java and Python, for 2,033 LeetCode’s programming tasks. Key Findings: ● Code quality issues commonly happen in both code that pass or failed test cases, highlighting the need for characterizing and addressing these concerns alongside the functional correctness. ● Issues in ChatGPT-generated code can be categorized into four categories: Compilation & Runtime Errors, Wrong Outputs, Code Style & Maintainability, Performance & Efficiency ● Wrong Outputs and Code Style & Maintainability issues are the most common challenges faced by the ChatGPT-generated code, while Compilation & Runtime Errors and Performance & Efficiency issues are less prevalent. Liu, Yue, et al. "Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issues." Under Review at TOSEM, 2023.

Slide 18

Slide 18 text

Challenge 2: ChatGPT Can’t Generate Secure Code Context: this program receives an email address as input, and passes it to a program (as a parameter) through a shell. Problem: Handling input in this manner allows a malicious adversary to execute arbitrary code by appending shell instructions to a fictitious email. CWE: Arbitrary code execution (CWE-94) First Attempt Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions, IEEE S&P 2021

Slide 19

Slide 19 text

Challenge 2: ChatGPT Can’t Generate Secure Code Context: this program receives an email address as input, and passes it to a program (as a parameter) through a shell. Problem: Handling input in this manner allows a malicious adversary to execute arbitrary code by appending shell instructions to a fictitious email. CWE: Arbitrary code execution (CWE-94) Second Attempt

Slide 20

Slide 20 text

Challenge 2: ChatGPT Can’t Generate Secure Code Context: this program receives an email address as input, and passes it to a program (as a parameter) through a shell. Problem: Handling input in this manner allows a malicious adversary to execute arbitrary code by appending shell instructions to a fictitious email. CWE: Arbitrary code execution (CWE-94) Last Attempt, Otherwise I will give up!

Slide 21

Slide 21 text

Challenge 2: ChatGPT Can’t Generate Secure Code Context: this program receives an email address as input, and passes it to a program (as a parameter) through a shell. Problem: Handling input in this manner allows a malicious adversary to execute arbitrary code by appending shell instructions to a fictitious email. CWE: Arbitrary code execution (CWE-94) With human intervention!

Slide 22

Slide 22 text

Challenge 3: ChatGPT Can’t Explain the Answers

Slide 23

Slide 23 text

Take-Away Messages: - Generative AI will transform SE. - However, it still can’t generate high-quality, secure, explainable code. - Generative AI should be used as an assistant tool, but not to replace software engineers. Learn more http://chakkrit.com/