Practice and reinforce the concepts from Lesson 5
This hands-on workshop transforms you into an ethical AI development practitioner, equipped with industry-standard guidelines and decision-making frameworks for responsible AI-assisted coding.
By completing this workshop, you will:
Context: You're developing an AI-powered diagnostic tool for a major hospital network. Situation: The AI model shows 95% accuracy but performs 15% worse on minority populations. Ethical Considerations:
Your Analysis:
Context: Building an AI loan approval system for a bank. Situation: AI denies loans at higher rates in certain zip codes, potentially violating fair lending laws. Legal Framework: Equal Credit Opportunity Act (ECOA)
Decision Matrix:
Factor | Risk Level | Mitigation Strategy |
---|---|---|
Legal compliance | ||
Reputation damage | ||
Financial impact | ||
Ethical obligation |
Context: Your startup uses AI to generate core product features. Situation: Investor due diligence reveals questions about code ownership and AI-generated IP. Stakes: $5M Series A funding round
Action Plan:
Review this AI-generated hiring algorithm code:
def score_candidate(resume_data):
"""AI-generated candidate scoring function"""
score = 0
# Education scoring
if resume_data['university'] in ['MIT', 'Stanford', 'Harvard']:
score += 40
elif resume_data['university'] in ['State Universities']:
score += 20
# Experience scoring
if resume_data['years_experience'] > 10:
score += 30
# Name-based cultural fit (AI-generated)
if resume_data['name'].lower() in ['john', 'mike', 'sarah']:
score += 10 # "Common names score higher"
return score
Bias Analysis Checklist:
Your Findings:
// AI-generated patient risk assessment
function assessPatientRisk(patientData) {
let riskScore = 0;
// ZIP code risk factor
const highRiskZips = ['10001', '10002', '10003'];
if (highRiskZips.includes(patientData.zipCode)) {
riskScore += 25;
}
// Insurance type factor
if (patientData.insurance === 'Medicaid') {
riskScore += 15;
}
// Age and gender factors
if (patientData.age > 65 && patientData.gender === 'F') {
riskScore += 20;
}
return riskScore;
}
Critical Review Points:
For any AI-generated code, ensure:
One. Code Documentation:
# AI-Assisted Development Notice
# Generated with: [AI Tool Name]
# Date: [Date]
# Reviewed by: [Your Name]
# Modifications: [List key changes]
def ai_generated_function(param1, param2):
"""
Purpose: [Clear description]
Parameters:
- param1: [type] Description
- param2: [type] Description
Returns:
- [type]: Description
Note: This function was initially generated by AI and has been
reviewed and modified for production use.
"""
# Implementation
2. Project Documentation: Create a template for AI-assisted projects:
3. Attribution Guidelines: Develop standards for crediting AI assistance:
Data Handling:
AI-Specific Concerns:
You're a senior developer reviewing junior developer's AI-assisted code:
# Junior dev's submission
def process_payment(amount, card_number, cvv):
# AI helped me write this
if amount > 0:
charge = amount * 1.03 # Add 3% fee
print(f"Charging ${charge} to card {card_number}")
# TODO: Actually charge the card
return True
return False
Your Tasks:
Given this AI-generated code with no documentation:
function m(a, b) {
const r = [];
let i = 0, j = 0;
while (i < a.length && j < b.length) {
if (a[i] <= b[j]) {
r.push(a[i++]);
} else {
r.push(b[j++]);
}
}
return r.concat(a.slice(i)).concat(b.slice(j));
}
Your Tasks:
Create a system to evaluate AI-suggested dependencies:
Evaluation Criteria:
Test Case: AI suggests using packages for a Node.js project. Research and evaluate:
Design a learning plan that balances AI assistance with skill development:
Week 1-2: Foundations without AI
Week 3-4: Introducing AI assistance
Week 5-6: Advanced AI integration
One. How AI Changes Development:
2. Preparing for the Future:
Write a 1-page document covering:
My AI Coding Principles:
When I Will Use AI:
When I Won't Use AI:
My Learning Commitment:
Compare 3 different AI coding assistants:
Evaluation Matrix:
Criteria | Tool 1 | Tool 2 | Tool 3 |
---|---|---|---|
Code Quality | |||
Language Support | |||
Documentation | |||
Debugging Help | |||
Learning Resources | |||
Ethical Policies | |||
Data Privacy | |||
Cost/Value |
Create a guide for your organization/school including:
Design a plan to professionally integrate AI:
Week One: Foundation
Week 2: Integration
Week 3: Optimization
Week 4: Reflection
Prepare for AI-integrated workplace:
Personal Growth: How has this course changed your approach to coding?
Ethical Stance: What's your position on AI in software development?
Future Plans: How will you continue learning about AI in coding?
Advice to Others: What would you tell someone just starting with AI coding tools?
Industry Prediction: Where do you see AI coding tools in 5 years?
Your final portfolio should demonstrate mastery of responsible AI coding:
Submit Your Final Activity Here
Congratulations on completing the Code with AI course! You've learned:
Remember: AI is a powerful tool, but you are the developer. Use AI to enhance your abilities, not replace your thinking!