How I Learned to Stop Worrying and Love AI-Assisted Coding Tools

A presentation at The Shift Summit in September 2023 in Malmö, Sweden by Petyo Dimitrov

Slide 1

Slide 1

H OW I L EARNED TO S TOP WORRYING A ND LOVE A I-ASSISTED C ODING TOOLS Pe ty o D imitr o v 30th September 2023

Slide 2

Slide 2

About me • 16 years in Software Engineering • Senior Software Architect for Musala Soft / Qinshift • PhD in Computer Science from Technical University Sofia • Lector of course Distributed Systems in Technical University Sofia

Slide 3

Slide 3

Agenda • Initial interest • Reviewed AI-assisted tools • How I use Copilot(X)? • How I use ChatGPT? • How Musala uses AI-assisted tools? • Recent developments • Q&A

Slide 4

Slide 4

Prior to 2021

Slide 5

Slide 5

2022 Copilot initial tests

Slide 6

Slide 6

2023.03 - GPT 4 2022.11 - ChatGPT 2022.03 - GPT 3.5 2021.10 - GitHub Copilot 2021.08 - Codex 2020.06 - GPT-3 (175B) 2019.02 - GPT-2 (1.5B) 2018.02 - GPT-1 (0.1B) 2017 - Transformer with Attention

Slide 7

Slide 7

HackerRank challenge (1)

Slide 8

Slide 8

HackerRank challenge (2) A = 4, K = 5, P = 1

Slide 9

Slide 9

How we are introducing it in Musala 1. 2. 3. 4. 5. 6. 7. 8. Research & pick most promising candidate tools Define questionnaire to assess results Run 1-month trial & collect feedback Research protection mechanisms Identify suitable projects Prepare a list of recommended prompts Require a disclaimer in PR when AI is used Conduct demonstrations and talks to encourage adoption

Slide 10

Slide 10

Reviewed tools GitHub Copilot Codeium AWS CodeWhisperer ChatGPT

Slide 11

Slide 11

How I use Copilot?

Slide 12

Slide 12

Slide 13

Slide 13

Slide 14

Slide 14

Slide 15

Slide 15

Weaker features of Copilot • Inline fixing • Code translation • Refactoring

Slide 16

Slide 16

How I use ChatGPT?

Slide 17

Slide 17

For inspiration

Slide 18

Slide 18

As a Rubber ducky

Slide 19

Slide 19

Writing code in “second” languages

Slide 20

Slide 20

Analyze REST APIs (1)

Slide 21

Slide 21

Analyze REST APIs (2)

Slide 22

Slide 22

Analyze REST APIs (3)

Slide 23

Slide 23

Advanced Data Analysis (1) Display the difference between Main and CountryX and CountryY for the different code types. The numerical values are the number of lines of code.

Slide 24

Slide 24

Advanced Data Analysis (2)

Slide 25

Slide 25

Create diagrams

Slide 26

Slide 26

Generating presentations Generate Python code for creating a PowerPoint presentation on the topic “Basic Python syntax and data types”. Fill in the details with your knowledge. I need 7 slides. Run the code and return the resulting presentation.

Slide 27

Slide 27

Generating presentations

Slide 28

Slide 28

Prompt engineering - Examples or reference

Slide 29

Slide 29

Prompt engineering - Adopt a persona & style Custom Instructions / Roles

Slide 30

Slide 30

Prompt engineering - Step by step

Slide 31

Slide 31

Prompt engineering - Ask questions

Slide 32

Slide 32

Prompt engineering - Reflection

Slide 33

Slide 33

Prompt engineering - Delimiters

Slide 34

Slide 34

Prompt engineering - Periodic summary*

Slide 35

Slide 35

Effects on productivity ~ +5-10%

Slide 36

Slide 36

Musala AI-related projects • Commercial: Retrieval-Augmented Generation (RAG) • Internal: Summarization (interview) • Internal: Code review (practical tasks) • Approach: • ChatBot • API • Local model*

Slide 37

Slide 37

Risks - Devs • Verbose interactions • Hallucinations • Overreliance on the machine

Slide 38

Slide 38

Risks - Data • Leaking proprietary data • Intellectual Property • Siloed solutions by large vendors

Slide 39

Slide 39

Risks - EU AI Act Banned High Limited Low Social credit, realtime biometric Critical, education, law, employment Chatbots, image processing Spam filters, computer games

Slide 40

Slide 40

Latest news November – AWS Gen AI November – 365 Copilot AI Assistant September – Minstral September – ChatGPT Voice & Images September – Copilot Chat* August – Enterprise ChatGPT August – Code Llama (Instruct, Python) July – Llama2 July – Claude2 July – ChatGPT Code Interpreter

Slide 41

Slide 41

Conclusion • A new tool at our disposal like Google & StackOverflow • Only as an assistant • Juniors, Mediors and Seniors benefit differently • Copilot’s advantage is seamless IDE integration • ChatGPT helps with a wider variety of tasks • There are risks & challenges ahead

Slide 42

Slide 42

Slide 43

Slide 43

Questions

Slide 44

Slide 44

Thanks! www.linkedin.com/in/ petyo-dimitrov petyo.dimitrov@musala.com petyo.dimitrov@gmail.com