Category Archives: Coursework

Understanding Mocks and Stubs in Testing

In software development, testing is key to making sure applications work the way they are supposed to. The blog post “Software Testing: Mocks and Stub” by Nicholas Lexi talks about two major tools in testing: mocks and stubs. This connects closely to what we have been learning in class about unit testing and keeping tests focused.

Summary of the Blog Post

The post starts by explaining why test isolation matters. When testing a piece of code, you want to make sure you are only testing that piece, not its outside dependencies. This keeps tests more reliable and easier to understand when they fail.

To help with isolation, the blog introduces mocks and stubs.

Mocks are fake versions of real objects that let you check if your code interacts with something the right way. You can use mocks to see if a method was called, or if it was called with the right information.

Stubs are simpler. They just return fixed responses when called. Stubs are useful when you want a test to run without relying on a real database, server, or other complicated system.

The post gives short examples showing how both mocks and stubs can be used.

Why I Picked This

I picked this post because we have been working with unit testing in class, and I wanted to better understand how mocks and stubs fit into writing cleaner tests. I had heard about them before but did not really get how they were different. Since isolation is so important in testing, I thought it made sense to dive deeper now.

Thoughts and Takeaways

One thing that stood out is how mocks and stubs have different goals. Mocks check behavior and stubs control data. That makes it easier to decide which one to use depending on what the test is trying to do.

Another big takeaway is how test isolation is about more than just making tests pass. It is about writing tests that fail for the right reasons, which makes fixing problems a lot easier.

Applying Mocks and Stubs

Going forward, I want to use mocks and stubs more when I am testing. Especially for anything that depends on APIs or databases, they will help keep my tests clean and focused. Practicing this now will help a lot when projects get bigger.

Conclusion

This blog gave me a better understanding of mocks, stubs, and why test isolation matters. Using them the right way will definitely help me write better, more reliable code.

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

Why Test-Driven Development Is More Useful Than I Thought

In software development, strong design habits are key to building software that is easy to understand and change. The blog post “Test-Driven Development: The Best Thing That Has Happened to Software Design” from Thoughtworks talks about how Test-Driven Development, or TDD, improves both code quality and design. This connects directly to what we have been learning in class about writing better, more reliable code.

Summary of the Blog Post

The post explains that TDD is not just about writing tests before coding. It is a way of working that leads to cleaner, better-organized software.

Writing tests first forces developers to think about what they want the code to do. It also leads to smaller, more focused units of code that are easier to test and maintain.

TDD also encourages better object-oriented design. Since you are planning behavior early, classes and methods tend to have clearer responsibilities. Another major point is that TDD makes refactoring safer, since a full set of tests can quickly catch mistakes.

Even though TDD can feel slower at first, the blog points out that it saves time in the long run by reducing bugs and making changes easier.

Why I Picked This

I picked this blog post because we have been learning about TDD in class, and I wanted to understand why it is considered such a big deal. Before reading this, I thought TDD was just extra work. This post showed me that it is really about designing better code from the start. Since TDD is common in real-world development, it made sense to learn more about it now.

Thoughts and Takeaways

One thing that stood out to me is how TDD helps you spot design problems early. If your code is hard to test, that is usually a sign it needs to be simpler. I had not thought about testing as a way to catch bad design, but now it makes perfect sense.

Another takeaway was how TDD makes refactoring less scary. In the past, I was nervous to change code that already worked because I was afraid of breaking it. With a strong set of tests, making improvements feels a lot safer.

Applying TDD

I want to start practicing TDD more, even on smaller projects. It might take some extra effort at first, but if it helps me write better, more flexible code, it is definitely worth it. Getting into good habits now will only help me later on bigger assignments and real-world work.

Conclusion

This blog post gave me a much better understanding of why TDD matters. It is not just about finding bugs, it is about building software that is better from the start. I am definitely motivated to practice TDD more and make it part of how I approach coding.

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

Software Quality Assurance & Testing

This is the start of a blog series for a class I’m currently taking, named as per the title. This will document some of the journey I go on as I discover how Q & A is performed on software. I can’t wait to keep on learning!

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

Understanding the Software Development Life Cycle (SDLC)

In software development, having a structured plan is crucial for creating reliable and efficient software. The blog post “What Is the Software Development Life Cycle (SDLC)?” explains what the SDLC process actually is. This directly relates to our coursework, as it lays out the core stages involved in creating software that we’ve discussed in class.

Summary of the Blog Post

The post breaks the SDLC into six main phases:

1. Requirement Analysis – Figuring out what the software needs to do.

2. System Design – Mapping out how the system will work.

3. Implementation – Writing the actual code.

4. Testing – Making sure everything functions as expected.

5. Deployment – Releasing the finished product.

6. Maintenance – Keeping the software updated and fixing bugs after launch.

The post also touches on different SDLC methodologies like Waterfall, Agile, and DevOps.

Why I Picked This

I chose this post because the SDLC is something we covered in class, and I felt like I could benefit from looking into it more. This post explained things in a simple way that helped me review and learn more about the process. Plus, SDLC is something I’ll definitely encounter in any future dev job, so it feels suitable to dive deeper into it now.

Thoughts and Takeaways

This blog really helped me get a better grip on SDLC. I knew the general ideas, but breaking down the phases step by step helped me realize how important each stage is. For example, I hadn’t thought much about how critical the requirement analysis phase is. If you get that wrong, everything else suffers!

I also liked the section about Agile. I’ve heard a lot about Agile but didn’t fully get how it compares to other models like Waterfall. The idea of working in iterations and being flexible with changes makes sense, especially for real-world projects where things don’t always go as planned. I think this will be useful for group projects where feedback loops are constant.

Another thing that stood out is how much emphasis the post put on maintenance. In class and in the blog post, its been made much more clear that maintenance is actually the far lengthier phase, and sometimes never really intended to end.

Applying SDLC

Going forward, I’m going to start structuring my projects with SDLC in mind. Even on smaller assignments, I’ll try to break tasks into phases, just to get into the habit. I also want to experiment more with Agile practices in team projects since it seems to encourage collaboration and adaptability, and is mentioned in a decent amount of job posts.

Conclusion

This blog post gave me a much clearer understanding of SDLC and why it’s such a core idea of software development. It affects nearly every bit of how software comes to be, and all software developers will encounter or deal with it in one way or another!

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

What is Git?

A Beginner’s Guide to Git and Version Control

Git is a useful tool for software developers, yet its many features can be intimidating or confusing to beginners. This GitHub blog post “What is Git? Our Beginner’s Guide to Version Control” offers a clearer, more concise explanation of Git, its purpose, and what its practical applications are. This blog post is an excellent resource for anyone early on in their journey through software development, as the knowledge will be useful for years to come. I myself still needed some more practice with git commands, and benefited from reading the post.

Summary of the GitHub Post

The post explains important concepts such as what repositories, branches, commits, and merges are, and emphasizes how Git helps developers collaborate effectively on projects while maintaining a complete history of those changes.

The author discusses and defines many crucial Git commands like git init, git clone, git add, and git commit, breaking them down into much simpler, more easily understandable terms. Lastly, the post also discusses the importance of version control systems like Git and GitHub in preventing data loss, enhancing collaboration, and improving code quality overall.

Why I Chose This Post

I chose this post because Git is a critical tool in software development and is directly related to our current course material. As someone with limited experience with Git and GitHub, I often had to practice extra with its terminology and commands. Understanding Git is vital for success in our coursework, and future careers in software development, where collaborative coding is a big deal and a common occurrence.

Reflection

One takeaway from this post and course for me was the significance of version control in teamwork. The post reinforced the idea that Git is not just a tool for managing personal projects in the way that I have experience using it, but also a way to collaborate more effectively with others on software projects.

Upon learning all this about Git and GitHub, I planned to apply what I’d learned by setting up repositories for all my future projects, creating meaningful commit messages, and leveraging GitHub to store and maintain my history of works. Through that, I’ve been able to build up my own portfolio and showcase my works to others.

Conclusion

This blog post serves as an excellent starting point for anyone looking to begin learning Git, and to understand its role and uses in version control. Its practical approach and clear explanations make it accessible to complete beginners, while laying down the foundation for much more advanced concepts later on down the line. As I continue my journey in software development, I’m confident that the skills I’ve gained from this resource will be invaluable, and I do continue to use Git and GitHub very frequently.

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

What is Clean Code?

Once you’ve moved past coding your first “Hello World” and learned some foundational concepts, your programs will naturally grow more complex. Without proper structure, they can quickly become cluttered and hard to follow. To avoid this, it’s crucial to keep your code organized, readable, and understandable—not just for yourself but for others you’ll collaborate with as a professional programmer.

This is where learning about “clean code” becomes essential. Writing clean code focuses on maintaining consistency, clear formatting, appropriate line counts, and effective use of comments, whitespace, and methods. To deepen my understanding, I read an article called “A Deep Dive into Clean Code” on Codacy.com, which explores principles and methodologies that help developers write better code. Here are the key takeaways I learned from the article that could help other studious coders out as well:

1. KISS (Keep It Simple, Stupid)

Simplicity is key. Avoid unnecessary complexity to make your code more readable and maintainable. Simple solutions are easier to debug, modify, and adapt, reducing the risk of introducing errors during updates or when new developers join the project.

2. DRY (Don’t Repeat Yourself)

Eliminate redundancy. Repeated logic scattered throughout the code increases the chances of inconsistencies and bugs. By consolidating repeated logic into functions, methods, or classes, you streamline updates and make the codebase more efficient and maintainable.

3. SRP (Single Responsibility Principle)

Each class or function should serve a single purpose. This modular approach makes code easier to test, debug, and update. With clear responsibilities, changes in one part of the code are less likely to cause unintended effects elsewhere, ensuring stability and flexibility.

4. Meaningful Naming

Descriptive names for variables, functions, and classes make the code self-explanatory, reducing the need for excessive comments. Clear naming improves communication and helps everyone on the team quickly grasp the logic and purpose of each component, especially in collaborative projects.

5. Improved Testing and Maintenance

Clean code principles directly enhance testing and maintenance. With organized and readable code, bugs are easier to identify and fix. Additionally, by minimizing technical debt, you can adapt the code for future features or changes without major overhauls, ensuring long-term project sustainability.

Incorporating these principles into your coding practices leads to better software and a smoother development process for everyone involved. By focusing on simplicity, eliminating redundancy, maintaining clear organization, and using meaningful names, you not only make your work easier but also set the stage for collaborative success.

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

Learning the Basics of Software Copyrighting and Licensing

When I first started studying how code and software is protected by law, I was lost. I’d never explored the realm of who owns what, or when one can utilize another’s code. I decided to delve further into these concepts after I was inspired to by a software development course.

I came across two fantastic pages on TechTarget, one on software licenses, and the other on copyright (1,2), that covered many topics of software law, including what licenses and copyrights are, do, and where they come from. Through reading these pages, I developed a better understanding of the these legal topics.

Licenses

Licenses are contracts between the people who developed or own the software, and the people or organizations who want to use the software. They cover how the software can be used, what the rights of the owners are, and what the users are allowed to do with the software. They can also include how the software is paid for, how many copies can be downloaded, or what level of access to the source code users can have.

This image from TechTarget gives an overview of strictness of different types of software licenses. To apply a license to software, the legal text of the license must be included with the software when shipped. This can be accomplished by including a file called “License” that contains the legal text alongside your software.

Obtaining a license from the software owner generally involves paying the owner to use the software. An example of this exchange is when someone purchases a video game. The person pays the price of the game, accepts the end-user license agreement upon loading the game up, and can then use the software forever.

This concept of payment for license is essentially the same when scaled up for business applications. One company can pay a software company for the license to utilize their software. This will likely cost more money than purchasing a video game, and can potentially involve other stipulations depending on license choice.

Copyrights

Copyright prevents others from copying or otherwise exploiting your creations, but works differently than licensing. For one, copyrighting in most countries, including the USA, is automatic. When software is written, the developer, or company the developer works for, automatically gains copyright over that work. This prevents others from stealing, reusing, or altering the work without permission. The copyright holder can also formally apply for a copyright with their country’s relevant organizations.

Interestingly, copyright can have a time limit in terms of years, with some companies, such as Disney, fighting to lengthen or alter the laws to allow them to protect their original mouse design for as many years as possible.

One huge difference with copyrighting is that someone else can use parts of your work legally without specifically asking you or your company. This is called “Fair-Use” by the non-owner, and includes uses such as for criticism and comment, parody, education, public good, and non-commercial activities.

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.

The Beginning

This post marks the start of this computer science and tech-focused blog. The early posts will be made for a software class, and I also intend to use it as a place to corral my thoughts and discoveries as tech advances, and as I progress as a computing professional. Let’s grow together!

From the blog CS@Worcester – KeepOnComputing by CoffeeLegend and used with permission of the author. All other rights reserved by the author.