Category Archives: CS@Worcester

sweep the floor

When you first get placed on a team, it’s sometimes hard to get your bearings if you aren’t given an explicit task to work on to begin with. We sort of experienced this at the start of the semester, where we weren’t all too familiar with the Thea’s Pantry project even after working with forks of it for assignments in prior courses. Part of this is just the nature of working with something new, and having the expectation of providing value to it in a practical sense.

In this way, it makes sense the way we approached the issues that we took for the first sprint. For the most part, these issues were fairly simple and mostly plumbing, which can also be classified as sweeping the floor. The idea for sweeping the floor is that you take simple tasks that, while necessary, aren’t all that interesting, in order to build confidence in yourself with the project and build rapport with the team.

The authors make a good point in that it might not feel great to do as someone with a Computer Science degree that you worked hard for, but the reality is that the degree is really just a way to get your foot in the door. Same with any other way that you gained the qualifications to get accepted for a job or project that you’re working on. The real work is the work you do when you’re placed into a project, where you really get to apply the basics that you learned in college while also learning more practical skills.

I really think this is a good approach to take when you feel out of your element in a new environment. Maybe you just got hired for your first internship or even first full-time job, and while you are excited, you don’t really know how to actually provide value to the project, because you haven’t necessarily had that sort of experience before. This seems really helpful to get your bearings in a new project. The authors do mention a couple drawbacks to this approach, with the most notable one being the feeling of being stuck doing the small tasks without branching out due to anxiety, but there are ways out of this mindset too.

From the blog CS@Worcester – V's CompSCi Blog by V and used with permission of the author. All other rights reserved by the author.

Week 9 Blog Post

Choosing a topic for this week I tried to find something we had recently touched upon. Last week we went over mocking and expanding my knowledge of this topic can benefit me and the class. Searching for articles about mocking I stumbled upon one that shares the negatives of using mocking data. To counter-attack the ideas we learned in class it is always great to know both sides to using a concept. 

This article doesn’t fully dispose of mocking but gives ideas when it’s good to use. It gives a variety of examples including “Isolating the unit under test from other components or dependencies that are not relevant to the test, Speeding up the test execution by avoiding network calls or database queries that can be slow or unreliable, and Controlling the test input and output by creating predictable and consistent data that can be easily verified”. These ideas are then counterposed to the negatives such as “Introducing errors or inconsistencies between the mock data and the real data, which can lead to false positives or false negatives in the test results, Reducing the coverage and confidence of the test, by not testing the actual behavior and logic of the external source or the interaction with it, and Increasing the maintenance and complexity of the test, by requiring extra code and logic to create and manage the mock data”. The flaws of mocking data are mainly it does not use real data making it much more different from the real data creating disparities between the two. These tests ignore scenarios with much more complexity and these error and bugs can go unseen. The author assures the reader to use a data source to improve the tests.

After reading this article it gave me insight into the negatives of using mocking. The week prior activities made the use of mocking reduce time in creating classes but it’s good to know when it should be used and when it shouldn’t. I wish there was a perfect solution for every test but to find bugs in your code you must expand your horizon. Reading this article made me see that a variety of tests testing different things can overall benefit you. You never have to completely ignore a type of test but being able to see the positives and negatives can save you in the long run. Plus it will allow you to have a broader knowledge knowing that this may have flaws but there are things I can add to have a satisfactory end product.       

https://medium.com/@queenskisivuli/why-mocking-data-is-a-bad-practice-for-testing-a20d2d7104aa

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

Unit Testing

This week I decided to discuss Unit testing because although we have finished a few activities on the subject, I would like to read up on it to get a better understanding of it. While searching for a blog to discuss, I found this blog called “Unit Testing Best Practices: 9 to Ensure You Do It Right” from Testim. This blog also discusses what a unit test is, why we write them, the benefits of unit testing, how to achieve testable code, who creates them, and the difference between unit testing and integration testing.

The text begins by explaining that unit tests focus on very small parts of the application in complete isolation and compare their actual behavior with the expected behavior. In this section, the idea of complete isolation is thoroughly explained with the idea that “you don’t typically connect your application with external dependencies”. This is what makes unit tests so fast and stable.

The next section explains why they are created in bullet points and have the main ideas bolded. This structuring is helpful to simplify the ideas for the reader and make sure that the main ideas stick out for them. These were the bolded parts of the bullet points in the section: unit tests help you find and fix bugs earlier, your suite of unit tests becomes a safety net for developers, unit tests can contribute to higher code quality, unit tests might contribute to better application architecture, unit tests can act as documentation, and detect code smells in your codebase. I think a lot of the ideas presented were easy to comprehend based on the bolded part but I had to read more about the last bullet point because the term” code smells”(signs that something is wrong with your code ) was not obvious to me. 

The section that explained the difference between integration testing and unit testing was fairly short because they narrowed the main idea down to a few sentences: “It’s all about the level of isolation. While unit tests have to be completely isolated, integration tests don’t shy away from using external dependencies….integration tests offer a more high-level view of the application than unit tests do. Because of that, the feedback they provide is both more realistic and less focused.”

The 9 best practices at the end are titled: Tests Should Be Fast, Tests Should Be Simple, Test Shouldn’t Duplicate Implementation Logic, Tests Should Be Readable, Tests Should Be Deterministic, Make Sure They’re Part of the Build Process, Distinguish Between The Many Types of Test Doubles and Use Them Appropriately, Adopt a Sound Naming Convention for Your Tests, and Don’t Couple Your Tests With Implementation Details. These tips are easy to understand based off of the title alone but throughout each section, the author uses bits of code as examples and bullet points to thoroughly explain each idea. In the future, I will refer to these tips when I need to write tests for a project I will work on.

From the blog CS@Worcester – Live Laugh Code by Shamarah Ramirez and used with permission of the author. All other rights reserved by the author.

Stay in the Trenches

This week I decided to discuss the pattern called “Stay in the Trenches”. In this section, the problem presented is where you are offered a promotion into a role that will pull you away from programming. It mentions that this offer is an illusion of accomplishment that will test your sustainable motivation and determination to walk the long road.  I decided to pick this pattern because it involves the idea of sustainable motivations which is a pattern I wrote about previously. I am unsure about what is motivating me to stay in the field so I like thinking about these kinds of topics. I don’t think this section has really changed my mind about the way I think about my profession though.

Many people equate a promotion with success but in the problem presented (a promotion that would pull you away from programming), you will be trading the programming skills that you have worked to develop for said promotion. The tet calls for you to stay on your path and work with your manager to find other mechanisms to reward you for your excellent work. This means if your company refuses to be flexible, you should find opportunities somewhere else. 

I agree that it would be best to continue on the path of software engineering since you’ve dedicated a lot of time in an attempt to become a master but simply saying that if your organization is inflexible then you should find opportunities elsewhere is a bit easier said than done. I think you can love this path but if life knocks you down it may be a bit difficult to stay on the path. If you are able to find other opportunities, that’s great; you can continue on the path. If you have trouble finding other opportunities and you need the resources that the promotion can provide, then you may just have to take that promotion. I’m not saying that you have to give up software engineering forever, but you might have to take a little detour and stray from the path a little at least until you can find other opportunities elsewhere. You can still love software engineering and pick up projects in your free time but sometimes you have to be realistic in this society career wise. 

Lastly, I do think the list of possible alternate rewards for your excellence was great. It suggested to “consider whether there are standard constraints that could be loosened in your case” and to  “prepare a list of these alternative rewards so that when you reject that promotion, you’re in a position to negotiate based on a clear understanding of your own motivations”. I think those are very helpful suggestions.

From the blog CS@Worcester – Live Laugh Code by Shamarah Ramirez and used with permission of the author. All other rights reserved by the author.

A Deeper Dive into Mocking

In class, we began learning about the use of mocking in software testing. After doing an activity, I realized I only slightly understood the purpose of it. So, I decided to investigate, which is when I found The Art of Mocking by Gil Zilberfeld and Dror Helper.

The article begins by giving an introduction to unit tests for those who might not be familiar. They also give an example in C#, which is the language they use for the rest of the article. However, this does not impact information about mocking besides the syntax of the examples.

Once unit tests are covered, hand-rolled mock tests are introduced: they are classes that the developer(s) code which take the place of the real objects for testing purposes. It might not accurately test the system, but it ensures the business logic of the class works. 

The types of mocking listed are those manually made by the developers and those auto generated by mocking frameworks (Mockito or Moq). The article goes quite in depth into mocking frameworks, in their types, what they do, and what to look for when choosing one. Zilberfeld and Helper also discuss the benefits of mocking, which generally boils down to the fact that mocking cuts loose extra requirements for testing, such as databases and other external/complex resources.

Lastly, the best practices and potential hazards are listed. From what I gathered, the important ones were:

  • Only use fake objects when necessary, as too many can create weak/fragile tests
  • Understand what you’re testing and the dependency
  • At most two assertions/verifications per test

I selected this article because I was struggling a little bit with what mocking was and why it was useful. I had somewhat understood the concept and the idea behind it in class, but needed to go on a deeper dive to get a better grip on it. This resource also seems pretty real, in the sense of it feels homemade and focused; all the important stuff is in the articles themselves, not a subscription or anything. 

This article is superb with its examples and clear, in-depth explanations of unit tests and mocking. The formatting is easy to follow and allows for smooth learning and transitions from concept to concept. I personally believe that mocking is quite useful when applied lightly. I learned that Verify should only be used in fake objects when it’s the only way your program can pass or fail; otherwise, it might not matter whether every method actually calls the expected method. 

This affected me in a positive way as it gave me greater insight to mocking and more confidence in my personal understanding as to why we use it. I expect to apply this in a future job when I might need to test a method that uses database information, but it would take too many resources to use the database for testing purposes.

From the blog CS@Worcester – Josh's Coding Journey by joshuafife and used with permission of the author. All other rights reserved by the author.

Week 9 – Better late than never.

Jesus, yeah I’ve kinda been slacking on my blog writings huh? So sorry for the radio silence coming from this place. Going forwards I can hopefully write every week moving forwards.

Anyways, for my first time writing for this class with Professor Wurst, being Software Quality and Testing, I wanted to talk specifically more in depth about what I had already sent him earlier this semester in our course’s Discord server, that being a video by Matt McMuscles about Sonic The Hedgehog (2006)

I have personal experience with this game, as I specifically remember going to BlockBuster when it was still around, wanting to get the game LittleBigPlanet, and my father reaching into the the bargain bin to find Sonic 06, as its better known to fans (quite the mouthful the real title is, and better to differentiate it from the original game on Sega Genesis), and handing it to me. Unfortunately, I had left the store only with Sonic 06.

The reason I relate this to Software Quality and Testing, is because this game is a heavy example of what happens when you rush it, as the video shows. This game was rushed out to shelves for the Christmas of 2006, so SEGA could make a good profit off of it, benefitting off of the increased demand that comes with Christmas.

Many things in this game show that it was improperly tested, with bugs, glitches, and even crashes all about the game. The game is held back due to this, as there is a proper and interesting idea underneath the surface. However, the lack of finding these extremely prevalent bugs and glitches lead to this being one of the worst selling titles in the Sonic franchise.

This goes to show why testing and quality assurance is so important, even in the gaming field. Video Games are software after all, just specifically for entertainment and enjoyment.

I specifically wanted to cover this for this class because it shows me why making sure the testing is as fluid as the programming to create a perfect product. This is especially true in the gaming field, which I hope to have a future in.

Needless to say, I don’t own my own copy anymore. I snapped my PlayStation 3 disc a long time ago. And months after I got it, I did end up getting LittleBigPlanet, and played it way more than this travesty.

tl;dr dont get the game in bargain bin.

From the blog CS@Worcester – You're Telling Me A Shrimp Wrote This Code?! by tempurashrimple and used with permission of the author. All other rights reserved by the author.

Being the Least Skilled: Good or Bad?

The “Be the Worst” pattern advises individuals to seek out environments where they are not the most skilled or knowledgeable. Instead of always aiming to be the best, this pattern encourages embracing discomfort and challenges that come with being the least skilled person in the room. By immersing oneself in such environments, individuals can experience accelerated growth, learning, and personal development.

The “Be the Worst” pattern has profoundly impacted my perspective on professional growth and skill development. It challenged me to rethink the notion of always striving to be the best and instead highlighted the immense value in stepping into situations where I may feel inadequate or outmatched.

What resonated with me the most about this pattern is its emphasis on humility, openness to learning, and the willingness to embrace discomfort. It acknowledges that growth often occurs outside of one’s comfort zone and that being the least skilled person in a group can be a powerful catalyst for improvement.

This pattern has caused a significant shift in how I approach my intended profession as a software developer. Instead of seeking validation from being the best, I now prioritize seeking environments where I can learn the most, even if it means initially feeling uncomfortable or challenged.

One aspect that I found particularly thought-provoking about this pattern is its recognition of the importance of humility in learning. It encourages individuals to set aside their ego and embrace the learning process fully, regardless of their current skill level.

While I wholeheartedly agree with the premise of the “Be the Worst” pattern, I also recognize the importance of finding a balance. It’s essential to have supportive environments where one can leverage their strengths while still being pushed to grow and improve.

“Be the Worst” pattern has inspired me to embrace challenges, seek out learning opportunities, and approach skill development with a mindset of continuous improvement. It has reshaped my perspective on professional growth, emphasizing the value of discomfort and humility in the journey towards mastery.

From the blog CS@Worcester – Hieu Tran Blog by Trung Hiếu and used with permission of the author. All other rights reserved by the author.

Week 7 blog

HI everyone, welcome back to my blog. In this post, I will be talking about two patterns from the apprenticeship patterns book that was provided to us in the beginning of the semester. We will be going to go more in depth about how you should reflect as you work and how to record as you work, which I think goes hand in hand in my opinion. First, let’s talk about recording what you learn. There is this saying that my dad always used to tell me was that those who don’t learn from their mistakes are the ones doomed to repeat it. There are a lot of things that you can do to help you with that. For example, you can start recording your journey of what worked and what doesn’t in a sort of blog or personal journal. I know some people who write those things down and never go back and read them ever, what’s the point? Don’t just write it down, try to think about it and review it later, just to freshen up. You never know, you might discover something new or old that will help you and will help you avoid making the same mistakes again. I personally do not write anything down and I have a terrible memory, so I should probably start writing things down, and it will help me get better by giving myself something to look forward to and learn from.

The second pattern I want to go over is the ability to reflect as you work. Ask yourself questions, like how did I get here or how can I improve? It doesn’t have to be questions about yourself, you can say how can we improve as a team? This will make you observe and reflect on things about yourself and the environment around you. I believe that this goes hand in hand with the first pattern because you can observe yourself and ask questions regularly and then write the conclusion down of what you have learned from this experience. Personally, I will start my own daily private journal so I can be constructive with myself and honest to try and improve my everyday life.

From the blog CS@Worcester – Farouk's blog by afarouk1 and used with permission of the author. All other rights reserved by the author.

The Happy Path

Testing code and software can come in many different forms, some may be better than others. In this post, we will look at path testing, or happy path testing. Path testing is representing your code in a linear graph, using nodes and arrows. The nodes represent lines of code, and the arrows dictate the flow of the code or program. It’s a fairly straightforward way of testing, depicting how you want your code to flow, and how the code actually flows. It can help you visualize the execution of your program.

In this blog post, it talks specifically about happy path testing, which is described as “a technique that tests the application through a positive flow to generate a default output,” or “a type of software testing that focuses on the most common and expected scenarios that a user will encounter when using an application.” Essentially, it allows you to see how your code executes in a typical environment. In the blog post, the example of an online shopping site is used, where the typical flow would be a user visiting the website and browsing through the products, adding some products to their cart and going to checkout, entering their shipping address and payment details, and finally finally receiving a confirmation and an email. That’s the happy path the website takes when a normal user goes to shop. This kind of testing ensured that nothing wrong occurred when it came to a normal execution. This is the same thing that happens when applying this testing strategy to your code, going through your code in a normal, typical situation and making sure you will not run into bugs and errors. Some steps to perform happy path testing effectively would be defining the scope and objectives of the testing, designing the test cases and scenarios, executing the test cases and scenarios, analyzing and reporting the results and outcomes, and fixing and retesting the issues and defects. The post also talks about the opposite of happy path testing, and some challenges when it comes to this kind of testing, such as overlooking negative and edge cases and relying on the happy path as a final verdict.

Although happy path testing is an effective testing strategy, it only covers the main part of your code, leaving some areas vulnerable to possible bugs and errors that may not be picked up or detected. But even with that, this is good for an initial testing strategy. It allows you to confirm that your code works as intended and expected when it comes to the most common scenarios of your code. Personally, I’m a fan of this kind of testing, being able to visualize the way my code works is nice. However, I know its limits and when it is effective and when it is not.

From the blog CS@Worcester – Cao's Thoughts by antcao and used with permission of the author. All other rights reserved by the author.

Success Begins By Sweeping The Floor

In the Software Development industry, every journey begins with a step forward and is often in the form of menial tasks. The Sweeping the Floor pattern emphasizes the importance of starting off small and embracing humbling tasks as a newcomer to a team. This means volunteering to do simple yet essential tasks to help contribute to the team’s overall success and grow as a developer. These tasks may not seem as exciting, but they help form the backbone of the team and provide valuable learning opportunities.

While learning more about the pattern, I found myself reflecting on my own experiences. This pattern brings up the idea that we should try to tackle not just simple tasks, but challenging ones as well. This helped me realize that regardless what our level of knowledge is, every contribution matters and serves as a stepping stone towards future accomplishments.

In a field that is often associated with complexity and innovation, I found it interesting for a pattern to highlight the importance of starting from the ground up and acknowledging that mastery is a journey that comes with time, rather than a destination. Also, by taking on tasks within our teams, we are gaining additional knowledge. The patterns focus on filling knowledge gaps through hands-on experience and learning underscores the importance of practical learning in the field.

Sweeping the Floor has led me to reevaluate my approach to the field. While I have always recognized the importance of continuous learning, this pattern has reinforced the idea that no task is beneath us as craftsmen and apprentices. This helped inspire me to contribute more to any team I’m on, even if it means taking on some of the more challenging tasks.

While I agree with the message of the pattern, I believe there’s a fine line between taking on humbling tasks and being pigeonholed into a role with limited growth potential. I believe it is essential to seek opportunities for growth and development beyond just menial tasks. While Sweeping the Floor is a part of the apprenticeship journey, it’s also crucial to strike a balance and demonstrate knowledge for more significant challenges and roles within a team.

With this being said, the Sweeping the Floor pattern can serve as a reminder that with dedication and continuous learning, we can follow our own paths to mastery. By embracing the humbling tasks from the beginning rather than pushing them away, and reaching for various opportunities for growth, we as apprentices can then lay a solid foundation that’ll set us up for success in the future.

From the blog CS@Worcester – Conner Moniz Blog by connermoniz1 and used with permission of the author. All other rights reserved by the author.