์ฐธ๊ณ ํญ๋ชฉ
์ด ๋ฌธ์์ ํ์๋ ์๋ต์ ์์ ์ ๋๋ค. Copilot Chat ์๋ต์ ๋น๊ฒฐ์ ์ ์ด๋ฏ๋ก ์ฌ๊ธฐ์ ํ์๋ ์๋ต๊ณผ ๋ค๋ฅธ ์๋ต์ ์ป์ ์ ์์ต๋๋ค.
๋ ๊ฑฐ์ ์ฝ๋๋ ์์กฐ ๊ฐ๋ฐ์๊ฐ ๋ ์ด์ ์ง์ํ์ง ์๋ ์ค๋๋ ์ฝ๋๋ฅผ ์๋ฏธํฉ๋๋ค. ์ผ๊ด๋ ๋ช ๋ช ๊ท์น์ ์ฌ์ฉํ๊ฑฐ๋ ๋ช ํํ ๋ฌธ์๋ฅผ ์์ฑํ๋ ๋ฑ์ ์ต์ ๋ชจ๋ฒ ์ฌ๋ก๋ฅผ ๋ฐ๋ฅด์ง ์์ ์ ์์ผ๋ฏ๋ก ์ ์ง ๊ด๋ฆฌ ๋ฐ ํ์ฅ์ด ์ด๋ ค์ธ ์ ์์ต๋๋ค.
๋ ๊ฑฐ์ ์ฝ๋๋ฅผ ํ๋ํํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ง์์ ๋ฐ์ ์ ์์ต๋๋ค.
- ์ฑ๋ฅ ๋ฐ ํ์ฅ์ฑ์ ๊ฐ์ ํฉ๋๋ค.
- ์ฝ๋๋ฅผ ๋ ์ฝ๊ฒ ์ ์ง ๊ด๋ฆฌํ๊ณ ํ์ฅํ ์ ์์ต๋๋ค.
- ๋ณ๊ฒฝ ์์ ์ ์ํํ ๋ ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ ์ํ์ ์ค์ ๋๋ค.
- ์ฝ๋๋ฅผ ํ ์คํธํ๊ธฐ ์ฝ๊ฒ ๋ง๋ญ๋๋ค.
Copilot์ ๋ค์์ ํตํด ๋ ๊ฑฐ์ ์ฝ๋๋ฅผ ํ๋ํํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
- ์ต์ ๋ชจ๋ฒ ์ฌ๋ก๋ฅผ ๋ฐ๋ฅด๋๋ก ์ฝ๋๋ฅผ ๋ฆฌํฉํฐ๋งํ๊ธฐ ์ํ ์ ์์ ์ ๊ณตํฉ๋๋ค.
- ์ฝ๋ ์๋ ๋ฐฉ์์ ์ดํดํ๋ ๋ฐ ๋์์ด ๋๋ ๋ฌธ์๋ฅผ ์์ฑํฉ๋๋ค.
- ๋ณ๊ฒฝ ์์ ์ ์ํํ ๋ ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ์ง ์์๋์ง ํ์ธํ๋ ๋ฐ ๋์์ด ๋๋ ํ ์คํธ๋ฅผ ์์ฑํฉ๋๋ค.
์์ ์๋๋ฆฌ์ค
์ด ์์ ์์๋ COBOL๋ก ์์ฑ๋ ๊ณ์ ๊ด๋ฆฌ ์์คํ
์ ์ดํด๋ณด๊ณ ์ด๋ฅผ Node.js๋ก ํ๋ํํฉ๋๋ค. COBOL ์ฝ๋๋ modernize-legacy-cobol-app
๋ฆฌํฌ์งํ ๋ฆฌ์์ ์ฐพ์ ์ ์์ต๋๋ค.
๊ณ์ ๊ด๋ฆฌ ์์คํ ์ ๋ค์ ์ธ ๊ฐ์ง ํค ํ์ผ๋ก ๊ตฌ์ฑ๋ฉ๋๋ค.
main.cob
: ์ฌ์ฉ์๋ก๋ถํฐ ์ ๋ ฅ์ ๋ฐ์ ์ ์ ํ ํ์ ํ๋ก๊ทธ๋จ์ ํธ์ถํ๋ ์ฃผ์ ํ๋ก๊ทธ๋จ์ ๋๋ค.operations.cob
: ์ ์ฉ, ์ง๋ถ, ์์ก ๋ณด๊ธฐ์ ๊ฐ์ ๊ณ์ ๋ฐ์ดํฐ์ ๋ํ ์์ ์ ์ํํ๋ ํ์ ํ๋ก๊ทธ๋จ์ ๋๋ค.data.cob
: ๊ณ์ ์์ก์ ์คํ ๋ฆฌ์ง๋ฅผ ๊ด๋ฆฌํ๋ ํ์ ํ๋ก๊ทธ๋จ์ ๋๋ค.
1๋จ๊ณ: ๋ฆฌํฌ์งํ ๋ฆฌ์ ๋ก์ปฌ ๋ณต์ฌ๋ณธ ๊ฐ์ ธ์ค๊ธฐ
ํ๋ก๊ทธ๋จ์ ์ปดํ์ผํ๊ณ ์คํํ๊ธฐ ์ ์ ์ฝ๋๋ฅผ ๋ก์ปฌ์ ๋์ด์ผ ํฉ๋๋ค. ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์์ง ๋ณต์ ํ์ง ์์ ๊ฒฝ์ฐ ํ๋ก์ ํธ๋ฅผ ์ ์ฅํ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋ํ์ฌ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
git clone https://github.com/continuous-copilot/modernize-legacy-cobol-app.git
git clone https://github.com/continuous-copilot/modernize-legacy-cobol-app.git
2๋จ๊ณ: ํ๋ก๊ทธ๋จ ์ปดํ์ผ ๋ฐ ์คํ
์ ํธํ๋ ๊ฐ๋ฐ ํ๊ฒฝ(์: ์คํ ์์ค GnuCOBOL ์ปดํ์ผ๋ฌ)์ COBOL ์ปดํ์ผ๋ฌ๋ฅผ ์ค์นํ๊ฑฐ๋ GitHub Codespaces์ Copilot Chat์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
MacOS๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ Homebrew๋ฅผ ์ฌ์ฉํ์ฌ GnuCOBOL์ ์ค์นํ ์ ์์ต๋๋ค.
brew install gnu-cobol
brew install gnu-cobol
Codespaces๋ Ubuntu Linux ์์คํ
์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ apt
๋ฅผ ์ฌ์ฉํ์ฌ GnuCOBOL์ ์ค์นํ ์ ์์ต๋๋ค.
sudo apt-get update && \ sudo apt-get install gnucobol
sudo apt-get update && \
sudo apt-get install gnucobol
์ฝ๋๋ฅผ ์ปดํ์ผํ๊ณ , ํ์ผ์ ์ฐ๊ฒฐํ๊ณ , ์คํ ํ์ผ์ ๋ง๋ค๋ ค๋ฉด ๋ฆฌํฌ์งํ ๋ฆฌ ๋ฃจํธ์์ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
cobc -x main.cob operations.cob data.cob -o accountsystem
cobc -x main.cob operations.cob data.cob -o accountsystem
ํ๋ก๊ทธ๋จ์ ์คํํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ์ธ์.
./accountsystem
./accountsystem
3๋จ๊ณ: ํ์ผ ๋ฐ ์ฝ๋ ์ค๋ช
์ฝ๋๋ฅผ ํ๋ํํ๋ ์ฒซ ๋ฒ์งธ ๋จ๊ณ๋ ์ฝ๋์ ์๋ ๋ฐฉ์์ ์ดํดํ๋ ๊ฒ์ ๋๋ค. Copilot Chat์ ๊ฐ ํ์ผ์ ์ฝ๋๋ฅผ ์ค๋ช ํด ๋ฌ๋ผ๊ณ ์์ฒญํ ์ ์์ต๋๋ค.
IDE์์ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์ฐ ๋ค์, Copilot Chat ํจ๋์ ๋ค์ ํ๋กฌํํธ๋ฅผ ์ ๋ ฅํฉ๋๋ค.
์์ ํ๋กฌํํธ 1
/explain #file:main.cob #file:operations.cob #file:data.cob Can you please create a high level overview of the app. It will be great if you can explain each file in detail and how they are linked.
์์ ์๋ต 1
์์ ํ๋กฌํํธ์ ๋ํ ์๋ต์์ ๋ฐ์ทํ ๋ด์ฉ์ ๋๋ค.
Sure! Here's a high-level overview of the COBOL application, along with detailed explanations of each file and how they are linked together.
High-Level Overview
This COBOL application simulates an account management system. It allows users to view the current balance, credit the account, debit the account, and exit the application. The application is divided into three main COBOL source files: main.cob, operations.cob, and data.cob. ...
4๋จ๊ณ: ํ์ผ ๊ฐ์ ๋ฐ์ดํฐ ํ๋ฆ ์ฐจํธ
๋ค์ ๋จ๊ณ๋ ํ์ผ์ด ์ด๋ป๊ฒ ์ฐ๊ฒฐ๋์ด ์๋์ง ์ดํดํ๋ ๊ฒ์
๋๋ค. @workspace
๋ฅผ ์ฌ์ฉํ์ฌ ์ ํ๋ฆฌ์ผ์ด์
์ ๋ฐ์ดํฐ ํ๋ฆ ๋ค์ด์ด๊ทธ๋จ์ ๋ง๋ค ์ ์์ต๋๋ค.
์ฐธ๊ณ ํญ๋ชฉ
VS Code ๋ฐ Visual Studio์ ์ฑํ
์ฐธ๊ฐ์๋ @workspace
Copilot์๊ฒ ์์
์์ญ์ ๋ชจ๋ ์ฝ๋์ ๋ํ ์ปจํ
์คํธ๋ฅผ ์ ๊ณตํฉ๋๋ค. Copilot๊ฐ ํ๋ก์ ํธ์ ๊ตฌ์กฐ, ์ฝ๋์ ์ฌ๋ฌ ๋ถ๋ถ์ด ์ํธ ์์ฉ์ ํ๋ ๋ฐฉ์์ ๊ณ ๋ คํ๋๋ก ํ๋ ค๋ฉด @workspace
๋ฅผ ์ฌ์ฉํ์ธ์. JetBrains IDE๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ @workspace
๋์ @project
๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์์ ํ๋กฌํํธ 2
@workspace can you create a sequence diagram of the app showing the data flow of the app. Please create this in mermaid format so that I can render this in a markdown file.
Copilot์ ์ ํ๋ฆฌ์ผ์ด์ ์ ์๋ ๋ฐฉ์์ ๋ณด์ฌ ์ฃผ๋ ์ ์ฒด ์ํ์ค ๋ค์ด์ด๊ทธ๋จ์ ๋ํ Mermaid ๋งํฌ์ ์ ์ถ๋ ฅํฉ๋๋ค. ์ด ๋งํฌ์ ์ ๋ณต์ฌํ์ฌ Mermaid ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ถ์ฌ๋ฃ์ด ๋ค์ด์ด๊ทธ๋จ์ ์์ฑํ ์ ์์ต๋๋ค.
5๋จ๊ณ: ํ ์คํธ ๊ณํ ์์ฑ
๋ณ๊ฒฝ ์์
์ ์ํํ ํ, ์ ํ๋ฆฌ์ผ์ด์
์ด ์์๋๋ก ์๋ํ๋์ง ํ์ธํ๊ธฐ ์ํด ํ
์คํธ ๊ณํ์ ์๋ฆฝํ์ธ์. @workspace
๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ก์ ํธ์ ๋ชจ๋ ํ์ผ์ ๋ค๋ฃจ๋ ํ
์คํธ ๊ณํ์ ์์ฑํ ์ ์์ต๋๋ค.
์์ ํ๋กฌํํธ 3
@workspace The current Cobol app has no tests. Can you please create a test plan of current business logic that I can use to validate with business stakeholders about the current implementation.
Later I would like to use this test plan to create unit and integration tests in a node.js app. I am in the middle of transforming the current Cobol app to a node.js app.
The test plan should include the following:
1. Test Case ID
2. Test Case Description
3. Pre-conditions
4. Test Steps
5. Expected Result
6. Actual Result
7. Status (Pass/Fail)
8. Comments
Please create the test plan in a markdown table format. The test plan should cover all the business logic in the current Cobol app.
Convert this to markdown syntax to insert as a new file
Copilot์ ์ ํ๋ฆฌ์ผ์ด์
์ ์ ํจ์ฑ์ ๊ฒ์ฌํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ Markdown ํ์์ ํ
์คํธ ๊ณํ์ ์ถ๋ ฅํฉ๋๋ค. ์ด ๊ณํ์ ๋์ค์ ํ๋ก์ธ์ค์์ ์ฌ์ฉํ๋ ค๋ฉด TESTPLAN.md
์ด๋ผ๋ ํ์ผ์ ๋ง๋ค๊ณ ์ ์๋ ๊ณํ์ ์ฌ๊ธฐ์ ๋ณต์ฌํ์ธ์. ์ด๋ ๊ฒ ํ๋ฉด ๋ค์ ๋จ๊ณ์์ ํ
์คํธ ์ฌ๋ก๋ฅผ ์์ฑํ ๋ ํ
์คํธ ๊ณํ์ ์ฐธ์กฐํ ์ ์์ต๋๋ค.
6๋จ๊ณ: ํ์ผ์ COBOL์์ Node.js๋ก ๋ณํ
๋ค์ ๋จ๊ณ๋ COBOL ํ์ผ์ Node.js๋ก ๋ณํํ๋ ๊ฒ์ ๋๋ค. ๋ค์๊ณผ ๊ฐ์ ํ๋กฌํํธ ์์ฑ ๋ฐฉ๋ฒ์ ์ผ๋์ ๋๋ ๊ฒ์ด ์ค์ํฉ๋๋ค.
- ์ปจํ ์คํธ ์ ๊ณต
- ๋ช ํํ ์ง์นจ ์ ๊ณต
- ๋ฌ์ฑํ๊ณ ์ ํ๋ ๊ฒฐ๊ณผ์ ๋ํ ๊ตฌ์ฒด์ ์ผ๋ก ์ค๋ช
ํ๋ก์ ํธ ๋ด์ ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ๋ง๋ค๊ณ , ์ฌ๊ธฐ์ ๋ง๋ค๋ ค๋ JavaScript ํ์ผ์ ์ ์ฅํ์ธ์.
mkdir temp-JS-project-directory
mkdir temp-JS-project-directory
๊ทธ๋ฐ ๋ค์, ๋ฐ๋ณต์ ์ผ๋ก COBOL ํ์ผ์ Node.js๋ก ๋ณํํฉ๋๋ค.
์์ ํ๋กฌํํธ 4
Can you convert code in #file:main.cob to node.js?
์์ ์๋ต 4
Sure! Here is the equivalent Node.js code for the main.cob file. This code will simulate the same account management system functionality.
### COBOL Code:
main.cob
```COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. MainProgram.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CONTINUE-FLAG PIC X VALUE 'Y'.
01 USER-CHOICE PIC 9.
01 FINAL-BALANCE PIC 9(6)V99 VALUE 1000.00.
PROCEDURE DIVISION.
PERFORM UNTIL CONTINUE-FLAG = 'N'
DISPLAY "1. View Balance"
DISPLAY "2. Credit Account"
DISPLAY "3. Debit Account"
DISPLAY "4. Exit"
ACCEPT USER-CHOICE
EVALUATE USER-CHOICE
WHEN 1
CALL 'Operations' USING 'TOTAL'
WHEN 2
CALL 'Operations' USING 'CREDIT'
WHEN 3
CALL 'Operations' USING 'DEBIT'
WHEN 4
MOVE 'N' TO CONTINUE-FLAG
DISPLAY "Exiting the program. Goodbye!"
WHEN OTHER
DISPLAY "Invalid choice. Please try again."
END-EVALUATE
END-PERFORM
STOP RUN.
### Node.js Code: `main.js`
```javascript
const readline = require('readline');
let continueFlag = 'Y';
let finalBalance = 1000.00;
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function displayMenu() {
console.log("1. View Balance");
console.log("2. Credit Account");
console.log("3. Debit Account");
console.log("4. Exit");
}
function handleUserChoice(choice) {
switch (choice) {
case '1':
viewBalance();
break;
case '2':
creditAccount();
break;
case '3':
debitAccount();
break;
case '4':
continueFlag = 'N';
console.log("Exiting the program. Goodbye!");
rl.close();
break;
default:
console.log("Invalid choice. Please try again.");
promptUser();
break;
}
}
function viewBalance() {
console.log(`Current balance: ${finalBalance.toFixed(2)}`);
promptUser();
}
function creditAccount() {
rl.question("Enter credit amount: ", (amount) => {
amount = parseFloat(amount);
if (!isNaN(amount) && amount > 0) {
finalBalance += amount;
console.log(`Amount credited. New balance: ${finalBalance.toFixed(2)}`);
} else {
console.log("Invalid amount. Please try again.");
}
promptUser();
});
}
function debitAccount() {
rl.question("Enter debit amount: ", (amount) => {
amount = parseFloat(amount);
if (!isNaN(amount) && amount > 0) {
if (finalBalance >= amount) {
finalBalance -= amount;
console.log(`Amount debited. New balance: ${finalBalance.toFixed(2)}`);
} else {
console.log("Insufficient funds for this debit.");
}
} else {
console.log("Invalid amount. Please try again.");
}
promptUser();
});
}
function promptUser() {
if (continueFlag === 'Y') {
displayMenu();
rl.question("Select an option: ", handleUserChoice);
}
}
promptUser();
This Node.js code replicates the functionality of the COBOL main.cob file, providing a simple command-line interface for viewing the balance, crediting the account, debiting the account, and exiting the application.
์ ์๋ ์ฝ๋๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ์ฒ ์ ํ ๊ฒํ ํด์ผ ํฉ๋๋ค. ์์ฑ๋ ์ฝ๋์ ๋ง์กฑํ๋ฉด ๋ค์ ๋จ๊ณ์ ๋ฐ๋ผ ์ฝ๋๋ฅผ ๋ก์ปฌ๋ก ์ ์ฅํ๊ณ ๋ณํ์ ์๋ฃํฉ๋๋ค.
- ์ด์ ์ ๋ง๋ ์์ ๋๋ ํฐ๋ฆฌ์
main.js
๋ผ๋ ์ ํ์ผ์ ๋ง๋ญ๋๋ค. - ์์ฑ๋ ์ฝ๋๋ฅผ Copilot Chat ํจ๋์์ ๋ณต์ฌํ์ฌ
main.js
์ ๋ถ์ฌ๋ฃ์ต๋๋ค. - ํ์ผ์ ์ ์ฅํฉ๋๋ค.
- ๋น์ทํ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ์ฌ
operations.cob
๋ฐdata.cob
์ Node.js๋ก ๋ณํํฉ๋๋ค. - ๋์ผํ ์์ ๋๋ ํ ๋ฆฌ์ ํด๋นํ๋ JavaScript ํ์ผ
operations.js
๋ฐdata.js
๋ฅผ ์์ฑํฉ๋๋ค. - ์์ฑ๋ ์ฝ๋๋ฅผ ๊ฐ ํ์ผ์ ๋ณต์ฌํ์ฌ ๋ถ์ฌ๋ฃ์ ๋ค์ ์ ์ฅํฉ๋๋ค.
7๋จ๊ณ: ํ์ผ์ ์ฐ๊ฒฐํ๊ณ Node.js ํ๋ก์ ํธ ์ค์
๋ชจ๋ ํ์ผ์ Node.js๋ก ๋ณํํ ํ์๋ ํ์ผ์ ์๋ก ์ฐ๊ฒฐํ๊ณ ์๋ํ๋ Node.js ํ๋ก์ ํธ๋ฅผ ์ค์ ํด์ผ ํฉ๋๋ค.
-
ํฐ๋ฏธ๋์ ์์ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋ํฉ๋๋ค.
-
๋ค์ ๋ช ๋ น์ ์คํํ์ฌ
package.json
ํ์ผ์ ๋ง๋ญ๋๋ค.Shell npm init -y
npm init -y
-
์ ํ๋ฆฌ์ผ์ด์ ์ ์ธ๋ถ ํจํค์ง๊ฐ ํ์ํ ๊ฒฝ์ฐ ๋ค์์ ์คํํ์ฌ ์ค์นํฉ๋๋ค.
Shell npm install
npm install
-
๋ค์์ ์คํํ์ฌ ์ฑ์ ์คํํฉ๋๋ค.
Shell npm start
npm start
์ด ์์ ์์ Node.js ์ ํ๋ฆฌ์ผ์ด์ ์ ์๋ COBOL ํ๋ก๊ทธ๋จ์ ๊ธฐ๋ฅ์ ์์ ํ ๋ณต์ ํ์ง ๋ชปํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, ์์ก์ด ์ฌ๋ฐ๋ฅด๊ฒ ์ ๋ฐ์ดํธ๋์ง ์๊ฑฐ๋ ๊ณ์ฐ์ด COBOL ๋ ผ๋ฆฌ์ ์ผ์นํ์ง ์์ ์ ์์ต๋๋ค.
์ ํ๋ฆฌ์ผ์ด์ ์ ๊ตฌ์ฒดํํ๋ ค๋ฉด ๋ค์์ ์ํํด์ผ ํฉ๋๋ค.
-
์๋ชป๋ ๋์์ ์๋ณํ๊ธฐ ์ํด ํ๋ก๊ทธ๋จ์ ์คํํ๊ณ COBOL ๋ฒ์ ๊ณผ ๋น๊ตํฉ๋๋ค.
-
Copilot์ ์ฌ์ฉํ์ฌ ๋ฐ๋ณต์ ์ผ๋ก ์์ ํ์ฌ Node.js ํ๋ก๊ทธ๋จ์ด ์์๋๋ก ๋์ํ ๋๊น์ง ๋ ผ๋ฆฌ๋ฅผ ์กฐ์ ํฉ๋๋ค.
-
๋์์ด ์ง์ ๋ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์๊ณผ ๊ฐ์ ์ฝ๋์ ํน์ ๋ถ๋ถ์ ๋๋ฒ๊น ํ๊ณ ๊ฐ์ ํฉ๋๋ค.
@workspace - analyze main.js and ensure account balance updates correctly when crediting an account.
๋ ๊ฑฐ์ ์ฝ๋ ๋ฆฌํฉํฐ๋ง์ด ํญ์ ํ ๋จ๊ณ ํ๋ก์ธ์ค์ธ ๊ฒ์ ์๋๋๋ค. Copilot์ ์ Node.js ๊ตฌํ์ ๊ตฌ์ฒดํํ ๋ ๊ธฐ๋ฅ์ ๋๋ฒ๊น ํ๊ณ ๊ฐ์ ํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
8๋จ๊ณ: ๋จ์ ๋ฐ ํตํฉ ํ ์คํธ ์์ฑ
๋ค์ ๋จ๊ณ๋ ๋จ์ ํ
์คํธ ๋ฐ ํตํฉ ํ
์คํธ๋ฅผ ์์ฑํ์ฌ ์ ํ๋ฆฌ์ผ์ด์
์ด ์์๋๋ก ์๋ํ๋์ง ํ์ธํ๋ ๊ฒ์
๋๋ค. @workspace
๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ก์ ํธ์ ๋ชจ๋ ํ์ผ์ ๋ค๋ฃจ๋ ํ
์คํธ ๊ณํ์ ์์ฑํ ์ ์์ต๋๋ค.
์์ ํ๋กฌํํธ 5
@workspace I would like to create unit and integration tests cases from the test plan mentioned in #file:TESTPLAN.md file The node.js code is in node-accounting-app folder and I am looking to generate tests for #file:operations.js file. Use a popular testing framework and also provide all the dependencies required to run the tests.
์์ ์๋ต 5
Copilot์ JavaScript ํ ์คํธ ํ๋ ์์ํฌ์ธ Jest์์ ์ฌ๋ฌ ํ ์คํธ๋ฅผ ์์ฑํ๋ฉฐ, ์ด๋ฅผ ๊ตฌํํ๊ณ ์คํํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์ ์ฒด ๋จ๊ณ๋ณ ๊ฐ์ด๋๋ฅผ ์ ๊ณตํฉ๋๋ค.
์์ ํ๋กฌํํธ์ ๋ํ ์๋ต์์ ๋ฐ์ทํ ๋ด์ฉ์ ๋๋ค.
โThis test plan covers the main functionalities of the COBOL application, including viewing the balance, crediting the account, debiting the account, and exiting the application. The test cases are implemented using Jest, a popular testing framework for Node.js. Validate this test plan with the business stakeholders to ensure it meets the business requirements. Once validated, you can use this plan to create corresponding unit tests and integration tests for the Node.js application.โ
9๋จ๊ณ: ํ ์คํธ ์คํ ๋ฐ ์ฝ๋ ๊ตฌ์ฒดํ
ํ ์คํธ ๊ณํ์ ์์ฑํ๊ณ ํ ์คํธ๋ฅผ ์์ฑํ ํ์๋ ํ ์คํธ ๊ณํ์ ์คํํ๊ณ ์คํจํ ํ ์คํธ๋ฅผ ์์ ํด์ผ ํฉ๋๋ค. ํ ์คํธ๋ ๋ฐ๋ณต์ ์ธ ํ๋ก์ธ์ค์ด๋ฏ๋ก ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ์ฝ๋๋ฅผ ์์ ํ ๋ค์, ๋ชจ๋ ๊ฒ์ด ํต๊ณผ๋ ๋๊น์ง ํ ์คํธ๋ฅผ ๋ค์ ์คํํด์ผ ํ ์ ์์ต๋๋ค.
ํ ์คํธ๊ฐ ์คํจํ๋ฉด Copilot์ ์ฌ์ฉํ์ฌ ๋๋ฒ๊น ์ ๋๊ณ ๊ตฌํ์ ๊ฐ์ ํฉ๋๋ค.
์์ ํ๋กฌํํธ 6
@workspace - analyze test failures in operations.test.js and suggest fixes to match the expected behavior.
๋ชจ๋ ํ ์คํธ๊ฐ ํต๊ณผํ๋๋ผ๋ ํ๋ก๊ทธ๋จ์๋ ์ฌ์ ํ ๋ฌธ์ ๊ฐ ์์ ์ ์์ต๋๋ค. ์๋ํ๋ ํ ์คํธ๊ฐ ๋๋ฝ๋ ๊ธฐ๋ฅ์ด๋ ๋ ผ๋ฆฌ ์ค๋ฅ๋ฅผ ํญ์ ํฌ์ฐฉํ์ง๋ ์์ผ๋ฏ๋ก ์ ํ๋ฆฌ์ผ์ด์ ์ด ์์๋๋ก ์๋ํ๋์ง ํ์ธํ๋ ค๋ฉด ์๋ ํ ์คํธ๊ฐ ํ์ํฉ๋๋ค.
10๋จ๊ณ: JavaScript ํ๋ก์ ํธ๋ฅผ ์ ์์น๋ก ์ด๋
์ ํ๋ฆฌ์ผ์ด์ ์ด ์์๋๋ก ์๋ํ๋ฉด ์ JavaScript ํ๋ก์ ํธ๋ฅผ COBOL ๋๋ ํฐ๋ฆฌ ๋ฐ์ผ๋ก ์ฎ๊ฒจ ๋ณ๋๋ก ์ ์งํฉ๋๋ค.
-
COBOL ํ๋ก์ ํธ์ ๋ถ๋ชจ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋ํฉ๋๋ค.
-
JavaScript ํ๋ก์ ํธ๋ฅผ ์ ์์น๋ก ์ด๋ํฉ๋๋ค.
Shell mv modernize-legacy-cobol-app new-js-project
mv modernize-legacy-cobol-app new-js-project
-
์ ํ๋ก์ ํธ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋ํ์ฌ ๋ชจ๋ ํญ๋ชฉ์ด ์ฌ๋ฐ๋ฅด๊ฒ ์คํ๋๋์ง ํ์ธํฉ๋๋ค.
Shell cd new-js-project npm start
cd new-js-project npm start
์ด์ ๋ฆฌํฉํฐ๋ง๋ Node.js ์ ํ๋ฆฌ์ผ์ด์ ์ ์๋ณธ COBOL ํ์ผ๊ณผ๋ ๋ณ๋๋ก ๋ถ๋ฆฌ๋ ์์ฒด ๋ ๋ฆฝ ์คํํ ํ๋ก์ ํธ ํด๋์ ์์ต๋๋ค.
๊ฒฐ๋ก
์ด ์์ ์์๋ COBOL๋ก ์์ฑ๋ ๊ณ์ ๊ด๋ฆฌ ์์คํ ์ ์ดํด๋ณด๊ณ Node.js๋ก ํ๋ํํ์ต๋๋ค. Copilot Chat์ ์ฌ์ฉํ์ฌ ์ฝ๋๋ฅผ ์ค๋ช ํ๊ณ , ๋ฐ์ดํฐ ํ๋ฆ์ ์ฐจํธ๋ก ํ์ํ๊ณ , ํ ์คํธ ๊ณํ์ ์์ฑํ๊ณ , ์ฝ๋๋ฅผ Node.js๋ก ๋ณํํ์ต๋๋ค. ์ด๋ฌํ ๋จ๊ณ๋ฅผ ์ํํ๋ฉด ๋ ๊ฑฐ์ ์ฝ๋๋ฅผ ํ๋ํํ๊ณ ๋ ์ฝ๊ฒ ์ ์ง ๊ด๋ฆฌ ๋ฐ ํ์ฅํ ์ ์์ต๋๋ค. ๋ ๊ฑฐ์ ์ฝ๋๋ฅผ ํ๋ํํ๊ธฐ ์ํ ๋ช ๊ฐ์ง ์ถ๊ฐ ํ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- ๋ชจ๋ฒ ์ฌ๋ก๋ฅผ ์ด๊ตฌํ๋ ๊ฒ์ด ํต์ฌ์ ๋๋ค. ํ๋กฌํํธ์ ํ์ง์ด Copilot์ ์ ์ ํ์ง์ ๊ฒฐ์ ํฉ๋๋ค. ๋ช ํํ ์ปจํ ์คํธ๋ฅผ ์ ๊ณตํ๊ณ , ๋ณต์กํ ์์ ์ ๋ ์์ ๋จ๊ณ๋ก ๋ถํ ํ๊ณ , ์์ ๋ฅผ ์ ์ํ๊ณ , Copilot์ด ๋ฌ์ฑํ๊ธฐ ์ํ ํน์ ๋ชฉํ๋ฅผ ์ ๊ณตํฉ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ์ํฌํ๋ก๊ฐ ๋ ์ํํด์ง๊ณ ๊ฒฐ๊ณผ๊ฐ ๋์ฑ ์ ํํด์ง๋๋ค.
- ์ฝ๋๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๊ฒํ ํฉ๋๋ค. ์ ํ๋ฆฌ์ผ์ด์ ์์ ์ฝ๋๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ Copilot์ด ์ ๊ณตํ๋ ์ฝ๋๋ฅผ ์ดํดํ๋์ง ํ์ธํ์ธ์. ์ด๋ ๊ฒ ํ๋ฉด ์ ์ฌ์ ์ธ ๋ฌธ์ ๋ฅผ ํ์ ํ๊ณ ์ฝ๋๊ฐ ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ๋์ง ํ์ธํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
- ๋ณ๊ฒฝ ๋ด์ฉ์ ์ ํจ์ฑ์ ๊ฒ์ฌํฉ๋๋ค. ์ฝ๋๋ฅผ ๋ณ๊ฒฝํ ํ์๋ ์ ํ๋ฆฌ์ผ์ด์ ์ด ์์๋๋ก ์๋ํ๋์ง ํ์ธํ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค. Copilot์์ ์์ฑํ ํ ์คํธ ๊ณํ์ ์ฌ์ฉํ์ฌ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ํ ๋จ์ ๋ฐ ํตํฉ ํ ์คํธ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.
์ค์ต
GitHub Copilot ๊ธฐ์ ๊ณผ์ ์ ์งํํ๋ฉด์ ๋ ๊ฑฐ์ ์ฝ๋๋ฒ ์ด์ค๋ฅผ GitHub Copilot์ผ๋ก ์ ๋ฐ์ดํธํ๋ ๊ณผ์ ์ ์ฐ์ตํด ๋ณด์ธ์.