SlideShare a Scribd company logo
https://mvc.tw
歡迎參加我們的每週四固定聚會
1
twMVC #51
《GitHub Copilot 徹底改變開發模式,
探索 AI 驅動的智慧程式碼協作》
GitHub Copilot 徹底改變開發
模式,探索 AI 驅動的智慧程
式碼協作
AnYun Liao
黯雲 AnYun Liao
資深雲端技術顧問
「黯雲端記事錄」部落格(https://dotblogs.com.tw/anyun)
作者,主要分享關於開發以及 Azure 相關的主題,有多張微
軟 Azure 和 AI 相關證照,擅長微軟解決方案的開發技術和
Microsoft Azure 關於成本管理、AI 服務等議題。
講師資訊
講師資訊
• 黯雲端記事錄 (https://dotblogs.com.tw/anyun)
• 黯雲端記事錄 (https://www.facebook.com/AnYunCloudNote)
• GitHub (https://github.com/anyun)
CONTENTS
GitHub Copilot 基本介紹 01
GitHub Copilot 基本用法 02
GitHub Copilot Enterprise 03
GitHub Copilot 基本介紹
GitHub Copilot 基本介紹
• Your AI pair programmer
• Pair programming
OpenAI 模型
網路上的文字
和公開的程式碼
GitHub 專用程式碼
提供文字編輯
提供建議
改善建議
GitHub Copilot 環境設定
Visual Studio Code Vim/Neovim
Visual Studio
• Visual Studio 2022 17.10 或
以上的版本內建套件
• Visual Studio 2022 17.8 ~
17.9 透過擴充功能安裝
• Visual Studio Code
Marketplace 安裝
• Vim 版本 9.0.0185
• Neovim 版本 0.6 或更高版
• Node.js 版本 18 或更高版本
GitHub Copilot 環境設定
JetBrains IDEs
• IntelliJ IDEA (Ultimate,
Community, Educational)
• Android Studio
• AppCode
• CLion
• Code With Me Guest
• DataGrip
• DataSpell
• GoLand
• JetBrains Client
• MPS
• PhpStorm
• PyCharm
(Professional,
Community,
Educational)
• Rider
• RubyMine
• RustRover
• WebStorm
Xcode
• Xcode 版本 8.0 或更高版本以及
macOS Monterey (12.0)
GitHub Copilot 基本介紹
46%
的新程式碼現在
由 AI 撰寫
55%
整體開發人員生
產力快了
74%
的開發人員覺得
可更專注在帶來
滿足感的工作
twMVC#51-GitHub Copilot 徹底改變開發模式,探索 AI 驅動的智慧程式碼協作
• 自動產生程式
• 書本上有的
• 書本上沒有的
• 產生數個建議的程式碼
• 轉換程式碼語言
• 轉換成指令
• 轉換成文件
• Oracle SQL to T-SQL
• 根據公司的Coding style生成程式碼
• 使用不同版本的SDK, 來生成程式碼
• 根據API文件產生代碼
• 產生韌體代碼與Makefile
• Reference Code
生成程式碼 測試程式碼
測試程式碼
• 生成測試程式碼
• 提升測試覆蓋度
• 提升測試複雜度
• Test-Driven
Development (TDD)
優化程式碼
• 解釋程式碼行為
• 解釋看不懂的程式碼
• 生成註解文件
• 加入除錯的資訊
• 檢查程式碼錯誤
• 優化或重構程式碼
• SQL效能調教
• 程式碼分檔
• 檢查程式碼安全性
• XSS (Cross-Site Scripting)
• CSRF (Cross-Site Request
Forgery)
• SQL Injection
• 檢查Memory Leak and
Segment fault
• 時間複雜度與空間複雜度
其他
其他
• Docker與K8S語法
• Terraform
• ARM (Azure Resource
Management), Bicep
• Azure Pipeline
• 快速學習各種技術內容
• ABAP開發 (SAP)
• HTML開發
• Databricks開發
• 跟AI對話
您的編輯器中體驗類似 ChatGPT 的 GitHub Copilot Chat 模式
提取要求摘要 Pull Request Summaries (GitHub.com)
自訂至程式碼基底的聊天 Chat Customized to Your Codebase (GitHub.com)
網頁版 GitHub Copilot (GitHub.com)
程式碼檢閱 Code Review
透過 GitHub Cli 來使用 GitHub Copilot
GitHub Copilot Chat in
GitHub Mobile
GitHub Copilot
Extensions
Copilot Extensions
• 支援的模型
• Anthropic Claude 3.5 Sonnet
• Google Gemini 1.5 Pro (尚未正式推出)
• OpenAI o1-preview
• 需從 Copilot Policy 去啟用
支援多種模型
• 程式碼參考可以在產生程式碼建議時候提示有使用到 Public Code
• 目前僅支援 VS Code
• 底層透過 Azure AI Content Safety
程式碼參考 Code referencing
• Azure AI Content Safety
• 程式碼的受(版權)
保護素材偵測
• 資料只到 2021 年
11 月 6 日以前的程
式碼
程式碼參考 Code referencing
GitHub Copilot 基本介紹
GitHub Copilot 基本用法
GitHub Copilot 基本用法 : Agent Command
@terminal
@vscode
@workspace
@AGENT
協助處理終端命令及其運作
提供使用 VS Code 的技巧
與功能建議
工作區中的程式碼內容
新增程式碼註解
GitHub Copilot 基本用法 : Slash Command
/explain
/tests
/fix
/doc
/help
說明程式碼
為選取的程式碼產生單元測試
建議修正所選程式碼中的問題
新增程式碼註解
取得 GitHub Copilot 的聊天協助
GitHub Copilot 基本用法 : Hash Command
#editor
#file
#selection
#terminalSelection
#terminalLastCommand
使用中編輯器中的目前內容
指定檔案內容
選取的內容
終端中選取的內容
使用中終端的最後一個執行命令
GitHub Copilot 基本用法
快速鍵 (VS Code / VS)
• Ctrl+I / Alt+/:inline Chat
• Alt+[ / Alt+,:上一個建議
• Alt+] / Alt+.:下一個建議
• Tab:接受建議
• Ctrl+Enter:Suggestions Panel (僅 Vs Code 有)
• Configuring GitHub Copilot in your environment
DEMO
GitHub Copilot Enterprise
GitHub Copilot Enterprise : 功能比較 GitHub Copilot Enterprise 簡介
功能 Enterprise Business Individual
提取要求內的共同聊天
Lives on Github.com
直接插入編輯器
提取要求摘要
Copilot 文件集管理
Copilot 程式碼檢閱
程式碼片段和使用方式遙測的零資料保留
組織範圍的原則管理
與安全性工具整合 有限
稽核記錄和報告 有限
透過自我簽署憑證支援 VPN Proxy
使用文件集的文件搜尋和摘要
Documentation Search and Summaries Using Docsets
Copilot Enterprise
Mixed Licensing
可以更靈活地混合選擇
• Copilot Business
• Copilot Enterprise
個人化的 fine-tuned models
Creating a custom model for GitHub Copilot
如果您需要更精確的企業內部程 式碼
建議,可以選擇fine-tune model, 客
製化自己的Copilot
• 顯示更多相關和量身定製的代碼建議
• 開發人員可以更快地編寫代碼,減少錯誤
• 程式碼的參考、建模、託管和推論均屬企
業自己的
• 程式碼建議基於訓練出來的模型
Bonus
個人化的 fine-tuned models
GitHub Next | Copilot Workspace
Try out OpenAI o1 in GitHub Copilot and Models
GitHub Spark
GitHub copilot code completion in Xcode
• Introducing GitHub Copilot for Azure: Your Cloud Coding Companion in
VS Code!
• https://techcommunity.microsoft.com/t5/microsoft-developer-
community/introducing-github-copilot-for-azure-your-cloud-coding-
companion/ba-p/4127644
• https://techcommunity.microsoft.com/t5/microsoft-developer-
community/github-copilot-for-azure-6-must-try-features/ba-p/4283126
GitHub Copilot for Azure
• 開啟使用自定義指示詞功能
• 在專案資料夾底下加入 .github/copilot-instructions.md
• Custom instructions for GitHub Copilot in VS Code
自定義指示詞
自定義指示詞
• AI 是否會取代開發人員?
• 最終佈署程式還是得人做最後的決定 (負責任的 AI – 當責)
• 開發人員仍然需要會開發技能,但 Junior 跟 Senior 定義跟界線
模糊
• AI 世代開發人員需要的技能?
• 基本功 (物件導向、設計模式等) 仍須紮實
• 溝通的能力 (會說人話)
小結
FAQ

More Related Content

More from twMVC (20)

PDF
twMVC#51 以平台工程重新思考系統設計 - 以 Batch System 為例封面
twMVC
 
PDF
twMVC#50 微服務上線後的救贖
twMVC
 
PDF
twMVC 47_Elastic APM 的兩三事
twMVC
 
PDF
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
 
PDF
.NET 7 家族新成員: Microsoft Orleans v7
twMVC
 
PDF
twMVC#46 一探 C# 11 與 .NET 7 的神奇
twMVC
 
PDF
twMVC#44 如何測試與保護你的 web application with playwright
twMVC
 
PDF
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
PDF
twMVC#43 Visual Studio 2022 新功能拆解
twMVC
 
PDF
twMVC#43 YARP
twMVC
 
PDF
twMVC#43 C#10 新功能介紹
twMVC
 
PDF
twMVC#42 Azure DevOps Service Pipeline設計與非正常應用
twMVC
 
PDF
twMVC#42 Azure IoT Hub for Smart Factory
twMVC
 
PDF
twMVC#42 Windows容器導入由0到1
twMVC
 
PDF
twMVC#42 讓我們用一種方式來開發吧
twMVC
 
PDF
twMVC#41 hololens2 MR
twMVC
 
PPTX
twMVC#41 The journey of source generator
twMVC
 
PDF
twMVC#38 How we migrate tfs to git(using azure dev ops)
twMVC
 
PDF
twMVC#36C#的美麗與哀愁
twMVC
 
PDF
twMVC#36.NetCore 3快速看一波
twMVC
 
twMVC#51 以平台工程重新思考系統設計 - 以 Batch System 為例封面
twMVC
 
twMVC#50 微服務上線後的救贖
twMVC
 
twMVC 47_Elastic APM 的兩三事
twMVC
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
 
.NET 7 家族新成員: Microsoft Orleans v7
twMVC
 
twMVC#46 一探 C# 11 與 .NET 7 的神奇
twMVC
 
twMVC#44 如何測試與保護你的 web application with playwright
twMVC
 
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
twMVC#43 Visual Studio 2022 新功能拆解
twMVC
 
twMVC#43 YARP
twMVC
 
twMVC#43 C#10 新功能介紹
twMVC
 
twMVC#42 Azure DevOps Service Pipeline設計與非正常應用
twMVC
 
twMVC#42 Azure IoT Hub for Smart Factory
twMVC
 
twMVC#42 Windows容器導入由0到1
twMVC
 
twMVC#42 讓我們用一種方式來開發吧
twMVC
 
twMVC#41 hololens2 MR
twMVC
 
twMVC#41 The journey of source generator
twMVC
 
twMVC#38 How we migrate tfs to git(using azure dev ops)
twMVC
 
twMVC#36C#的美麗與哀愁
twMVC
 
twMVC#36.NetCore 3快速看一波
twMVC
 

twMVC#51-GitHub Copilot 徹底改變開發模式,探索 AI 驅動的智慧程式碼協作