Prompt Engineering for AI-Assisted Coding
Created bySolihin Solihin
2 views0 downloads

Prompt Engineering for AI-Assisted Coding

Adult EducationComputer Science2 days
5.0 (1 rating)
In this project, adult learners explore prompt engineering techniques to optimize AI code generation for efficient and responsible software development. Students participate in coding challenges, iteratively refine prompts, and analyze performance data to improve coding efficiency. They also delve into the ethical considerations of using AI-generated code, developing guidelines for responsible AI deployment and a checklist for ethical prompt engineering. The project culminates in a portfolio showcasing the prompt engineering process and an ethical guideline document.
Prompt EngineeringAI Code GenerationEthical AICoding EfficiencyAlgorithm OptimizationResponsible AIAdult Education
Want to create your own PBL Recipe?Use our AI-powered tools to design engaging project-based learning experiences for your students.
📝

Inquiry Framework

Question Framework

Driving Question

The overarching question that guides the entire project.How can we ethically leverage prompt engineering to optimize AI code generation for efficient and responsible software development?

Essential Questions

Supporting questions that break down major concepts.
  • How can prompt engineering enhance AI's ability to generate code?
  • What are the key elements of an effective prompt for AI code generation?
  • How does prompt engineering improve coding efficiency?
  • What are the ethical considerations of using AI-generated code?

Standards & Learning Goals

Learning Goals

By the end of this project, students will be able to:
  • Students will be able to design effective prompts for AI code generation.
  • Students will understand the ethical considerations of using AI-generated code.
  • Students will be able to optimize AI code generation for efficiency through prompt engineering.

Entry Events

Events that will be used to introduce the project to students

'AI Code Challenge: The Bot Battle'

Students participate in a head-to-head competition where they craft prompts to guide AI in solving coding challenges. The team whose AI generates the most efficient and accurate code wins, sparking immediate engagement with prompt engineering.
📚

Portfolio Activities

Portfolio Activities

These activities progressively build towards your learning goals, with each submission contributing to the student's final portfolio.
Activity 1

The Ethical Algorithm Architect

Students explore the ethical implications of using AI-generated code, focusing on biases, security vulnerabilities, and responsible deployment. They will analyze case studies and develop guidelines for ethical prompt engineering and code review.

Steps

Here is some basic scaffolding to help students complete the activity.
1. Research case studies of ethical issues arising from AI-generated code (e.g., biases, security vulnerabilities).
2. Identify potential ethical concerns related to the project's AI-assisted coding tasks.
3. Develop a checklist for ethical prompt engineering, including guidelines for mitigating biases and ensuring responsible code generation.
4. Present the ethical considerations and proposed guidelines to the class for feedback and refinement.

Final Product

What students will submit as the final product of the activityA comprehensive ethical guideline document for AI-assisted coding, including a checklist for prompt engineering and code review to ensure responsible and unbiased AI deployment.

Alignment

How this activity aligns with the learning objectives & standardsDirectly aligns with the learning goal: 'Students will understand the ethical considerations of using AI-generated code.'
Activity 2

Efficiency Engineering Challenge

Students engage in a series of coding challenges where they optimize AI code generation through iterative prompt engineering. They measure coding efficiency based on speed, accuracy, and resource utilization, refining prompts to achieve optimal performance.

Steps

Here is some basic scaffolding to help students complete the activity.
1. Select a coding challenge with clear performance metrics (e.g., execution time, memory usage).
2. Design an initial prompt to guide AI code generation for the challenge.
3. Run the AI-generated code and measure its performance against the defined metrics.
4. Iteratively refine the prompt based on performance results, documenting each change and its impact on efficiency.
5. Compare the performance of different prompts to identify the most efficient solution.

Final Product

What students will submit as the final product of the activityA portfolio showcasing the iterative prompt engineering process, including the initial prompt, refined prompts, performance data, and a final optimized code solution demonstrating enhanced efficiency.

Alignment

How this activity aligns with the learning objectives & standardsAddresses the learning goal: 'Students will be able to optimize AI code generation for efficiency through prompt engineering.'
🏆

Rubric & Reflection

Portfolio Rubric

Grading criteria for assessing the overall project portfolio

Prompt Engineering and Ethical AI Coding Rubric

Category 1

Prompt Engineering for Efficiency

This category assesses the student's ability to design, refine, and optimize prompts for efficient AI code generation.
Criterion 1

Initial Prompt Design

Effectiveness of the initial prompt in guiding AI code generation for the given coding challenge.

Exemplary
4 Points

The initial prompt is exceptionally clear, specific, and directly aligns with the coding challenge, resulting in a strong starting point for AI code generation.

Proficient
3 Points

The initial prompt is clear, specific, and aligned with the coding challenge, providing a good starting point for AI code generation.

Developing
2 Points

The initial prompt is somewhat vague or lacks specificity, leading to limited success in AI code generation for the challenge.

Beginning
1 Points

The initial prompt is unclear, irrelevant, or fails to guide AI code generation effectively.

Criterion 2

Iterative Prompt Refinement

Ability to iteratively refine prompts based on performance data to improve coding efficiency (speed, accuracy, resource utilization).

Exemplary
4 Points

Demonstrates exceptional ability to analyze performance data and make insightful prompt refinements, leading to significant improvements in coding efficiency and optimized resource utilization.

Proficient
3 Points

Demonstrates a strong ability to analyze performance data and make effective prompt refinements, leading to noticeable improvements in coding efficiency.

Developing
2 Points

Shows some ability to analyze performance data and make prompt refinements, but the impact on coding efficiency is limited.

Beginning
1 Points

Struggles to analyze performance data or make meaningful prompt refinements, resulting in minimal improvement in coding efficiency.

Criterion 3

Performance Data Analysis

Accuracy and thoroughness of performance data analysis to identify areas for prompt improvement.

Exemplary
4 Points

Provides a comprehensive and accurate analysis of performance data, identifying key areas for prompt improvement with insightful observations and justifications.

Proficient
3 Points

Provides an accurate analysis of performance data, identifying relevant areas for prompt improvement with clear explanations.

Developing
2 Points

Provides a basic analysis of performance data, but may miss key areas for prompt improvement or lack sufficient detail.

Beginning
1 Points

Provides an incomplete or inaccurate analysis of performance data, failing to identify important areas for prompt improvement.

Criterion 4

Optimized Code Solution

Effectiveness and efficiency of the final optimized code solution achieved through prompt engineering.

Exemplary
4 Points

The final code solution is exceptionally efficient, accurate, and well-optimized, demonstrating a mastery of prompt engineering techniques.

Proficient
3 Points

The final code solution is efficient, accurate, and optimized, demonstrating a strong understanding of prompt engineering techniques.

Developing
2 Points

The final code solution is functional but lacks efficiency or optimization, indicating a partial understanding of prompt engineering techniques.

Beginning
1 Points

The final code solution is incomplete, inefficient, or inaccurate, demonstrating a limited understanding of prompt engineering techniques.

Category 2

Ethical Considerations and Guidelines

This category assesses the student's understanding of the ethical implications of using AI-generated code and their ability to develop ethical guidelines for prompt engineering and code review.
Criterion 1

Case Study Analysis

Depth of analysis of case studies related to ethical issues in AI-generated code (biases, security vulnerabilities).

Exemplary
4 Points

Demonstrates an exceptionally thorough and insightful analysis of case studies, identifying complex ethical issues and providing nuanced perspectives on their implications.

Proficient
3 Points

Demonstrates a thorough analysis of case studies, identifying key ethical issues and providing clear explanations of their implications.

Developing
2 Points

Shows some understanding of ethical issues in case studies, but the analysis may lack depth or completeness.

Beginning
1 Points

Struggles to understand or analyze the ethical issues presented in the case studies.

Criterion 2

Ethical Guideline Development

Quality and comprehensiveness of the ethical guideline document for AI-assisted coding.

Exemplary
4 Points

Develops a comprehensive and well-articulated ethical guideline document that addresses a wide range of potential ethical concerns with clarity, precision, and actionable recommendations.

Proficient
3 Points

Develops a clear and well-organized ethical guideline document that addresses key ethical concerns and provides practical recommendations.

Developing
2 Points

Develops a basic ethical guideline document, but it may lack comprehensiveness, clarity, or specific recommendations.

Beginning
1 Points

Develops an incomplete or poorly articulated ethical guideline document that fails to address key ethical concerns.

Criterion 3

Ethical Checklist for Prompt Engineering

Effectiveness of the checklist in mitigating biases and ensuring responsible code generation.

Exemplary
4 Points

The checklist is exceptionally thorough, practical, and effectively addresses potential biases and ethical concerns in prompt engineering, promoting responsible code generation.

Proficient
3 Points

The checklist is thorough, practical, and addresses key biases and ethical concerns in prompt engineering, promoting responsible code generation.

Developing
2 Points

The checklist is basic and addresses some biases and ethical concerns, but may lack comprehensiveness or practical application.

Beginning
1 Points

The checklist is incomplete, ineffective, or fails to address key biases and ethical concerns in prompt engineering.

Criterion 4

Presentation and Feedback Integration

Effectiveness in presenting ethical considerations to the class and integrating feedback for refinement.

Exemplary
4 Points

Presents ethical considerations with exceptional clarity and confidence, actively solicits feedback, and skillfully integrates suggestions to significantly enhance the ethical guidelines.

Proficient
3 Points

Presents ethical considerations clearly and confidently, solicits feedback, and effectively integrates suggestions to improve the ethical guidelines.

Developing
2 Points

Presents ethical considerations adequately, but may struggle to effectively solicit or integrate feedback for improvement.

Beginning
1 Points

Struggles to present ethical considerations clearly or effectively integrate feedback.

Reflection Prompts

End-of-project reflection questions to get students to think about their learning
Question 1

How did your understanding of ethical considerations in AI-assisted coding evolve throughout the 'Ethical Algorithm Architect' project?

Text
Required
Question 2

To what extent did your iterative prompt engineering process in the 'Efficiency Engineering Challenge' improve the efficiency of AI-generated code?

Scale
Required
Question 3

Which specific prompt engineering techniques did you find most effective in optimizing AI code generation, and how did you discover them?

Text
Required
Question 4

What were the most significant challenges you encountered while working on these projects, and how did you overcome them?

Text
Required
Question 5

In what ways has this project changed your approach to coding and problem-solving?

Text
Required