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.
Hello everyone, and welcome back to my weekly blog post! This week, we’re diving into an essential software testing technique: Pairwise and Combinatorial Testing. These methods help testers create effective test cases without needing to check every single possible combination of inputs. Similar to most of the test cases selection methods we’ve learned.
To make things more relatable, let’s start with a real-life example from the insurance industry.
A Real-Life Problem: Insurance Policy Testing
Imagine you are working for an insurance company that sells car insurance. Customers can choose different policy options based on:
Car Type: Sedan, SUV, Truck
Driver’s Age: Under 25, 25–50, Over 50
Coverage Type: Basic, Standard, Premium
If we tested every possible combination, we would have:
3 × 3 × 3 = 27 test cases!
This is just for three factors. If we add more, such as driving history, location, or accident records, the number of test cases grows exponentially, making full testing impossible.
So how can we test efficiently while ensuring that all critical scenarios are covered? That’s where Pairwise and Combinatorial Testing come in!
What is Combinatorial Testing?
Combinatorial Testing is a technique that selects test cases based on different input combinations. Instead of testing all possible inputs, it chooses a smaller set that still covers key interactions between variables.
Example: Combinatorial Testing for Insurance Policies
Instead of testing all 27 cases, we can use combinatorial testing to reduce the number of test cases while still covering important interactions.
A possible set of test cases could be:
Test Case
Car Type
Driver’s Age
Coverage Type
1
Sedan
Under 25
Basic
2
SUV
25–50
Standard
3
Truck
Over 50
Premium
4
Sedan
25–50
Premium
5
SUV
Over 50
Basic
6
Truck
Under 25
Standard
This method reduces the number of test cases while ensuring that each factor appears in multiple meaningful combinations.
What is Pairwise Testing?
Pairwise Testing is a type of combinatorial testing where all possible pairs of input values are tested at least once. Research has shown that most defects in software are caused by the interaction of just two variables, so testing all pairs ensures good coverage with fewer test cases.
Example: Pairwise Testing for Insurance Policies
Instead of testing all combinations, we can create a smaller set where every pair of values appears at least once:
Test Case
Car Type
Driver’s Age
Coverage Type
1
Sedan
Under 25
Basic
2
Sedan
25–50
Standard
3
SUV
Under 25
Premium
4
SUV
Over 50
Basic
5
Truck
25–50
Premium
6
Truck
Over 50
Standard
Here, every pair (Car Type, Driver’s Age), (Car Type, Coverage Type), and (Driver’s Age, Coverage Type) appears at least once. This means we cover all important interactions with just 6 test cases instead of 27!
Permutations and Combinations in Testing
To understand combinatorial testing better, we need to understand permutations and combinations. These are ways of arranging or selecting elements from a set.
What is a Combination?
A combination is a selection of elements where order does not matter. The formula for combinations is: C(n, r) = n! / [r! * (n – r)!]
where:
n is the total number of items
r is the number of selected items
! (factorial) means multiplying all numbers down to 1
Example of Combination in Insurance
If an insurance company wants to offer 3 different discounts from a list of 5 available discounts, the number of ways to choose these discounts is: C(5,3)=5!3!(5−3)!
So, there are 10 different ways to choose 3 discounts.
What is a Permutation?
A permutation is an arrangement of elements where order matters. The formula for permutations is: P(n, r) = n! / (n – r)!
where:
n is the total number of items
r is the number of selected items
Example of Permutation in Insurance
If an insurance company wants to assign 3 priority levels (High, Medium, Low) to 5 claims, the number of ways to arrange these claims is: P(5,3)=5!(5−3)!
So, there are 60 different ways to assign priority levels to 3 claims.
Why Use Pairwise and Combinatorial Testing?
Saves Time and Effort – Testing fewer cases while maintaining coverage.
Covers Critical Scenarios – Ensures every important combination is tested.
Finds Defects Faster – Most bugs are caused by two interacting factors, so pairwise testing helps detect them efficiently.
Reduces Costs – Fewer test cases mean lower testing costs and faster releases.
When Should You Use These Techniques?
When a system has many input variables
When full exhaustive testing is impractical
When you need to find bugs quickly with limited resources
When testing insurance, finance, healthcare, and other complex systems
Tools for Pairwise and Combinatorial Testing
To make the process easier, you can use tools like:
PICT (Pairwise Independent Combinatorial Testing Tool) – Free from Microsoft
Hexawise – A combinatorial test design tool
ACTS (Automated Combinatorial Testing for Software) – Developed by NIST
These tools help generate optimized test cases automatically based on pairwise and combinatorial principles.
Conclusion
Pairwise and Combinatorial Testing are powerful techniques that allow testers to find defects efficiently without having to test every possible combination. They save time, reduce costs, and improve software quality.
Next time you’re dealing with multiple input variables, try using Pairwise or Combinatorial Testing to make your testing smarter and more effective!
In modern software development, ensuring that a program handles exceptions correctly is crucial for building robust applications. Exception testing in JUnit 5 allows developers to verify that their code properly handles error scenarios, improving reliability and maintainability. This blog post explores key techniques such as Testing for Exceptions in JUnit 5, Boundary Value Testing, and using AssertThrows to create effective test cases.
Testing for Exceptions in JUnit 5
JUnit 5 provides a streamlined way to test exceptions in Java applications. Unlike JUnit 4, which required using the expected attribute or @Rule, JUnit 5 introduces Assertions.assertThrows(), offering a more flexible and readable approach.
Example of Exception Testing in JUnit 5
Consider a method that calculates the square root of a number. If a negative number is provided, it should throw an IllegalArgumentException.
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class MathUtilsTest {
double calculateSquareRoot(double number) {
if (number < 0) {
throw new IllegalArgumentException("Number must be non-negative");
}
return Math.sqrt(number);
}
@Test
void testCalculateSquareRootException() {
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
calculateSquareRoot(-5);
});
assertEquals("Number must be non-negative", exception.getMessage());
}
}
This test verifies that the method correctly throws an exception when given invalid input, ensuring robustness.
Boundary Value Testing
Boundary Value Testing (BVT) is a technique used to test the limits of input values. It focuses on edge cases, such as minimum and maximum values, where software is most likely to fail.
Example: Boundary Testing for Age Validation
Consider a function that validates a user’s age for registration, allowing only ages between 18 and 65.
boolean isValidAge(int age) {
return age >= 18 && age <= 65;
}
Boundary tests should check values just inside and just outside the valid range:
BVT ensures the system correctly distinguishes between valid and invalid inputs.
Testing for Exceptions with AssertThrows
The assertThrows method in JUnit 5 simplifies exception testing, making tests more readable and maintainable. It helps validate that methods correctly handle invalid inputs by throwing the expected exceptions.
Example: Division by Zero Handling
Consider a simple method that performs division:
int divide(int dividend, int divisor) {
if (divisor == 0) {
throw new ArithmeticException("Cannot divide by zero");
}
return dividend / divisor;
}
We can use assertThrows to verify proper exception handling:
This ensures that the division method correctly throws an exception when dividing by zero.
Conclusion
Testing exceptions effectively is a vital part of software quality assurance. JUnit 5’s assertThrows method, combined with Boundary Value Testing, enables developers to create thorough test cases that improve the reliability and robustness of applications. By writing well-structured exception tests, developers can prevent unexpected failures and ensure their applications behave as expected under various conditions.
Hello and welcome to a new week on this beautiful blog of mine. Today is a topic that is of interest to me and possibly everyone reading this. It could also be something you ran into during a coding project. It is called Technical debt, which is the concept of delaying or omitting work to complete a project but cause more work to do in the end.
Let me give you an example that I have dealt with, and that you may have also dealt with. So you got a coding assignment to do right and that deadline is coming fast. So you set out to do it in the quickest and easiest way possible without a care for code layout or etiquette, it is just you working on it after all. The next day, you think to yourself that you may need to rework some facets of the code to make it run better or make it look neater. You then open up the project and look in horror at the mess you made and realize that it would take more time and effort to make it neater or run better than it would be to just continue on and get the project done. That is technical debt and yes it accrues interest.
The example was more personal and not that bad when you realize that the only price you paid is something you can’t stand to look at and also something that will take a long amount of time to fix. Like I said before it is just you working on it and as long as it works it’s fine…but what if you weren’t alone, say what if you were working in a team of 2 or 4 or perhaps a whole company amount. Then we have problems. Cause not only the debt is put upon others, but even money can be a problem if it is a company involved.
There is also types of technical debt. Planned Technical Debt is meant to establish one presence in the market or gather feedback from customers, kinda like prototyping from my understanding. There is also Inadvertent Technical Debt when the developer is unsure of market requirements or aware of the architecture.
Many things can cause technical debt to happen, such as poor management or the code not being reviewed well enough. So to avoid such things it’s a good idea to
Understand the Requirements
Understanding Decision Consequences
Supervising the Process
So be careful when coding a project as it may come to bite you in the future, so take into consideration the future you and help you out.
For this week, I wanted to look at how different languages handle test cases, and I’ll continue with one I’m not the most familiar with, C! I’ve worked in small amount of C in classes at Worcester State, but have little experience outside of that. I feel like this is a good topic to discuss as knowing how other programming languages handle unit testing would be a great way to expand my knowledge when it comes to furthering my understanding of it within Java.
If you haven’t already read my other blog post on Python testing, feel free to read it right here!
It seems like unit testing in C is a lot more barebones compared to Java, which in my experience utilizing C, makes sense for the language. A lot of features primarily used in Java, like object-oriented structures aren’t available in C (to my understanding, could totally be wrong).
For one major aspect, there seems to be only one assertion command in C, just simply “assert”. Theres no assertTrue, assertFalse, assertThrows, or assertEquals, just simply “assert”. And from the example given below:
#include <assert.h>
// In my_sum.c
int my_sum(int a, int b) {
return a + b;
}
// In test_my_sum.c
int main(int argc, char *argv[]) {
assert(2 == my_sum(1, 1));
assert(-2 == my_sum(-1, -1));
assert(0 == my_sum(0, 0));
// ...
return(0);
}
It seems the “assert” function comes from the <assert.h> library, much like the JUnit librarys used in Java. But more importantly, it seems that “assert” is the equivalent of “assertEquals”.
It also seems like Unit Testing in C is best implemented with tools outside of a compiler for C. The ones mentioned in the article in specific were CppUTest, Unity, and Google Test. For the rest of the article, the use examples using CppUTest. It was interesting to hear one of the options being called Unity, which is the name of a game engine, which, while not written in C, is written in a mixture of C# and C++, which are both offshoots of C. Makes me wonder how testing in a gaming engine works, perhaps it’s something to look at in a future blog post, hint hint, wink wink.
CppUTest seems to implement the same SetUp() and Teardown() functions that JUnit can employ, which is really good, as these methods are important for testing multiple methods. It also seems to have more then just an Equals assertion, even though the example used is another equals example.
This gets me more interested in C, as I have been told understanding C allows you to understand other languages much more clearly. Perhaps I’ll take a deeper dive some day, who knows! Until next time, my readers~!
Behavior Driven Development ( BDD ) is a test practice that makes sure there is good quality by automating test before or during system behavior specification. BDD test focuses on facing scenarios that describe the behavior of a story, feature, or capability from a user’s perspective. When the tests are automated they make sure that the system constantly meets the required behavior.
The Behavior Driven Development Process
The BDD process has three phases to it. The discovery phase, formulation phase, and the automation phase.
1.) Discover phase: This phase is where the user creates the initial acceptance agenda for the feature. This phase is usually done in a collaborative manor, each team member is contributing.
2.) Formulation phase: This phase is where the acceptance agenda sets into detailed acceptance tests, as the backlog item gets closer to implementation. This phase also incorporates specific examples of the behavior.
3.) Automation phase: This phase is where automation tests are automated to run constantly. This is to make sure that the new system supports the new behavior.
Benefits of Behavior Driven Development
1.) Early detection of errors / defects: When you automate tests in the early stages of development process, you can identify and address the issues. BDD allows for the early detection of defects.
2.) Faster Flow and Time: when using BDD, you can reduce the errors, rework, and replan. BDD accelerates the flow of the development process. Developers can produce features / products faster and more efficiently.
3.) Stronger Test Coverage: BDD allows for a more comprehensive test coverage that focuses on the user behavior and scenarios. Both common and edge cases are tested as well.
4.) Clear understanding: BDD can be plain and clear to understand, because specific scenarios are used to describe the behavior from a user’s point of view. This helps the development to fully understand the requirements and whats going on.
Why I chose this resource
I chose this article ” Behavior Driven Development” because it provided a detail look of a very important test method that goes in conjunction with the technical and business aspect of testing. Understanding BDD is important in today’s society of software development, for giving an efficient and more user friendly user products.
Personal Reflection
This article increased my understanding of BDD and the use of it in software development. I learned a lot about how BDD strengthens collaboration and communication between the business side of things and the technical side of things. This helps to ensure that user’s expectations and requirements are met. The new found knowledge will be extremely valuable in my future endeavors because I will incorporate this method in my future projects. This will help to improve the development process and product efficiency and quality. Also, by using BDD I can make sure that all requirements and specifications are met.
Testing in software development is important because it helps to deliver efficient and user friendly products to the end user. It also provides the developers with a chance to improve upon the product. Static and Dynamic testing are two important techniques used in software development.
Static Testing
Static Testing has various names like Verification Testing, Non-execution Testing, etc. This testing technique is used to identify defects in software without actually executing the code. This method usually includes manual and automated evaluation of the software and the code. Developers use this method usually in the beginning stages of the development process to catch issues early on, which will also lead to be easier and cheap to fix. This method focuses on reviewing the test cases, test scripts, test plans, and source code.
Static Testing Techniques
1.) Informal Reviews: Developers review each of the documents and give feedback
2.) Walkthroughs: Someone presents the product to the team and someone else takes notes.
3.) Technical Reviews / Code Reviews: review the technical specifications and the source code to make sure everything meets the requirements and standards.
4.) Inspection: Check for defects. Developers usually review the process with a checklist to help identify and record for defects.
Dynamic Testing
Dynamic Testing is a technique that analyzes the dynamic behavior of the code by actually executing it. This method makes sure to check that the software functions correctly and that there are no underlying issues / conditions. Sometimes developers use this method in conjunction with black box or white box testing to provide more realistic results.
Dynamic Testing Techniques
1.) White Box Testing: Examines the internal code structure. You need to actually have the internal code (source code)
2.) Black Box Testing: Checks the functionality without the actual internal code (source code) .
Benefits of both Static Testing and Dynamic Testing
1.) Early detection of defects
2.) Cost efficient
3.) Showcases runtime errors
4.) Reliability
Why I picked this Resource
I chose the article “Static Testing vs. Dynamic Testing” because this article gave me a more detailed and in depth look between two very important testing methods that are currently being used in todays society. It is very important to understand these two testing methods in the software development process because they can deliver efficient and user friendly products to the end user. This article also aligns with what we have learned in the course, making it relevant to talk about and to understand.
Personal Reflection
This article deepened my understanding of static and dynamic testing. I was able to learn a lot about these two testing methods that I did not know, even the many benefits that each method has. Knowing how crucial these two methods are in the software development process and what I know now, this knowledge will help me on my future endeavors when approaching new projects in regards to testing .
Test doubles are a very important tool in software testing. Test doubles allow for users to break off a portion of their code to test specific parts and functions. This helps because users can do this without depending on the other factors within their code. Test doubles are substitutes, they copy the behavior of real objects. This helps to make sure that the tests remain structured and efficient.
Overview of Test Doubles
For this blog post, I chose the Article “Test Doubles: Mocks, Stubs, and Fakes Explained” by Martin Fowler. The article talks a lot about the overview of the different types of test doubles, their roles, and how they can be used in testing.
Types of Test Doubles
1.) Dummy: A dummy object is required for the creation of another object required in the code. Dummy objects will never be used in the test, they are simply like place holders to satisfy the code and its requirements.
2.) Fake: A fake is an object that will always have the same return value. This object is useful for testing certain scenarios, like a user that is logged in or in a consistent database response. They are simple implementations that are not that suitable for production but are good for testing.
3.) Stub: A stub will provided predetermined responses to method calls. Stubs usually imitate the behavior of external components like databases or web services.
4.) Spy: A spy will record information about the interactions with the object being under tests. This helps verify interactions and make sure there is the correct behavior in method calls.
5.) Mock: A mock can be a more advanced test double that will allow for dynamic behavior based on the test scenario. They verify interactions and can change behavior based on conditions. They are useful for ensuring that certain methods are called with specific parameters during the test.
Benefits of Using a Test Double
1.) Early detection of errors/issues: Using Test Doubles will help the users to find any issues within the code. This helps with reducing the risk of defects in production
2.) Cost Efficiency: Using Test Doubles will significantly help to reduce the costs that will come with fixing the issues later in the development process.
Why I Picked this Resource
I chose this resource for the blog post because it provided an in depth overview of the various types of test doubles and their specific role within testing. This article’s contents had some similarities of what we discussed in the class, making it relevant and valuable.
Personal Reflection
This article not only increased my understanding on the topic of Test Doubles, but it also showed my how unique and important each one can be in regards to testing. I also learned the various benefits of these test doubles, so when I choose one in my future endeavors I will know which one will benefit me the most.
In my future endeavors, I plan on using what I have learned about these Test Doubles objects by implementing them on future projects. This new found knowledge will help me to make better decisions in the future and will also improve the quality of my work.
In software development security testing is very important to making sure applications are strong enough against cyber attacks. Security testing encompasses a variety of practices like, application security testing, and penetration testing.
Overview of Security testing
For this blog post, I chose the article ” Security Testing from Bright Security. The article provides a lot of insight on security testing, it’s goal, benefits of security testing, key principles, and the different types of security testing.
1.) Goals: The article showcases the main goals of security testing, which are realizing what assess needs protection, identifying the potential threats and vulnerabilities, evaluate the risks that come with the vulnerabilities.
2.) Key Principles: The article covers the main key principles of security testing, which are availability, integrity, authentication, and authorization. These principles make sure that important/sensitive information is accessed only by authorized users, and that it remains accurate and trustworthy.
3.) Different types of Security Testing:
. Penetration Testing: This security testing method replicates real world cyber attacks to test the effectiveness of already existing security measures.
. Application Security Testing: This security testing method finds and eliminates the vulnerabilities within software applications.
. Web Application Security Testing: This security testing methods test different techniques that gauges the vulnerability of web applications.
. Security Audits and risks Assessment: This is a test method that checks to make sure that everything is structured properly and in compliance with the rules/standards.
4.) Benefits of Security Testing:
. Early Detection of Vulnerabilities: Security testing allows for the early recognition of potential security issues, reducing the risk of exposure.
. Risk Management: When the vulnerabilities are identified, then we can create solutions to solve the risks of a cyber attack or data leak.
. Trust and Cost Efficient: Early detection of risks and vulnerabilities will not only enhance the rust of customers but it will significantly reduce the cost of a data breach and various fines.
Why I picked this Resource
I picked this resource because it provided a comprehensive and detailed overview of Security Testing. This Article had a lot of similarities with the topics that we covered in our course. Also, the article makes it easier to understand the nature of security testing and various practices and principles associated with it.
Personal Reflection
Reading this article expanded my understanding of security testing beyond what we learned in class. I learned how important it is to just about everything related to technology. Identifying threats, risks, and vulnerabilities and how each of these things come together to reduce cyber attacks. One thing that I can takeaway from this is learning about the various types of Security Testing and each one does something different, but all have a similar goal.
In my future endeavors, I plan on using what I have learned about these Security Testing principles by implementing them on future projects. This new found knowledge will help me to make better decisions in the future.
In the ever evolving world of software development, automated testing has become indispensable. Using tools like Selenium combined with Java, developers can automate their web application testing, improving efficiency and accuracy. This blog post delves into the key takeaways from a helpful Sauce Labs article (https://saucelabs.com/resources/blog/writing-tests-using-selenium-and-java) that outlines how to write testes using Selenium and Java, exploring its relevance to our coursework on software testing methodologies
Summary of the Resource:
The Sauce labs article provides a comprehensive guide on writing automates tests using Selenium, a popular tool for web application testing, and Java, one of the most used programming languages. It covers the basics of setting up Selenium with Java, crafting test scripts, running tests, and interpreting the results. The article emphasizes the importance of Selenium for its ability to simulate user interactions with web elements, which is crucial for verifying the functional integrity and performance of web applications. It also touches on integrating these tests into a CI/CD pipeline, demonstrating how automated testing fits into broader software development practices.
Reason for selection:
I selected this article because it offered a practical introduction to an essential skill in software development. As our course covers various testing frameworks and tools, understanding how to implement and utilize these tools in real-world scenarios is crucial. The articles focus on Selenium with Java is particularly relevant, as many of us are familiar with Java and may soon need to apply these skills in internships or jobs.
Personal Reflection.
The article made me appreciate the power and necessity of automates testing in modern web development. It was enlightening to see how Selenium scripts could mimic actual behavior, such as clicking buttons or entering data, which is critical for testing user interfaces. Reflecting on this, I see the immense value in learning automates testing not only to boost my future job prospects but also to ensure that I can contribute to creating robust, user-friendly software.
Application in future practice:
Armed with the knowledge from this article, I am eager to apply these testing techniques in my upcoming projects. Whether it’s for class assignments or eventually in a professional setting, understanding how to set up, write, and deploy automates tests using Selenium and java will significantly enhance the quality of the software I develop and maintain.
Conclusion:
Automated testing is a key component of software quality assurance. The insights provided by the Sauce Labs article on using Selenium and Java for testing offer both foundational knowledge and practical steps for anyone looking to enhance their testing skills. As software becomes increasingly more complex, the ability to efficiently test and validate software functionality becomes even more critical, making these skills invaluable for any aspiring software developer.