Information Technology Project Management, Revised 7th edition test bank.docx
ANIn Pune July 2023 |Prompt Engineering and AI first SDLC by Abhijit Shah
1. AIFIRSTForSDLC
Take a Leap into future with AI for live enterprise
Abhijit Shah,
Principal Technology Architect , Infosys
• Microsoft Azure Solutions
Architect Expert
• A Cloud Enthusiast, Leading
Cloud Community
• Innovation Lead
• Sustainability Champion
https://www.linkedin.com/in/abhijitvijayshah
2. Abhijit Shah
Principal Technology Architect, Infosys
Microsoft Certified Azure Solutions Architect Expert
A Cloud Enthusiast, Running a Cloud Community
Innovation Lead and Sustainability Champion
https://www.linkedin.com/in/abhijitvijayshah
AI First Approach for SDLC | 29th July 23
• Topic - Prompt Engineering & AI First Approach for SDLC
• We will look at ways of applying AI First in each of the
phases of Software lifecycle – Requirements, Design,
Development, Testing , Documentation etc.
• We will use Chat GPT for Prompt Engineering and then
look at using Plugins in our dev environment.
• With hands on demos inside Visual studio code we will
generate code in for the identified requirement.
• What can I do next ?
• Find at least 3 things that we do manually , that could be
accelerated with the use of AI, and you get comfortable
with AI, start applying AI first in anything you do.
• With your new AI assistant doing the mundane jobs, you
can spend more quality time with your friends and family.
3. TREY
research
Canyouguesswhatis
showninthispicture?
3
• Supercomputer makes
calculations in blink of an eye that
take rivals 47 years.
• The 2019 version of this device
had 53 qubits; this next
generation device has 70.
• The new machine is 241 million
times more powerful than the
2019 machine.
• A paper from researchers at
Google
Quantum Computing in Artificial Intelligence Around the Corner (einfochips.com)
4. Moments of disruption provides a
biggest opportunity and today, it’s
Generative AI @ center stage
A word of caution, If you don't
disrupt yourself someone else will
.. So…. Get ready!
Let’s wear the hats of Innovators &
engage in this wave of Generative
AI led disruptions.
Identify and build use cases with
GPT as Co-pilot to deliver
personalized customer experience
with the power of AI
5. TREY
research
Agenda
Generative AI for Software Development Lifecycle
1. What is Generative AI ?
2. What is Prompt Engineering ?
3. How to apply Generative AI in SDLC ?
4. Demos of AI in SDLC
5
7. Launched on
30 Nov 2022
Chat GPT has made
HISTORY
in just 5 days
Latest, GPT 4 was release on
15th March 23
Instagram’s Thread’s App has set new record,
100 M users in 5 days
8. • Google CEO was the first to pitch the concept of ‘AI-First’ in 2017 & it’s a radical rethinking about how computers would
work in future
AI FIRST APPROACH
A strategy that means an increased focus on use of machine learning and AI for solving user problems.
✓ Human Adopts to machines Vs Machines adopt to Human
✓ Conversational and Sensory AI - AI is the New UI.
There are four core attributes associated with the ‘AI-First’
experience.
✓ Ability to interact with computing in a natural and
seamless way
✓ Ambient, multi-device presence of computing
✓ Thoughtfully contextual computing
✓ Computing that can learn and adapt
9. Unsupervised Learning Then Supervised Learning
• Human babies learn to speak languages
before formal education at school
(unsupervised learning)
• Kids then get fine tuned from school with
exam scores that tell them what is better or
worse answer (supervised learning)
• ChatGPT is made up of two main parts
• Understanding the context of the
input chat by human
• Left side in diagram
• Generate reactionary answer back
to the human
• Right side in diagram
Generative Pre-trained Transformers
13. TREY
research
AI FIRST APPROCH IN SDLC
13
The proficiency of Large Language Models (LLMs) in understanding and generating code,
are set to revolutionize software engineering like never before.
18. Demos
Generative AI
For
Software Development Life Cycle
● Generate Requirements
● Create Class Design
● Create Code
● Optimize Code
● Create Test Cases
● Create Documentation
● Create SQL / Database
● Create Image / Logos
AutoGPT – the autonomous AI agent
AutoGPT was released on 30-Mar, 23 shortly after the launch of GPT-4 & it has got the world divided due to the pros & cons associated with a fully autonomous AI model in place.
20. #BeResponsible while using GPT-3
Especially if you care about Sustainability!
● T5, Google’s pretrained language model, used 86 megawatts and produced 47 metric tons of CO2 emissions
● Meena, Google’s multiturn, open-domain chatbot, used 232 megawatts and produced 96 metric tons of carbon dioxide
emissions
● GShard, a Google-developed language translation framework, used 24 megawatts and produced 4.3 metric tons of carbon
dioxide emissions.
● Switch Transformer, a Google-developed routing algorithm, used 179 megawatts and produced 59 metric tons of carbon
dioxide emissions
● And worst of all: GPT-3, Open AI's sophisticated natural language model, used 1,287 megawatts hours (=1.3 Gwh) and
produced metric 552 metric tons of carbon dioxide emissions.
This is roughly equivalent to driving a car 1.3 million miles - in one hour!
● Natural intelligence in human beings , which works with the functionality of the human brain, consumes: 25 KW (Open
AI: 1300000 KW) - this is 0.002%, so 99.998% more efficient! (By comparison, the human brain works with 20 watts /
hour).
Stop using GPT-3 - especially if you care about sustainability! | LinkedIn
21. Carbon Emissions from IT
● Images created using Stable Diffusion Online (stablediffusionweb.com)
Images depicting CO2 emissions from IT Devices generated using AI
24. TREY
research
HandsOnDemo -AIinSDLC
Use Case - Digital Wallet : Assume that our project requires us to develop a Digital wallet system. We proceed with SDLC phases step by step as given below. At each step we will see
how Generative AI model such as GPT3/4, ChatGPT, etc. can help us.
24
Requirement phase:
•The requirement of the project is to develop a digital wallet system for retail payment. The user can make payments for his purchases using the
wallet. He should be able to link his wallet to his bank account. What are the key requirements of such a system?
•We can get more information for the progressive elaboration of the requirement.
•Elaborate on Payment System mentioned above.
•What should the Payment System user interface contain?
•What should be the elements of Payment Screen mentioned above?
Design phase:
•Write the software design for the digital wallet system.
•What are the main classes of Payment System module in wallet system?
•what are the methods that the Payment class will have ?
Build phase:
•Write the code for Payment class using python
•write the HTML code for the user interface for the Payment Request of the wallet system
•write python code to validate the data entered in the user interface of the Payment Request of the wallet system
•Write sql code to create a table to store the data entered in the user interface of the Payment Request of the wallet system
Test phase:
•Write the code to test the methods in PaymentRequest class
25. TREY
research
Elaboratingaproblemstatementintohighlevelrequirements
Using Generative AI – GPT 3.5
• Prompt
• The requirement of the project is to develop a digital wallet system for retail payment. The user can make payments
for his purchases using the wallet. He should be able to link his wallet to his bank account. What are the key
requirements of such a system?
• Response
1. Security: The system should have a secure platform to protect user data and transactions.
2. User Interface: The user interface should be simple and intuitive, allowing users to easily perform payments and
manage their accounts.
3. Payment Processing: The system should be able to process payments from various sources and provide real-time
updates.
4. Payment Options: The system should be able to accept payments from debit/credit cards, digital wallets, bank
accounts, and other payment solutions.
5. Reports and Analytics: The system should provide detailed reports and analytics to help users monitor their spending
and performance.
Model Used: text-davinci-003 25
26. TREY
research
DesigntheClassesfortheDigitalWallet
Prompt :
We want to prepare the class design for the Wallet System. What are the main classes of Payment System module in wallet
system?
Response:
1. User: This class will contain all the details of the user who is using the wallet system, including their personal details, payment
options, and loyalty programs.
2. Payment: This class will contain details of the payment made by the user, including the source, amount, and payment
method.
3. Transaction: This class will contain details of the transaction made using the wallet system, including the source, amount, &
payment method.
4. Bank Account: This class will contain details of the user’s linked bank account, including account details and balance.
5. Loyalty Program: This class will contain details of the loyalty program associated with the wallet system, including rewards &
discounts.
6. Payment Gateway: This class will contain details of the payment gateway used by the wallet system, including payment
options and processing fees.
7. Security: This class will contain details of the security measures used by the wallet system, including encryption and
authentication.
26
27. TREY
research
Obtainlistofmethodsforaclass
Prompt :
• List the methods of the User and Payment class
RESPONSE
User Class
1. getUserDetails(): This method will return the details of the user, including their personal information and payment options
2. setUserDetails(): This method will set the details of the user, including their personal information and payment options.
3. getLoyaltyPrograms(): This method will return the details of the loyalty programs associated with the user’s wallet.
4. setLoyaltyPrograms(): This method will set the details of the loyalty programs associated with the user’s wallet.
5. linkBankAccount(): This method will link the user’s wallet to their bank account.
Payment Class
1. getPaymentDetails(): This method will return the details of the payment, including the source, amount, and payment method.
2. setPaymentDetails(): This method will set the details of the payment, including the source, amount, and payment method.
3. processPayment(): This method will process the payment and update the user’s wallet balance.
4. getTransactionDetails(): This method will return the details of the transaction, including the source, amount, and payment method.
5. setTransactionDetails(): This method will set the details of the transaction, including the source, amount, and payment method.
27
28. TREY
research
CodeGeneration
28
Prompt:
Write the code for Payment class using python.
Response:
class Payment:
def __init__(self, amount, date, type):
self.amount = amount
self.date = date
self.type = type
def process_payment(self):
# code to process the payment
return True
def process_refund(self):
# code to process the refund
return True
def process_reversal(self):
# code to process the reversal
return True
def generateReceipt(self):
# code to process the receipt
return True
29. TREY
research
GenerateBasicUICode
Prompt : Write the HTML code for the user interface for the Payment Processing screen of the wallet system.
Response:
<!DOCTYPE html> <html> <head> <title>Payment Processing</title><style type="text/css">
body {font-family: Arial, Helvetica, sans-serif;margin: 0;}
.container {
margin: 10px auto;width: 600px;padding: 20px;background-color: #f1f1f1;border-radius: 10px;}
h2 {font-size: 24px;margin-bottom: 10px;}
label {font-size: 16px;margin-bottom: 5px;width: 150px;display: inline-block;}
input[type="text"] {width: 200px;padding: 5px;border-radius: 5px;border: 1px solid #ccc;}
input[type="submit"] {padding: 5px 10px;background-color: #4CAF50;
color: #fff;border-radius: 5px;border: none;margin-top: 10px;} </style>
</head>
<body> <div class="container">
<h2>Payment Processing</h2>
<form method="post" action="payment_process.php">
<label>Payment Method:</label>
<input type="text" name="payment_method" /><br><br>
</form> </div> </body> </html>
29
30. TREY
research
GenerateUnitTestingCode
Prompt :
Write Unit Testing Code for Bank account class.
import unittest
from BankAccount import BankAccountpublic class BankAccountTest {
class BankAccountTestCase(unittest.TestCase):
Response:
def setUp(self):
self.account = BankAccount('John Doe', '123456789')
________________________________________________
def test_account_holder_name(self):
self.assertEqual(self.account.holder_name, 'John Doe’)
________________________________________________
def test_account_number(self):
self.assertEqual(self.account.account_number, '123456789’)
________________________________________________
30
def test_deposit_funds(self):
self.account.deposit_funds(1000)
self.assertEqual(self.account.balance, 1000)
______________________________________________
def test_withdraw_funds(self):
self.account.deposit_funds(1000)
self.account.withdraw_funds(500)
self.assertEqual(self.account.balance, 500)
31. TREY
research
GeneratingUserGuideinmultiplelanguages
31
Consider a scenario wherein you wish to
handover the code to the client along
with code documentation. Assuming the
client developers prefer the
documentation in their native language.
Such translations can be achieved by
using GPT3 models.
•Let us print the Summary of a simple
“Hello World” Python program in English.
And then instruct GPT3 model for a
French version of the same.
Intent: Generate User Guide
Prompt: <Note: Appropriate code snippet is placed here. In our case, the HTML code for Payment Processing is
placed here. >
Create a user guide in Hindi and French based on this code:
Response by Model : text--davinci-003
Hindi
भुगतान प्रक्रियाकरण
डीवी क
े लिए एक आवश्यकता है क्रक आप भुगतान प्रक्रियाकरण कर सकते हैं। इस कोड का उपयोग करक
े , आप एक भुगतान प्रक्रियाकरण पृष्ठ बना
सकते हैं।
पृष्ठ पर एक संग्रह है जो ननम्न वववरण शालिि है:
• भुगतान ववधि: आप ि
े डडट काडड, डीबीएच, इिेक्ट्रॉननक क
ु क्रकज़, और अन्य िुद्राओं का उपयोग कर सकते हैं।
• रालश: आप अपनी भुगतान रालश दजड कर सकते हैं।
• भुगतान आवृवि: आप एक बार क
े लिए, साप्ताहहक, िालसक या अन्य आवृवियों िें अपना भुगतान कर सकते हैं।
• सबलिट बटन: आप अपनी भुगतान जिा करने क
े लिए एक सबलिट बटन दजड कर सकते हैं।
French
Traitement des paiements
Le Développement d'une nécessité pour vous de traiter les paiements. Avec ce code, vous pouvez créer une page de traitement des
paiements.
La page comprend une collection comprenant les détails suivants:
• Mode de paiement: vous pouvez utiliser des cartes de crédit, des DBAs, des électroniques et d'autres devises.
• Montant: Vous pouvez entrer votre montant de paiement.
• Fréquence de paiement: Vous pouvez effectuer votre paiement à une seule fois, hebdomadaire, mensuel ou d'autres fréquences.
• Bouton Envoyer: Vous pouvez entrer un bouton Envoyer pour effectuer votre paiement.
32. TREY
research
TaketheAIFIRSTApproachforSDLCcourseonInfosysSpringboard
32
Infosys announces the launch of its AI-Training sessions on Infosys
Springboard in June 2023. The topics are: Introduction to Artificial Intelligence,
Introduction to Natural Language Processing, Introduction to Deep Learning
and Generative AI - Tools and Techniques.
Home | Infosys Springboard (onwingspan.com)