Skip to content

Recitation 3: Estimation Exercise

Overview

In today’s recitation, we will practice implementing a new feature for the OpenCode.

Let's implement a new feature!

Check out this issue of the feature request. As a means to demonstrate their devotion to Carnegie Mellon, the user wants the custom command that they can input into the OpenCode CLI, which would then prompt OpenCode to return a piece of ASCII art of Scotty the Scottish Terrier. Note: You are not required to draw the ASCII art yourself. Feel free to use an online generator or ask OpenCode do it for you.

Task 0: Clone the repo

Fork the repository, clone it to your local machine, then open it in VSCode. You may reopen the repository in a development container using the devcontainer file has been included.

Task 1: Give an Estimate

Before you start working on the issue, take a brief moment to make a calculated guess on how much time you think you will need to implement the feature, without the help of any AI tools. Make sure to write down your estimate, as we will have to coming back to this.

Task 2: Dive into the code

For the next 15 minutes, work on implementing the feature without the use of any AI coding tools. Here are some tips to get you started:

  • OpenCode already has existing slash commands. How are these commands implemented?

  • GitHub's search tool lets you search for specific filenames, strings, or functions in the repository. How could you utilize this?

After the 15 minutes have elapsed, stop what you're doing and reflect:

  • Did you finish, or got close to finishing the feature?

  • Did you overestimate/underestimate the amount of time that you needed for this task? By how much?

  • Given this activity, how confident are you in your ability to estimate the effort needed for a task?

Task 3: With a Little Help from My Friends

Now, try implementing this feature using any AI coding tool at your disposal. This task should take less time than the previous. Once you are done, consider these questions:

  • What was the effort level required for this task compared to the previous?

  • What were the differences between the changes that you made with vs. without the AI tool?

Task 4: Make a Pull Request

Once you have a working implementation,

  • Add and commit your changes

  • Push the code to your forked repository.

  • Create a pull request that links to the issue.

In the PR, indicate whether you used AI in your implementation or not, and attach a screenshot of the Scotty that OpenCode generated after running the command as proof of successful implementation.

Spicy Challenge (Optional): Create an Automated Test

As an optional task for the daredevils out there, write automated tests for the changes that you've made to ensure that they did not break anything. You will not be graded on this, but it may prove itself as helpful practice for upcoming assignments!

Submission

Submit your PR link and complete the short quiz on Gradescope.