Category Archives: CS-443

Another Look at Boundary Value Analysis and Equivalence Class Partitioning

Recently in CS443 – Software Quality Assurance and Testing we’ve been learning some of the conceptual aspects of code testing that are required to identify the relevant points of programs to test as likely break points. We’ve primarily learned about Boundary Value and Equivalence Class testing strategies, so I decided to find a blog to learn more about each of these from a third-party perspective. I landed upon a (relatively) recent blog on TestSigma – a (automatic) testing platform – from June 2023.

The post discusses the overall importance of software testing in ensuring functionality and reliability of software products focusing on the defining aspects of the two methods we’ve been learning: ‘Bound. Value Analysis’ (BVA) and ‘Equiv. Class Partitioning’ (ECP). BVA concentrates on testing the boundaries of a system to identify vulnerabilities, while ECP groups similar items into equivalence classes, helping testers target specific areas with a higher likelihood of containing bugs.

Benefits of applying BVA and ECP in software testing include improved understanding of the system, simplified test design, better test coverage, prioritization, and risk management. The applications of these techniques extend to various scenarios, such as database testing, network testing, hardware testing, time-based functionality, and UI testing. An interesting point that the article emphasizes is that BVA and ECP are often used together, providing an example of testing a form that accepts age as a number. It suggests partitioning the age range into groups for more effective testing while also considering likely break points.

Common challenges discussed to avoid when using BVA and ECP include restricting testing to input values alone, making assumptions about limits and classes, ignoring user behavior, over-relying on these techniques, and neglecting edge cases. The post concludes by comparing BVA and ECP, highlighting their differences in testing approaches and summarizing them as thought processes that enhance testers’ understanding of the system, leading to improved test coverage and strategy.

Test automation for BVA and ECP using tools like TestSigma (or other softwares) is also discussed, highlighting the potential benefits of saving time, ensuring accuracy, and achieving better test coverage. However, the decision to automate tests should be made considering the cost and benefit of automation and set-up.

Overall, this post taught me some interesting differences between BVA and ECP as well as reinforcing the benefits and basics we learned in class. One interesting aspect of this blog that I noticed in review is that it was written by author Apoorva Ram, a non-white woman in the computer science and specifically software engineering industry. This demographic represents a sparse minority in the computer science field and worth recognizing alongside their contribution with this and other blogs.

Sources:

https://testsigma.com/blog/boundary-value-analysis-and-equivalence-class-partitioning

From the blog CS@Worcester – Tech. Worth Talking About by jelbirt and used with permission of the author. All other rights reserved by the author.

Mastering Advanced Unit Testing: Test Doubles and Code Coverage for Beginners

As developers, writing robust, reliable code is a top priority. And when it comes to ensuring the quality of our codebase, unit testing plays a pivotal role. However, as we delve deeper into the realm of unit testing, we encounter advanced concepts like test doubles and code coverage, which might seem intimidating at first glance. But fear not, for in this beginner’s guide, we’ll demystify these concepts and explore why they are essential for writing high-quality code.

Understanding Test Doubles

Test doubles, also known as mocks, stubs, or fakes, are objects used in place of real dependencies in unit tests. They simulate the behavior of these dependencies, allowing us to isolate the code under test and verify its interactions with its collaborators.

For instance, imagine you’re testing a class that relies on an external API. Instead of making actual API calls, you can use a test double to mimic the API’s responses, ensuring your tests run swiftly and independently of external factors.

Test doubles help in:

  1. Isolation: By replacing real dependencies with test doubles, we can focus solely on testing the behavior of the unit under scrutiny without worrying about the intricacies of its collaborators.
  2. Speed: Since test doubles operate in-memory and don’t involve external resources, tests run faster, contributing to quicker feedback loops during development.
  3. Determinism: Test doubles allow us to create predictable test scenarios, ensuring consistent and reliable test results across different environments.

Code Coverage

Code coverage measures the proportion of a codebase that is exercised by automated tests. It provides insights into areas of code that lack sufficient test coverage, enabling developers to identify potential bugs and improve overall code quality.

While achieving 100% code coverage doesn’t guarantee bug-free software, it serves as a valuable metric for assessing the thoroughness of our test suite.

Code coverage aids in:

  1. Identifying Untested Code: It highlights parts of the codebase that lack test coverage, prompting developers to write additional tests for those areas, thus reducing the likelihood of undetected bugs.
  2. Improving Confidence: Higher code coverage instills confidence in the codebase, indicating that most critical paths and edge cases are adequately tested, thereby reducing the risk of regressions.
  3. Refactoring Safely: With comprehensive test coverage, developers can refactor code with confidence, knowing that any unintended changes are likely to be caught by existing tests.

In conclusion, mastering advanced unit testing techniques like test doubles and code coverage is crucial for any developer striving to deliver high-quality software. By leveraging test doubles, we can isolate units under test, while code coverage empowers us to assess the thoroughness of our test suite. Incorporating these practices into our development workflow not only enhances code quality but also fosters a culture of test-driven development, ultimately leading to more robust and maintainable software.

For further reading, check out this article from Christian Findlay on writing testable code and its importance in software development. Happy testing!

From the blog Discoveries in CS world by mgl1990 and used with permission of the author. All other rights reserved by the author.

Path Testing Demystified

Hello, It’s me, your favorite computer science student ready to once again complain about the career path I chose myself.

Today’s menu of minor headaches (I’ve got to stop using this) consists of Path Testing, which is the same as checking every corner of your room for monsters before going to bed to ensure your beauty sleep doesn’t get interrupted.

Imagine you’re playing a video game where you choose paths to reach the exit of a maze. Some paths are straightforward, others are mazes with obstacles. Path testing is the same principle but with your code. You need to check every route your code can take to catch bugs hidden off the beaten path.

Think of your code as a map, with each part representing a stop or a crossroad. The goal is to explore all the stops and paths without an endless journey. We use a Control Flow Graph as a map for your code to ensure that we are not missing any hidden detours.

To implement Path Testing you only need to follow a few key steps:

  1. Create the Control Flow Graphs: This graph maps out all the possible routes through the program.
  2. Calculate Cyclomatic Complexity: This metric is the guide for the number of test cases needed for adequate coverage.
  3. Identify Independent Paths: Determine the set of paths that cover all the edges and nodes in the graph.
  4. Design Test Cases: Create test cases that will traverse each identified path.

That’s pretty much it.

Now you may say “But Ano why even bother with Path testing?”. Well, Path Testing is your code’s ultimate test drive. It uncovers sneaky bugs that hide in specific conditions and gives you a deep understanding of your code, making it easier to add features without issues.

And yet there is a catch. While Path Testing may be great, it can also be tricky for complex apps. Trying to test every path can feel like planning a road trip to Mars. The key is to smartly select which paths to test, covering as much ground as possible without getting lost in the details.

Just like our previous entry on software testing, Path Testing is another secret weapon for robust code. It’s meant to bring you peace of mind, ensuring your app or program performs without any flaws. So, before you deliver or push your code, be sure to take it on this essential road trip that guarantees your code does what it is supposed to.

Till next time,

Ano out.

References:

https://www.geeksforgeeks.org/path-testing-in-software-engineering

https://www.guru99.com/basis-path-testing.html

From the blog CS@Worcester – Anairdo's WSU Computer Science Blog by anairdoduri and used with permission of the author. All other rights reserved by the author.

Black Box Testing

https://www.practitest.com/resource-center/article/black-box-vs-white-box-testing/#:~:text=The%20Black%20Box%20Test%20is,is%20carried%20out%20by%20tester.

Black box testing is a genre of testing which does not take a codes functionality into consideration, in other words the internal workings of the code are not known to the test and the tests are formed strictly by external workings. This is very different from white box testing as white box testing operates under the idea that the ‘tester’ has extensive knowledge of how a system was created along with its inner workings. Some of the differences between black and white box testing are black box testing is carried out by ‘tester’ while white box testing is left to software developers, black box testing is considered behavior testing while white box testing is considered logic testing and black box testing is typically used in system testing while white box testing is used in unit testing. There are also ways in which these two types of testing are similar which is mainly their purpose which is to ensure that a system is working correctly and that you have the best version of the software available.

I chose this article because I liked how it not only explained black box testing but it also compares black box testing to white box testing in order to allow a deeper understanding of the relationship between the two types of testing. I am very interested in seeing how different methods of black box testing work as for the most part we have been practicing with white box testing methods in class so far this semester so the concept of testing without extensive knowledge of a system or without access to the systems internal workings and code seems both interesting and challenging to me. 

With there being a large gap in knowledge of a system between the two different types of testing it seems as though black box testing is something that is done by others not necessarily full blown software developers as developers are expected to spend their time on white box testing so It makes me wonder how exactly these tests are written and how specific results may be measured for success compared to the more straightforward nature of white box testing. Since black box testing can be used for just about every type of testing, even some of the sames types of testing white box is used for it would be nice to see and compare how tests are carried out for both types of testing on a similar component of a system in order to differentiate the information used by each type.

From the blog CS@Worcester – Dylan Brown Computer Science by dylanbrowncs and used with permission of the author. All other rights reserved by the author.

The Logic of Software Testing

Hello everyone,

Although we have been studying software testing for a few weeks, I still want to talk about the “logic” of software testing. Because I think it’s important, to test software comprehensively, we must understand the “logic” of testing. So I want to share a blog with you today:

“What is the Underlying Logic of the Software Testing? ”

by ZenTao 3

Link: https://www.zentao.pm/blog/underlying-logic-of-the-software-testing-1-1249.html

As a student new to software testing, I find the topic of test logic particularly interesting. Recognizing its critical role in ensuring software reliability and functionality, I sought out some resources that could help me develop an understanding of the underlying logic behind the testing process. This blog post does a great job of explaining this to me, providing insight into the complex mechanisms that support effective software testing.

In the first chapter of the article, we learned about the basic requirements for software testing:

  • Software testing is to verify whether the functional characteristics of software meet the requirements;
  • Software testing is to find the defects in the software;
  • Software testing includes static testing – requirement, design, and code review
  • Software testing is to systematically and completely evaluate the quality of software products and provide quality information;
  • Software testing is to expose and reveal product quality risks;
  • Software testing is not only a technical activity but also a comprehensive social and psychological activity;
  • Software testing is to greatly reduce the cost of poor quality by investing in quality assurance costs.

These guidelines will play an important role in our future software testing path. All our testing will be conducted based on these guidelines. Also, article mentioned “based on the understanding of the real needs of users, to obtain the true and comprehensive quality information of software products through various means.” If we become professional software testers in the future, during the testing process, we must Always ask yourself if you are being comprehensive.

What impressed me most was the second chapter in the blog: The Underlying Logic of the Software Testing. And its three questions:

  • Why?
  • What?
  • How?

Why: Because humans are not machines, even machines can make mistakes, so human work will inevitably lead to errors and imperfections due to some reasons (personal habits, time, abilities, etc.).

What: Be clear about the goals, scope, and specific data of the test. Prioritize your testing and do not do tests that are not relevant to your goals.

How: Sometimes obtaining existing test data will help us speed up and improve the efficiency of testing.

Overall, this blog is a great foundation for software testing. During our testing process, we need to ask ourselves whether the above problems have been solved.

From the blog CS@Worcester – Ty-Blog by Tianyuan Wang and used with permission of the author. All other rights reserved by the author.

Code Reviews

Reviewing your code is important, it makes sure that the code is correct and functions the way you want it to. Code review helps cover so many areas of your code. You want to make sure that your code is understandable for anybody else who looks at it and that it’s clear, by reviewing your code you can go back and fix anything that could be making your code more complicated. Code reviewing is important when working with a team, your team should understand what your code is trying to execute without being confused. When it comes to coding so much of your work can change throughout the process which is normal but with so many changes happening it can get confusing. Code reviewing comes with so many different solutions when it comes to writing code it nitpicks what parts are important or not. It’s a helpful tool that helps coders make sure they have clean code and that when working with a team everyone’s comments are heard and changes are made.

Code reviews can be tough if the team isn’t together so questions and comments can’t be answered. Another thing is that the code could be overlapping, and missing a team meeting could affect the code and confuse team members about what they should be writing ending up in similar code. If that happens the next person reviewing the code will find duplicate code and will end up pushing the team’s work behind. Making sure your team communicates will help prevent more code from having to be fixed and reviewed even though you don’t want to add more work on top of what you already have. Code review makes sure your work is good quality and organized. Having sloppy issues and mistakes doesn’t look good for you, your team, and your job. Code review is about making sure your work is organized and clean, you want to make sure you put out good work without having a lot of issues. Especially as a team you want to meet those standards and follow them. Always make sure to review your code because there could be small errors or even confusing comments that will make your code more complicated than it needs to be.

https://blog.pragmaticengineer.com/good-code-reviews-better-code-reviews/

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

Cultivating Insight: “Reflect As You Work” Week-5

Introspection in Action:

The “Reflect As You Work” pattern, from “Apprenticeship Patterns” by Dave Hoover and Adewale Oshineye, emphasizes the importance of ongoing reflection during your software development journey. This pattern encourages developers to continually assess their experiences, decisions, and outcomes. It’s about developing a habit of introspective thinking that allows you to learn from your actions and continuously improve your skills and approaches.

A Personal Acknowledgment:

While I haven’t yet embarked on a professional software development career, this pattern resonates with me for its universal applicability. Reflective practice is a concept that I find valuable in any learning process. “Reflect As You Work” aligns with my belief in the power of self-awareness and learning from one’s experiences, whether in academic, personal, or future professional settings.

The Power of Self-Reflection:

What stands out to me about this pattern is its focus on the transformative power of reflection. By regularly taking stock of what works and what doesn’t, and why certain approaches succeed or fail, one can gain deeper insights into their work and personal growth. This practice turns every task and challenge into a learning opportunity.

Shaping a Reflective Mindset:

Though I am yet to apply this in a professional context, “Reflect As You Work” shapes how I view future work and learning. It instills the idea that real growth stems from not just doing but understanding and analyzing the process and outcomes of one’s actions. This continuous cycle of action and reflection is what drives deeper learning and skill development.

Embracing Reflection, Balancing Action:

I wholeheartedly embrace this pattern’s message, but I also recognize the need for a balance between reflection and action. Constant reflection should not impede progress or lead to over-analysis. The challenge lies in integrating reflection effectively into the workflow without it becoming an obstacle to productivity.

In conclusion, “Reflect As You Work” is a pivotal pattern for anyone who seeks not just to work in the field of software development but to excel in it. It encourages a mindset where every experience is a source of learning and every challenge is a stepping stone to improvement. This pattern is a reminder that the journey to becoming a skilled software developer is as much about introspection and learning from one’s own journey as it is about acquiring new technical skills.

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

Code Review

For this week’s blog post, I chose the article “Code Review Best Practices – Lessons from the Trenches” by Drazen Zaric. I chose this article because its topic fits perfectly with the cove review segment in the syllabus. This article discusses why you should do code reviews, how code reviews act as quality assurance, how code reviews function as a team improvement tool, how to prepare a pull request for preview, and, of course, how to review code. In this article, I will be discussing why you should do code reviews and how they work as quality assurance.

Reviewing code is one of the most essential parts of the development process. “It should be obvious that the primary purpose of code review is to assess the quality of the changes being introduced. I mean, the dictionary definition of review says precisely that ‘review (noun) – a formal assessment of something with the intention of instituting change if necessary.’ Of course, code being code, there’s a lot of things that can be checked and tested automatically, so there’s nuance to what needs to be checked in an actual code review.” As mentioned in the article, there are many things that can be tested and should be tested. This leads to a need for many people to review your code, and you will need to review many other people’s code to make sure the best possible software is being developed. Quality assurance must be done well as a significant part of making sure your software is the best it can be.

In this section of the blog post, I will discuss how the article mentions how code review is incredibly useful in quality assurance. “There are many ways in which code reviews help maintain the quality bar for the codebase and the product. In the end, it comes down to catching mistakes at a level that can hardly be automatically tested, such as architectural inconsistencies. Also, the code for automated tests should be reviewed, so there’s a meta-level at which reviews help with QA.” As mentioned, code review’s main boon to quality assurance is finding issues that can’t, or often need to be caught, through traditional testing methods, like automated testing. The article also mentions using checklists for storing what needs to be checked and how and what the results of said checks should be. “You can have your own checklist or make it a shared list for the team or a project. There’s a ton of material written on the usefulness of checklists. In Getting Things Done, David Allen puts forward a simple idea – our minds are great at processing information but terrible at storing and recalling it. That’s why checklists are a great way of externally storing and breaking down a planned or repetitive task.” Having a method of keeping track of what is done, what needs to be done, and what is incomplete is essential in working on any large project, let alone on a software development project.

From the blog CS@Worcester – P. McManus Worcester State CS Blog by patrickmcmanus1 and used with permission of the author. All other rights reserved by the author.

Static Testing VS Dynamic Testing

The blog post highlights the qualities as well as the differences between these two types of testing, static testing and dynamic testing. I chose this blog post because as this course covers software quality assurance and testing as well as the fact that we have spent time in class covering these two types of testing I believe that this blog post is able to highlight and reinforce core concepts that will be able to assist in gaining further knowledge withing this class. In addition, the blog post is able to explain the information regarding static and dynamic testing in a simple and easy to understand format that further compliments the idea of using this blog post as a resource to reinforce these topics.

The blog post as previously discussed covers static testing vs dynamic testing. We learn that static testing involves testing the code without actually running it while dynamic testing involves running the code to test it’s outcomes through various testing circumstances. From those two descriptions we can tell how static testing relies on testing through software documentation as well as the design of the code itself. However, dynamic testing is able to execute the program allowing the testers to test how the code will work in an assortment of testing scenarios. This concept allows testers to see how the code will work once it is released to the public to verify that it works as intended. These two types of testing are very different in their methods of achieving a successful test. Static testings wants to identify problems and improve on them early in development while dynamic testing wants to validate the performance and functionality of the code once it is in a executable state. Since they have different intents your requirements for the project is what determines what testing you will choose.

From what I have learned from the blog post I believe it was very helpful and was able to reinforce core concepts that will help me further in this class. I believe learning more about static and dynamic testing will help me when it comes to working in this class as well as assist in knowing how to test in a professional setting. Knowing the core differences between the two will allow me to know what type of testing will be best for certain circumstances when it comes to projects. In conclusion, this blog post was very helpful and will be utilized in the future.

https://testsigma.com/blog/static-testing-and-dynamic-testing

From the blog CS@Worcester – Giovanni Casiano – Software Development by Giovanni Casiano and used with permission of the author. All other rights reserved by the author.

Equivalence Class Testing

A Critical Component of Software Quality Assurance

Equivalence Class Testing stands out as a highly efficient and systematic approach. This blog post delves into the concept of Equivalence Class Testing, its significance in SQA, and how it fits into the broader context of software testing.

Understanding Equivalence Class Testing

Equivalence Class Testing is a black box testing method used to divide the input data of a software application into partitions of equivalent data from which test cases can be derived. An equivalence class represents a set of valid or invalid states for input conditions.

The main advantage of Equivalence Class Testing is its efficiency. Instead of testing every possible input individually, which can be impractical or impossible for systems with a vast range of inputs, testers can cover more ground by focusing on one representative per equivalence class.

Identifying Equivalence Classes

Equivalence classes are typically divided into two types: valid and invalid. Valid equivalence classes correspond to a set of inputs that are expected to be accepted by the software system, leading to a correct output. The process of identifying these classes involves analyzing the software specifications and requirements to understand the input data’s boundaries and constraints.

The Role of Equivalence Class Testing in SQA

Software Quality Assurance encompasses a wide array of activities designed to ensure that the developed software meets and maintains the required standards and procedures throughout its lifecycle. Equivalence Class Testing fits into the SQA framework as a key component of the testing phase, contributing to the overall goal of identifying and mitigating defects.

By integrating Equivalence Class Testing into the SQA process, organizations can achieve several objectives:

  1. Enhanced Test Coverage: Equivalence Class Testing allows teams to systematically cover a wide range of input scenarios, thereby increasing the likelihood of uncovering hidden bugs.
  2. Efficiency and Cost-Effectiveness: By reducing the number of test cases without sacrificing the breadth of input conditions tested, teams can optimize their resources and save significant time and costs.
  3. Improved Software Quality: By ensuring that different categories of input are adequately tested, teams can enhance the robustness and reliability of the software product.

Implementing Equivalence Class Testing

To effectively implement Equivalence Class Testing, teams should follow a structured approach:

  1. Review Requirements and Specifications: Begin by thoroughly analyzing the software requirements and design documents to identify all possible input conditions.
  2. Identify and Define Equivalence Classes: Classify these input conditions into valid and invalid equivalence classes.
  3. Design and Execute Test Cases: Develop test cases based on representative values from each equivalence class and execute them to verify the behavior of the application.
  4. Evaluate and Document Results: Record the outcomes of the test cases and analyze them to identify any deviations from the expected results.

 

I was based to this blog: https://www.celestialsys.com/blogs/software-testing-boundary-value-analysis-equivalence-partitioning

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