Homework
During this quarter we are going to have 2 individual homework assignments where you get experience with AI programming tools and come up with app ideas.
Although each student is responsible for turning in their own homework, we strongly encourage students to work together. Everyone has to come up with their own solution, but we want people to talk about concepts together and help each other out when stuck.
We will use Canvas to submit homework assignments this quarter.
ECS 191: Homework 1 — Unix Utilities with AI-Assisted Development
Overview
In this assignment, you'll use Claude Code (an AI-powered coding assistant) to build simplified versions of common Unix utilities, then extend one of them with a new feature. This assignment introduces you to AI-assisted development.
What you'll build:
- Four Unix utilities:
wcat,wgrep,wzip, andwunzip - A line numbering feature (
-nflag) forwcat - Test cases for your new feature
What you'll submit:
- Your specification for the
-nfeature that you use as an input to Claude Code wcat.cpp(with the-nflag implemented)- Appropriate test files for your feature
- A brief reflection (see below)
Prerequisites:
- Download the repo to your machine from ECS 150 Projects on GitHub and read the README for Project 1
$ git clone https://github.com/kingst/ecs150-projects.git
Part 1: Build the Base Utilities
Your Task
Use Claude Code to implement all four utilities from the ECS 150 Project 1 specification:
wcat.cpp- concatenate and print fileswgrep.cpp- search for patterns in fileswzip.cpp- compress files using run-length encodingwunzip.cpp- decompress files
Requirements
- All utilities must use
open(),read(),write(), andclose()for I/O - Code must compile with
g++ -g -o <program> <program>.cpp -Wall -Werror - All utilities must pass the ECS 150 test cases (available in the repo)
Using Claude Code
Claude Code is a terminal-based AI coding assistant. The README.md we provide plus the test cases should be enough for Claude Code to complete project 1. Provide a prompt to let Claude Code know about the spec and how to run the test cases and have it solve each of the utilities one-by-one.
Part 2: Add Line Numbering to wcat
Feature Specification
Extend your wcat implementation to support an optional -n flag
that prepends line numbers to each line of output, matching the
behavior of standard Unix cat -n.
We are leaving the specification fairly sparse because having you create a spec is part of the assignment.
Writing Test Cases
You need to add test cases to the standard testing framework for
project 1. You should have test cases to test out the basic feature
plus any edge cases (e.g., multiple files). When in doubt, match the
behavior of Unix cat. Hint: Claude Code can help you understand
how the test cases work and create new ones, with some guidance.
Development Approach
- Write a specification: Write a simple prompt that explains the feature. You'll use this to get Claude Code to generate your implementation.
- Write your tests: Create comprehensive test cases for the new feature
- Write your code: Use Claude Code to create the new feature and test it, fixing issues that arise
- Verify: Ensure all original tests still pass
Submission Requirements
Submit the following files via Gradescope:
- wcat.md — Your specification for the
-nflag feature, used as an input to Claude Code - wcat.cpp — Your implementation with the
-nflag - test files — Your test files (must be loadable in the standard Project 1 test suite)
- reflection.md — A brief reflection (300 words max) addressing:
- How did using Claude Code change your development process?
- What challenges did you encounter with AI-assisted development?
- Did you understand the code Claude Code generated? How did you verify this?
- How did you decide what tests to write?
Grading Criteria
- Line numbering feature (80%):
-nflag works correctly - Code quality (10%): Clean, readable, properly commented
- Reflection (10%): Thoughtful analysis of AI-assisted development
Academic Integrity
- You are required to use Claude Code for this assignment — no manually written code is allowed
- You must understand all code you submit
- You may discuss approaches with classmates but not share code, tests, or specifications
- Your reflection must be your own original writing
Good luck!
ECS 191: Homework 2 — Coming up with ideas
Details TBD