Leveraging AI for Software Developer Productivity.pptx

petabridge 270 views 16 slides Jun 27, 2024
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

Supercharge your software development productivity with our latest webinar! Discover the powerful capabilities of AI tools like GitHub Copilot and ChatGPT 4.X. We'll show you how these tools can automate tedious tasks, generate complete syntax, and enhance code documentation and debugging.

In t...


Slide Content

Leveraging AI for Software Developer Productivity Beyond Auto-Complete

Tools We’ll Use GitHub Copilot: auto-complete inside IDE ChatGPT 4.X: most of our productivity comes from here

Table of Contents CoPilot – Automating Toil ChatGPT: Generating Complete Syntax GitHub Actions Shell Scripts Roslyn Analyzers Chat GPT: Documenting & Understanding Code Debugging Mermaid Diagrams Code Analysis

CoPilot: Automating Tedium Prompting functionality is super limited, not easy to iterate Convenient – don’t have to leave IDE Great at generating highly repetitive, formula driven code Unit Tests, Message Types, Etc Great at generating simple, self-contained formulas “Generate a function that will group all TimeSpans into 10 second intervals”

CoPilot Demo Fleshing out a test suite

ChatGPT: Generating GitHub Actions Prompt: “Please update this GitHub Actions script such that whenever we're running on `ubuntu-latest`, only execute `dotnet test` using `net8.0` as the framework. For Windows we shouldn't specify a framework version - we want it to test under all frameworks specified in the project files. ``` yaml … ```”

ChatGPT: Source Generation Reminders ChatGPT can get obvious things wrong ChatGPT can get subtle things wrong: i.e. Lexical equality vs. symbolic equality in Roslyn Analyzers

ChatGPT: Generating GitHub Actions - name: "dotnet build" run: dotnet build -c Release - name: "dotnet test" run: | if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then dotnet test -c Release --framework net8.0 else dotnet test -c Release fi - name: "dotnet pack" run: dotnet pack -c Release

ChatGPT: Shell Scripts Prompt: “Can you convert this MS-DOS script into bash? ``` @echo off REM launches local SQL Server dependency so we can run from Visual Studio REM Step 0: Build the project echo Building the project in release configuration... dotnet build -c Release if errorlevel 1 ( echo "Failed to build the solution - aborting" exit /b -1 ) … ```”

ChatGPT: Shell Scripts #!/bin/bash # Launches local SQL Server dependency so we can run from Visual Studio # Step 0: Build the project echo "Building the project in release configuration..." dotnet build -c Release if [ $? -ne 0 ]; then echo "Failed to build the solution - aborting" exit 1 fi …

ChatGPT: Roslyn Analyzers Prompt: I am looking to write a Roslyn Analyzer to detect when Akka.NET users are accidentally handling automatically handled messages inside their ` Akka.Cluster.Sharding.IMessageExtractor ` implementations. Here's an example: ``` csharp public sealed class ShardMessageExtractor : HashCodeMessageExtractor // implements ` IMessageExtractor ` { … } ```

ChatGPT: Debugging Prompt: “This test passed with the old implementation of ` ByteString `, but under the new implementation we get the following error every time: ```text Xunit.Sdk.XunitException Expected task.Result to be a collection with 3 item(s), but {, fo , , h, llo world}" "contains 2 item(s) more than" "{, foo, hello world}. ``` What do we need to do to fix the ` DelimiterFramingStage ` in order to get this test to pass?”

ChatGPT: Diagramming Code Prompt: “I have a fairly complicated Akka.NET actor base class for handling TCP connections (abstraction on top of it use both inbound and outbound implementations) - can you please generate a mermaidjs diagram of the connection handling lifecycle of this ` TcpConnection actor? ``` csharp … ```”

ChatGPT: Diagramming Code

ChatGPT : Refactoring Prompt: “I have the following C# function that performs little endian decoding using an ` IEnumerable <byte>` and an `int length` field, which specifies how many bytes the "length field" occupies. The length field can be 1,2,3, or 4 bytes long. Instead of using an ` IEnumerable <byte>`, rewrite this function to use a ` ReadOnlyMemory <byte>` instead”

ChatGPT: Code Analysis Prompt: “It seems like there's lots of different pieces of state all being tracked in a somewhat hapazard way inside this actor - what are the key pieces of state being used throughout?” Prompt 2: “What would a simpler ` PendingSimpleWritesQueue ` implementation look like?”