Hands-On Tutorial#

Basics of Prompt Engineering for Software Engineering Projects#

Welcome to your quick hands-on tutorial on prompt engineering with generative AI! As future software engineers working with real-world industry partners, getting better at the art of prompt engineering is crucial. This tutorial will guide you through creating effective prompts that yield useful, ethical, critical and responsible outputs. Let’s go through this journey together to enhance your genAI collaboration skills!

Getting Started with Prompt Engineering#

Prompt engineering is the art of crafting queries that guide AI to produce desired outcomes. A well-engineered prompt leads to more accurate, relevant, and useful responses, enhancing your project’s innovation and efficiency.

Why Prompt Engineering Matters#

  • Enhances AI’s usefulness: Proper prompts lead to more accurate and relevant outputs.

  • Saves time: Reduces iterations needed to get usable outputs.

  • Encourages ethical use: Crafting prompts with consideration of fairness and bias ensures responsible AI usage.

Activities#

The following activities will guide you through creating, refining, and critically evaluating prompts for generative AI, focusing on developing a software solution to minimise teacher shortages in Australian schools. Let’s dive into it, ensuring responsible, ethical, and effective use. Give it a go! Explore these and try to come up with even better prompts than the suggested ones!

Activity 1: Crafting Your First Prompt#

Objective: Learn to craft a basic prompt that outlines your software development goal.

Good Examples#

  1. Prompt: “Generate a user story for a software system designed to connect postgraduate teaching students with Australian schools experiencing teacher shortages.”

    Why Good: This prompt is clear and directly relates to the project goal, specifying the end-users and the problem being addressed.

  2. Prompt: “List key features needed in a platform that enables school principals to discover and connect with potential teaching candidates.”

    Why Good: It targets a specific task within the project scope, prompting for actionable output that can inform software development.

Bad Examples#

  1. Prompt: “Make an app for schools teaching shortage.”

    Why Bad: This prompt lacks specificity about the app’s purpose, the target users, and how it addresses the problem of teacher shortages.

    Improvement: “Design an application that helps Australian school principals find qualified postgraduate teaching students to fill open teaching positions.”

  2. Prompt: “Write some code to help schools.”

    Why Bad: It’s overly vague, with no context about what the code should accomplish or how it relates to the project goals.

    Improvement: “Generate a code snippet that implements a feature allowing postgraduate students to create and upload their professional profiles to a database accessible by school principals.”

Activity 2: Enhancing Prompts with Specificity#

Objective: Refine your prompts to include detailed information about the software goal, end-users, and context.

Good Examples#

  1. Prompt: “Outline a database schema for storing postgraduate teaching students’ profiles, including fields for qualifications, teaching specialties, and availability, to be used by school principals.”

    Why Good: This prompt provides a clear, detailed request relevant to the software’s functionality and its users.

  2. Prompt: “Describe a user interface flow for school principals to search, filter, and view the profiles of potential teaching candidates within the software platform.”

    Why Good: It asks for a detailed design element that directly contributes to the software’s usability for one of the primary user groups.

Bad Examples#

  1. Prompt: “Do something about students profiles.”

    Why Bad: Lacks detail on what should be done with the profiles and for whom.

    Improvement: “Develop a feature within the software that allows postgraduate teaching students to create detailed professional profiles, highlighting their teaching credentials and subject matter expertise.”

  2. Prompt: “Schools need teachers in the app.”

    Why Bad: While true, it does not direct AI to generate any specific or actionable output related to the software project.

    Improvement: “Create a notification system within the software that alerts school principals when new teaching candidates matching their search criteria join the platform.”

Activity 3: Addressing Ethical and Inclusive Design#

Objective: Craft prompts that consider ethical implications and promote inclusivity.

Good Examples#

  1. Prompt: “Design a feature that ensures equitable visibility of all postgraduate teaching candidates’ profiles to school principals, regardless of background.”

    Why Good: It addresses the need for fairness and inclusivity in the software’s design, promoting equal opportunities for all candidates.

  2. Prompt: “Implement a privacy feature that allows candidates to control which parts of their profile are visible to school principals.”

    Why Good: This prompt emphasises the importance of user privacy and control, an essential ethical consideration in software development.

Bad Examples#

  1. Prompt: “Filter out non-English speakers.”

    Why Bad: This prompt suggests an unethical and non-inclusive feature that discriminates against candidates based on language proficiency.

    Improvement: “Include language proficiency options in the teaching candidates’ profiles, allowing school principals to search for teachers based on language skills needed for their school.”

  2. Prompt: “Make the interface flashy.”

    Why Bad: A “flashy” interface might not be accessible to all users, ignoring the principles of inclusive design.

    Improvement: “Design a user-friendly and accessible interface for the software that adheres to WCAG (Web Content Accessibility Guidelines) to ensure it is usable by school principals and candidates with varying levels of ability.”

Activity 4: Iterative Prompt Improvement#

Objective: Learn to refine prompts based on feedback and initial outcomes to enhance clarity and effectiveness.

Continuous Refinement Process#

  1. Evaluate the output: After generating an initial response from AI, critically assess its relevance and usefulness.

  2. Identify gaps: Determine what’s missing or could be improved in the AI-generated response.

  3. Refine the prompt: Incorporate specific feedback, additional context, or clearer objectives into the prompt.

  4. Repeat: Continuously iterate on this process to hone in on the most effective prompts and solutions.