Due Tuesday, October 6 at 1:00 pm Pacific
Put on your detective hat and pull out your flyswatter, because this assignment is all about finding and squashing bugs. Unlike the previous assignments in which we've asked you to create something, here we'll provide you with an existing piece of software. Your task is to find the bugs and get your coding agent to fix them. In doing so, you'll practice testing software, learn how to write a clear and precise bug report, and see what it's like to work with a coding agent to fix issues.
Step One: Get the Starter Files
Your first step is to clone the repository for this project. Start off by entering the CS193V development environment. You should see a prompt indicating that you're in the folder ~/projects:
student@cs193v-development:~/projects$You will need to clone the repository containing your starter files. The repository lives at the URL https://github.com/cs193v-students/a3-<your-sunet>, where <your-sunet> is replaced by your SUNetID (e.g. htiek, szum, cbl, poohbear, etc.). For example, I (Keith) would use the URL https://github.com/cs193v-students/a3-htiek.
After you've done this, change into the directory you just checked out. Its name will be a3-<your-sunet>, as above.
The repo you've just cloned contains a very buggy implementation of an event manager and planner for (fictional) events on campus. You can create an account to see and search for events, to join existing events, and to create new events.
We have intentionally injected a large number of bugs into the implementation for you to find. Some of the bugs will be very obvious as soon as you encounter them. Others will be a bit more subtle and will require good attention to detail to find. (Don't worry - you're not expected to find every bug.)
Before you start bug-hunting, though, you will need to get the website running on your computer.
Step Two: Start the Website
In previous assignments, you've opened websites by navigating to your projects folder on your machine and double-clicking index.html. For reasons we'll detail later in the quarter, that approach actually won't work here. You'll instead need to ask your coding agent to start up the website locally on your computer.
Open your Coding Agent of Choice and ask it to do the following:
"Please start the app so I can try it in my browser."
The coding agent will then download and install the software it needs to run the website. It will then present you a link to open on your computer. That link will likely be
http://localhost:5137
though you may see something different. (Yes, that is a URL. It tells your browser to open something locally on your computer. Details later this quarter!) Open the link to see the website. You should be presented with a login screen. If not, contact us on EdStem so we can help troubleshoot.
Step Three: Go on a Bug Hunt
Your task now is to use the website however you see fit to try to find a bug. Remember: think like a mischievous child. Use the site both in ways that are supposed to work (to make sure it works as intended) and in ways that aren't (to make sure the website doesn't let you get away with something it shouldn't).
You will likely encounter a bug very early on in the process. When that happens, proceed to the next step.
Step Four: Report the Bug
Once you've found a bug, it's time to write a bug report as a GitHub issue.
We've provided instructions to your coding agent to help guide you through this process. Start off by telling your coding agent that you've found a bug. It should give you instructions about how to file an issue on GitHub. Remember to include the details we described in lecture: have a clear title, give exact steps to reproduce, give the expected behavior, and give the actual behavior. Once you've written the bug report, tell your coding agent that you've filed it and give the issue number on GitHub. The agent will then look over what you wrote.
Be as specific as you can in your bug report. Writing good bug reports takes practice. We've instructed your coding agents to offer feedback on what you've written and to make sure your bug report is precise before it will proceed to help you find the bug. Expect to get some pushback on your first draft. Take its feedback seriously; this is how you learn to articulate bugs more clearly!
An important note, in case it comes up: the version of the website we ship to you includes some preloaded data in it (fictitious events, user accounts, etc.). To make it easier for you to reliably trigger the bug, we've instructed your coding agent on how to reset the website data back to what it was when you started the assignment. This will remove all custom accounts, reset the events back to the defaults, etc. You may want to make use of this feature when giving steps to reproduce.
Step Five: Fix the Bug
Once you've gotten the bug report into a good enough state, the coding agent will proceed to try to find the bug's root cause and fix it. It will write tests to do its best to ensure the bug has been corrected and to prevent regressions.
Make sure your coding agent ran the full test suite after making its change. If it didn't, tell it to do so. Otherwise you have no way of knowing whether the coding agent just broke something that already existed.
Make sure you manually verify that the bug is fixed after your coding agent says it is. Coding agents will sometimes confidently say they've fixed something when they've left things in a broken state.
Step Six: Repeat!
You've just found and fixed a bug. Great! Repeat this process until you've found and fixed at least three bugs. The code we've shipped you has more bugs in it that that, and if you like the detective work / creative mischief required to test code, feel free to keep going!
Step Seven: Submit Your Work
We've instructed your coding agent to commit and push changes to GitHub every time you find a bug that it then fixes. If everything goes according to plan, this means you should be all set once you fix your third bug. But that "should" is doing a lot of work in that sentence. You need to confirm that everything is up on GitHub. To do so, close your coding agent, use git status to make sure that everything has been committed (if not, use git add and git commit to commit your changes), and then do a final git push to send everything upstream to GitHub.
And that's it! You're done! Go sit in the rooftop terrace of the CoDa Building and take in the views.