Category Archives: CS@Worcester

Legacy Tests : A Problem From Mindset

The blog post “What Do You Fix When You Fix a Test?” by Joep Schuurckes explores the nuanced decisions developers and testers face when a test fails. The central question is whether the issue lies in the test itself, the code under test, or possibly even the expectations behind the test. Schuurckes starts with bringing up the topic of legacy tests, legacy test code that makes “more decisions about what and how things are tested than the team.” He encourages readers to reflect before blindly “fixing” a test by editing it to pass again. This is what he calls “tests-as-code” where the developer is trying to change the code of the test so that it passes rather than treating it with the mindset of “tests-as-code”. “Tests-as-code” would be where the developer looks at a failing test as an information dump where each test returns some kind of data and thus any changes must preserve that data return. Part of keeping tests as code is keeping to a naming scheme so that each test is obvious in what you are expecting as a return which is the exact same thing I was taught in class, but now I understand the reasoning a bit more.

This post made me rethink what it means to “fix a test.” I’ve been guilty of tweaking test code just to get everything green in the test runner again, without stopping to think whether the test was telling me something important. Joep’s approach feels like a call for discipline and care in testing—treating tests as important resources in the codebase rather than disposable tools. The idea that tests should be maintained with this way of thinking resonated with me, especially since I’ve seen how neglected or misleading tests can erode trust in automated test suites.

Going forward, I want to adopt a more mindful approach when a test fails. Instead of rushing to “fix” it, I’ll start by asking why it failed. Is the requirement outdated? Is the test too brittle? Has the functionality truly changed? Also, I want to be more deliberate in writing tests—designing them to clearly document behavior and to be resilient against irrelevant changes. This is especially relevant for integration tests, which are often more vulnerable to external factors and instability. By treating each failed test as an opportunity to learn, not just a checklist item to resolve, I hope to contribute to codebases that are easier to maintain and trust.

source :
https://smallsheds.garden/blog/2024/what-do-you-fix-when-you-fix-a-test/

From the blog Coder's First Steps by amoulton2 and used with permission of the author. All other rights reserved by the author.

Testers Aren’t Developers ! Their Role Is There for a Reason

The article “The Difference in Perspective of Testers and Developers” by Vijay provides a comparison of how software testers and developers approach software QA and testing. Developers are often focused on building features that work as intended, with an optimistic mindset geared toward implementation. Testers, on the other hand, adopt a critical mindset, aiming to uncover flaws, edge cases, and unintended consequences. The article explains that while developers ensure that the software does what it’s supposed to do, testers ensure it doesn’t do what it’s not supposed to do. This difference in thought processes is not a conflict but a complement to creating robust, reliable software. The article encourages improved collaboration, mutual respect, and open communication between these roles to produce higher-quality software.

Reading this article gave me a better understanding of how vital both roles are in the software development lifecycle. As a CS student who has done more programming than testing, I’ve often written code with the assumption that if it runs without errors and produces the expected result, it’s good to go. But throughout my QA and Testing class, through reading different blogs, I now see how much that perspective misses. I haven’t always taken the time to think about how a user might unintentionally (or maliciously) use the software, or how fragile assumptions can be unless they’re tested thoroughly. It’s easy to feel like bugs are personal flaws, but this article helped me appreciate the tester’s role and the stark difference in mindsets because I truly saw testing as just another tool in the developer toolkit and not as the fully fleshed-out role it is.

This new understanding is something I plan to apply in future group projects. I want to make a conscious effort to invite feedback from teammates who are testing my code, and more importantly, not take that feedback defensively. I also want to improve my own testing practices by thinking like a tester during development. That means writing unit tests that go beyond the “happy path” and trying to break my own code before someone else does. In larger projects, I now see the importance of collaboration between testers and developers early in the development process, rather than waiting until the end to start thinking about quality. Encouraging open communication can lead to better designs and fewer bugs downstream.

source:
https://www.softwaretestinghelp.com/the-difference-in-perspective-of-testers-and-developers/

From the blog Coder's First Steps by amoulton2 and used with permission of the author. All other rights reserved by the author.

Dataflow testing overview

White box testing includes the use of all of a program’s internal structure to your advantage in the testing phase. A component of this internal structure that usually makes up a small percentage of the code body, but can contribute to the most amount of problem cases, are variable/data type declarations. Testing for these cases is called dataflow testing. In the blog, “All about dataflow testing in software testing”, by Prashant Bisht, the author details how dataflow testing would be implemented, and some examples of how it might look.

The implementation of dataflow testing, before any interaction with the code is done, is first executed with a control flow graph, which tracks the flow of variable definitions and where they are utilized. This type of organization allows for the first important internal component of dataflow testing, the tracking of unused variables. Removal of these unused variables can help narrow the search for the source of other problem cases. The second anomaly commonly testing for in dataflow testing is the undefined variable. These are more obvious than unused variables, since they almost always produce an error, due to the program relying on non existent data. The final anomaly tested for is multiple definitions of the same variable. Redundancy that can be introduced by this anomaly can lead to unexpected results or output.

Subtypes of dataflow testing exist, and are specialized to test different types of data. For example, static dataflow testing is the tracking of the flow of variables without the running of the tested code. This code only includes the analysis of the code’s structure. Another example, dynamic dataflow testing, focusing only on how the data relating to variables changes throughout the code’s execution.

To show how dataflow testing would work in practice, the author provided an example. This example concerns variables num1, num2, and num3. First, initialization of these variables is checked, i.e. if num1 is initialized as int nuM1 = some_int, the testing phase would catch this. Then, it ensures that the use of these variables don’t cause errors. This depends on program specifications, like if the program is meant to add each variable. The data flow is then analyzed, ensuring that operations including multiple variables are functioning properly. i.e. if num1 + num2 = result1, and num2 + num3 = result2, the dataflow phase would ensure that the operation result1 + result2 = result3 is functioning properly (though result3 being defined is a problem that would be handled by the first phase). The final phase is the data update phase, where the values of operations are verified to be what they’re expected to be.

From the blog CS@Worcester – My first blog by Michael and used with permission of the author. All other rights reserved by the author.

Benefits of gray box testing

In many software testing situations, white box testing, where the internal code of what is being tested is visible to the tester, and black box testing, where the internal code of what is being tested isn’t visible to the tester, are some of the most often used methods. However, integrating elements from both methods into a single testing method is slowly seeing more widespread use, also known as Gray box testing. In the blog “Exploring gray box testing techniques” by Dominik Szahidewicz, the author details different examples of gray box testing, and the benefits of those examples compared to the use of only white or black box testing.

Gray box testing has noticeable benefits that are absent from both white and black box testing. By the using the principles of white box testing (internal structure and design) and of black box testing (output without the context of internal structure), the testing process can be robust and able to account for any problem case.

A specific testing example where gray box testing can be implemented is pattern testing, where recurring patterns are leveraged to improve programs. With the use of gray box testing, the internal structure of the software can be related with the output to create more helpful and efficient test cases.

Another testing example where gray box testing can be implemented is orthogonal array testing, where data for testing is organized into specific test cases. This method is commonly used where exhaustive testing using every possible input is unreasonable because of the amount of inputs. By using the internal structure of the program and the outputs of the program, more efficient test cases can be created.

A basic guide as to how to implement gray box testing includes 4 steps detailed by the author. The first step of of the implementation is acquiring system knowledge. This includes documenting the internals available for use in testing, as well as the available documentation of outputs from the tested program. The second step is to define test cases according to known information and specifications. The third step is the use of both functional and non functional testing. The fourth step is to analyze the results of testing.

From the blog CS@Worcester – My first blog by Michael and used with permission of the author. All other rights reserved by the author.

My Perspective on Risk Based Testing in Software Quality Assurance

As a computer science student getting more into the details of software development, I’ve started to realize how much goes into making sure software actually works the way it’s supposed to. I recently read the article “13 QA Testing Best Practices For 2024” from Testlio, and one part that stood out to me was the idea of risk based testing.
(testlio.com)

Risk based testing is all about using your time and effort wisely. Instead of trying to test every single feature equally, it focuses on the stuff that matters most. You look at what parts of the app are most likely to break or cause problems for users if they fail. Then you make sure those are tested thoroughly before anything else.

The article explains that identifying risky areas early helps teams put their energy in the right place. If you’ve only got so many people and so much time, this method helps avoid wasting those resources. It also means the most important features are solid by the time the app goes live.

This reminded me of a group project I worked on where we made a class management web app. We spent way too much time testing features like color themes and user bios. But when it came to the assignment submission tool, which was probably the most important part, we barely tested it. Sure enough, after we deployed it, users had issues uploading their files. If we had used risk based testing, we probably would’ve caught that.

Now that I know about this approach, I’m going to start using it in future projects. I’ll take time up front to figure out which features are most essential or most likely to go wrong, and make sure we focus testing there first. It’s a simple idea, but it makes a big difference.

In the end, risk based testing is about being smart with your time and making sure what matters most actually works. If you’re also learning software testing, this is a great thing to start thinking about. I definitely recommend checking out the full article if you’re curious:
13 QA Testing Best Practices For 2024

From the blog Zacharys Computer Science Blog by Zachary Kimball and used with permission of the author. All other rights reserved by the author.

DYNAMIC TESTING

https://www.geeksforgeeks.org/software-testing-dynamic-testing/

For this blog I chose to focus on Dynamic Testing. Otherwise known as functional testing, this is a way of testing the function of the code. I chose an article from the site Geeks for Geeks to help learn more about certain aspects and methods of functional testing. I chose this article because I wanted to expand on the benefits of dynamic testing past what we learned with unit testing in class. Dynamic testing is a crucial component of software testing that involves executing a program to assess its behavior under various conditions. Unlike static testing, which inspects code without running it, dynamic testing validates the software’s functionality, performance, and reliability in real-time execution environments. This approach helps uncover errors, bugs, and unexpected behavior that may not be visible through code inspection alone.

The article highlights different aspects of dynamic testing, including verifying that the system performs as expected, ensuring data accuracy, identifying performance bottlenecks, and confirming the application’s scalability and security. It is implemented across various levels of software development such as unit testing, integration testing (testing interactions between components), system testing (validating the full system), acceptance testing (evaluating readiness for deployment), performance testing, and security testing.

When it comes to quality assurance, dynamic testing plays a vital role by confirming that the software meets both functional and non-functional requirements. It ensures that the software is not only working correctly but also performs efficiently under different conditions. This leads to higher user satisfaction and reduced risk of failure in production environments.

As a new software engineer, adopting dynamic testing practices early can significantly enhance my code quality and development skills. In class we started by focusing on unit testing, as the article suggests, in order to verify the functionality of individual components. From there, the next step is incorporating integration and system-level tests to ensure that different modules work together seamlessly. The article was helpful by noting different automated testing frameworks like JUnit, pytest, or NUnit that can streamline the entire process. Additionally, understanding performance and security testing helps build more robust applications. This can even tie into a previous blog post I have written about Test Driven Development by  further encouraging writing clean, testable code from the outset.

 As an aspiring web developer, dynamic testing is especially important because it ensures that web applications function correctly and reliably in real-world scenarios where user interaction, data flow, and system integration are constantly at play; helping web developers build faster, safer, and more reliable applications that meet user expectations across platforms and devices.

From the blog Anna The Dev by Adrianna Frazier and used with permission of the author. All other rights reserved by the author.

TEST AUTOMATION

Today’s blog post is about test automation. I chose to use a youtube video created by the YoutTube channel “Testopic”. In this video, Testopic goes over the importance of automated testing as well as the when it’s warranted, the pros and cons, and a demonstration on how it works using a certain automated testing platform. I chose this topic because it is directly related to the material that we are learning about in class when it comes to testing code. I also chose this because we have not touched much on automated testing with in class activities and I wanted to expand my knowledge on this topic. 

This video was very helpful because I was able to learn about the best ways to integrate automated testing and understand that it is not always indicated in all aspects of testing; in fact it is sometimes less efficient. Since automation is run by a machine and, once implemented, can be very fast, it is best to utilize it in scenarios that test on smaller units of code that needs to be tested repeatedly. This is best applicable to unit testing, where developers need to test small components of the larger project individually. Since the components are smaller it is easier on the tester to teach the machine how to test the code. Teaching the machine is part of the upfront time that goes into test automation; this upfront time is elongated when attempting to test larger sections of code such as with integration testing and end to end testing. Using automation with testing this level of code will take up too much upfront time and take the machine longer to run repeatable tests. When using automation with integration or system testing, it will also require more maintenance when a smaller component is changed.  

Learning about automation testing not only helps expand my knowledge on the course work but will also help me in my personal endeavors. As an aspiring web developer, I will need to learn how to test small aspects of my site and learning how to automate those will be very helpful. The benefit of this was shown in the video where the youtuber demonstrated how he used Selenium to demonstrate automated testing with the way google connects a search result to a certain chosen link. I will be able to use some of the methods seen in this video to help with future projects this summer. 

From the blog Anna The Dev by Adrianna Frazier and used with permission of the author. All other rights reserved by the author.

My Experience with Software Testing and My Future: A Reflection

Photo by ThisIsEngineering on Pexels.com

I never thought software testing would teach me many new things. I had experience with it in a previous college I attend. So when transferring, I assume I would relearn a lot about what was taught. Now after experiencing the class I realize my previous lessons were a mere microcosm compared to the vast methods of testing. Which makes sense as my testing back then was done out of necessity and as a way to auto grade my assignments. I won’t go too deep in the past, as today I will discuss the present and my future instead.

Hi, this is Debug Ducker, and I want to tell you what I have to learn about software testing. I would also like to share my thoughts and feelings on my upcoming graduating and my future in computer science. I hope you enjoy.

Now software testing is more than just testing, there are methods to it, different ways to approach it. One approach I didn’t really understand until later was black box testing. Basically, you don’t see the code, but you still run it. My first thought was, “Wow, that doesn’t make sense to me”. Why would I test something that I can’t see. Then after a while I understood perfectly. You don’t have bias when you don’t see the code. The developer has an idea how the software works base on what they write, so there is a possibility that they didn’t account for something. A person who wouldn’t know what the code looks like could test best on assumptions, and could find flaws without bias. QA testing does this regularly, and I understand why it helps developers save time.

Why I feel this is important because it opens my eyes to a lot of things about software testing and how useful they can be. Node path to see how the code progresses and to spot potential issues based on the structures of the code. The many range testing methods that can help detect potential functionality issues and see what needs to be tested or not. There is so much to share but so little time.

I have learned a lot and hope to use this knowledge for the future. Speaking of which, what about my future. Well, I think that is hard to say. Once I graduated, I plan to apply to some software development positions and see what happens. This is a very strange moment in my life. Like I am reaching a major conclusion. I can only see a small part of what life has for me, and I hope they are good and without issue. I just have to apply all my skills that I have learn throughout my four years in college and hope I succeed.

Thank you for your time.

From the blog CS@Worcester – Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Manual Versus Automated Tests

Manual and automated testing are the two ways to run tests. One involves human touch while the other needs very little from a third party to work. While one would think automated testing is better in almost every case. That’s not necessarily true. To start, in most cases automated tests are just better. They are more efficient and save people a lot of time. They can be run over and over again. And can be run every time code is pushed, instead of having to be manually runned. Oftentimes the only times manual testing is useful is when things are tested for use by humans. Meaning things like testing how an app feels to use or how the functions in practice. These areas require testing things that are hard for a computer or code to test.

Manual testing can be more cost effective depending on the circumstances. But manual testing is also subject to more error due to the nature of human involvement. Tests are more adaptable because they can be changed more easily. While automated tests being changed might take more time to change to make sure they work with the code. Automated testing offers more coverage since they can be made small and can cover various areas of coding. Automated tests can also handle larger test cases that span over a large area. While manual testing struggles to handle something so large. Overall I’d say that automated tests seem better to use in general. Aside from things like testing for human feel, automated tests seem to handle most things better.

https://www.testrail.com/blog/manual-vs-automated-testing/

From the blog CS@Worcester – Code Craft by Kyle Tucker and used with permission of the author. All other rights reserved by the author.

The Importance Of Security Testing

Security testing is a major area of testing that is very important. In today’s world, security is imperative to a softwares effectiveness. Without security software will be targeted and used against people. The cost of data breaches result in humongous money loss. Some of the goals in security testing is to find weakness in code, finding the impact of security breaches, report findings, and eliminating risks. Some of the principles of security testing is having realistic tests that test real world applications. Tests that are through and wide spanning. Continuous testing because the nature of security and attacks is always changing. Testing should be a collaboration of all parties involved in the software development process.

We always hear on the news about data breaches for some company that cost billions of dollars. It’s hard to put into perspective how much money that is and how that actually affects people. The security of software has real world consequences on people. It’s not something to take lightly. We have to protect software in order to protect the people using it. It’s just as important as testing to make sure the software works. In the blog it said that negligence in security breaches leads to a higher fine. Which makes sense since if you willingly ignore security breaches you’re putting peoples livelihoods at stake, not just at the company. There are many different areas to security testing. API testing, HTTPS, Cloud, basically any area that requires communication is subject to hackers. 

https://fluidattacks.com/blog/security-testing-fundamentals/

From the blog CS@Worcester – Code Craft by Kyle Tucker and used with permission of the author. All other rights reserved by the author.