OSD600 Lab 7

🔔 Prelude: Code everywhere, tests everywhere, tokens everywhere, budget nowhere Main Content Testing commit: https://github.com/BHChen24/repo2context/pull/36/commits Answering Lab Questions Which testing framework/tools did you choose? Why did you choose them? Provide links to each tool and briefly introduce them. Since I my project is written by Go, so I just use the go test for testing: https://pkg.go.dev/testing As described on the official page, it “provides support for automated testing of Go packages.” It’s also a part of the standard library, so it can be used directly when the Go environment is set. At the beginning, I put the test files in another folder just like what I used to do with Typescript testing, but then I found it’s better to just place them beside the source code as a standard way in Go projects. Use go test [target folder/file] to run tests, and use go test -cover [target] to see the test coverage How did you set them up in your project? Be detailed so that other developers could read your blog and get some idea how to do the same. See above~ :) What did you learn while writing your test cases? Did you have any “aha!” moments or get stuck? I felt writing tests is painful. I have to consider each possible way to trigger an error, which is literally difficult to cover all the cases - also means I have to fully understand the tested target (mostly functions in Go). Always, when I hand my tests to AI for reviewing, it will give more comprehensive test cases, like missing values, edge cases, input format, etc. I did learned a lot. But I also begin to doubt that I can really memorize all useful cases. There are at least 10 to 15 cases for each function, even though there are some common cases I can reuse. Maybe a test cases document is the truly practical tool for the testing. I also made good use of “given-when-then” pattern for writing the tests. (See https://github.com/BHChen24/repo2context/blob/main/pkg/scanner/scanner_test.go) It’s super helpful for planning the test process. Did your tests uncover any interesting bugs or edge cases? No for this time. But I am curious about why I didn’t find any bugs… Maybe more tests will reveal some, or I need more time to review my tests. What did you learn from this process? Had you ever done testing before? Do you think you’ll do testing on projects in the future? Actually I have done the tests in the Lab6 (See https://github.com/BHChen24/repo2context/blob/main/pkg/tokenCounter/tokenCounter_test.go) At that time, I just simply thought that, “oh, since I will develop a new feature, maybe developing the tests at the same time is a good idea,” and then I created the tests beside it. I think doing the testing is a standard step for developing reliable applications, so I definitely will do that in my future projects. But I am actually feeling weird… Since each test case can be different, I’d like to say I’ve learned a lot from past tests, but for the next test I may still go blank with the new situation… Even though I know how to apply the test pattern, most of the time I still need to find some references to implement the test logic. Is it normal or not? Experience with Speckit As the additional content, I’d like to mention the new AI related tool called **Speckit, built by GitHub.** ...

2026-09-10

OSD600 Release 0.2 recap

🔔 Prelude: Journey of open-source contribution In October, in Hacktoberfest… What I did At first, I helped my friend build his open-source project. I introduced him to Hacktoberfest and added issue and PR templates to his project to make it easier for more people to contribute. Project link: https://github.com/TemaDeveloper/library_proj Then, I found a fun “cat card battle” project on GitHub. I joined it just because it looked interesting - and I love cat pictures. I also noticed that it is a new project created for Hacktoberfest, not too hard, but still meaningful (Not just “add yourself to the Contributors.md”). I contributed code to help the project fetch cat images correctly. Project link: https://github.com/JessieVela/cat-card-battle ...

2026-09-10

OSD600 Release 0.2 Week 4

🔔 Prelude: We ****need to be tested for sure In release 0.2 week 4… What I did This week I contributed in another issue in the project OpsiMate, - the same one I contributed to last week. My main task was to add test cases for one of the APIs. Working on (issue/PR) Here’s the issue I picked up: https://github.com/OpsiMate/OpsiMate/issues/371 And here’s my pull request: https://github.com/OpsiMate/OpsiMate/pull/537 This issue was a bit of a “legacy” one. Someone had tried working on it before, but their PR was rejected. Another contributor also took it but later unassigned themselves. ...

2026-09-10

OSD600 Lab 6 Developing

Main Content The feature I implemented the token counting feature inspired by the Repomix project in this lab. The feature displays the token cost calculated by a specific model align with each file in the file tree. Users can better manage API call budget now. For example: I also added corresponding tests to ensure reliability. The development In the development step, I tried to apply the TDD pattern ...

2026-09-10

OSD600 Lab 6 Reading

🔔 Prelude: If I cannot understand the project, how can I write my own code? Main Content Introduction of the target feature The feature I focused on is token counting. This component is responsible for calculating how many tokens a given text input contains. I ran the **repomix** project locally and got output like below: Which I think it’s exactly the feature I need for controlling the cost of calling LLM APIs. ...

2026-09-10

OSD600 Release 0.2 Week 3

🔔 Prelude: I am one part of a group of a hundred developers?! In release 0.2 week 3… What I did This week I participated in the project that was recommended by my classmates: OpsiMate; it’s truly an active open-source project—once I commented on an issue, there was a contributor to reply to me in time. I also joined their slack channel and found they even have short but regular reports for community growth, which makes me really feel like I am a part of the project. ...

2026-09-10

OSD600 Release 0.2 Week 2

🔔 Prelude: Shall we have a talk about the strange issues? In release 0.2 week 2… What I did This week I mainly worked on a small but interesting project: Cat Card battle (https://github.com/JessieVela/cat-card-battle). It’s a web-based game built with Vue and TypeScript, and styled using Tailwind CSS. Working on (issue/PR) Early this week, I found a bug that caused some image URLs from The Cat API to redirect to Tumblr’s “content violation” placeholder instead of showing actual cat photos. Like this: ...

2026-09-10

OSD600 Lab 5

🔔 Prelude: Even more powerful commands for version control Main Content Write a blog post about the process of refactoring your code. What did you focus on in your improvements? How did you fix your code so it would be better in each step? How did your interactive rebase go? Did you find any bugs in your code while you did this? Did you break your program while changing things? How did it go using Git to change your project’s history? What did you focus on in your improvements? I mainly focused on looking for big code blocks to implement my improvements because it has a higher chance of discovering a function that can be exacted. At the same time, I was also looking for a chance to rename some vague variables and add comments to logic. ...

2026-09-10

OSD600 Release 0.2 Week 1 (Updated)

🔔 Prelude: Everything’s hard in the beginning In release 0.2 week 1… What I did This week I mainly focused on searching for suitable open source projects to contribute to. I haven’t started submitting any pull requests yet, but I did managed to create an issue (see link below) and am waiting for it to be assigned. https://github.com/TemaDeveloper/library_proj/issues/17 Working on (issue/PR) I opened an issue about setting up issue templates for a repository. Although I think it was a simple one, it still was my first time dealing with this topic, so I referred to the official GitHub documentation. I surprisingly learned that using a .yml file for the issue template allows better formatting and a cleaner layout for users filling in issue forms than the .md template. ...

2026-09-10

OSD600 Lab 4

🔔 Prelude: PR, code review and communication. Refelction First, how did the code itself go? The Python project I worked with is clean and straightforward. It made me reconsider my tech stack: I may use Python as my primary prototyping language, and only turn to Go, Rust, or C++ when specific requirements demand it. Did you run into any problems? Implementing the logic was simple, but writing tests was more difficult. Too many cases could be included! ...

2026-09-10