Category Archives: Week 4

Boundary Software Testing

https://www.testbytes.net/blog/boundary-value-analysis

This past week we began understanding and practicing boundary value testing using simple programs and, of course, simple tests. This blog post discusses that same topic, and gives multiple real life-scenarios and dives deep into the subject. Although it is not a super difficult subject to grasp (in my opinion), I feel this is a good way to reinforce those ideas we learned in class.

This blog by testbytes gives all the information one would need to give them a solid starting ground for boundary value testing. It first explains the concept of the testing model and why it would be done, such as explaining how testers hope to identify errors more proficiently. An example is given, using discount percentages that apply ONLY when purchase totals reach a certain threshold. The lower boundary of the first discount is given, testing if the total is less than $10 (which should mean a 0% discount). Then, the upper boundary of the first discount is checked, with a $10 order receiving an expected 5% discount, so on and so forth. 

Later the blog discusses the different types of boundary value testing as well as their distinctions and the disadvantages and advantages of this type of testing. 

I selected this resource because it gives a quick definition of boundary value testing but then goes into further detail on the subject with good examples and explanations. It is a well thought out post that gave me a more concrete understanding of boundary value testing and edge cases. 

Testbytes on its own is a reliable source for this specific information since it is an entire company dedicated to software testing and quality assurance. Through checking out their other posts, I see they have a variety of testing area blogs including mobile apps, web apps, games, automation, security, and more. 

Overall, this resource is great to refer back to due to its consistent information and easy to understand descriptions. 

As previously mentioned, the content in this blog post by Testbytes is a really solid basis for a good understanding of boundary value testing. I can’t say that it is the highest quality and in-depth education on the subject one can receive, but it’s useful for someone like me who is just getting started. 

Personally, I really enjoyed the material, especially the example given at the start. Although I wasn’t struggling with what we were learning in class, there were times where I had a moment of confusion. This is a quick bit of information that instilled some more confidence in me about this topic. One main thing I learned through this blog is a big disadvantage of BVA is truly how many test cases it may require to check all boundaries/edges, which can lead to a lot of effort on the system and more power/time consumption. I expect to use such advantages and disadvantages when creating test cases for my future individual and work projects.

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.

looking at junit

In class, we’ve been going over unit testing utilizing the JUnit Java testing framework. In the process of this, I’ve come across a couple of issues regarding classes that increment a “key” attribute, that is an class where an attribute’s value is based on the amount of previously built instances of that class. When testing to see if the attribute is assigned correctly, it isn’t consistent because of the compiler optimizations that JUnit uses. Tests run in an order which is most efficient, so the number of instances of the class may be different depending on the order the compiler goes through the tests (from what I’ve heard, at least).

I wanted to research a bit more into JUnit’s capabilities to see if I could figure out a solution to this problem, although I’ve already submitted the assignment that is relevant to this predicament. I found this blog post / guide to JUnit from Baeldung that goes through additional features from what I’ve learned in class. Perhaps here I can get some ideas as to address this issue.

What I first found interesting in this guide was the @DisplayName and @Disabled annotations. This is actually incredibly helpful, specifically @Disabled. In the assignment, I found that there were tests that weren’t possible because the functionality was not added to the classes we were working with. As a way to address it, I simply did this:

@Test
void test() {
 // Functionality has not been added!
assertTrue(true);
}

This obviously isn’t the best approach to testing. With the @Disabled annotation, you can make a much better implementation of this test.

@Disabled
@Test
void test() {
  assertTrue(method());
}

This is a much better way of testing functionality that hasn’t been added yet.

With regards to the previous problem, I had considered having a @BeforeAll method to create a two instances of a class so that I know exactly what the keys for both instances should be (1 and 2). The problem is that if the constructor for the class isn’t set up correctly, this could result in an error. This isn’t that big of a deal for a small program, but I could imagine it’s not really best practice.

However, JUnit has an Assumptions feature. This means that the desired method will only continue if the assumption is true. With this, we could theoretically run an assumption in a @BeforeAll method, and if it passes the assumption, we create instances with keys that are more easily testable.

@BeforeAll
void setUp() {
  assumeNoException(() -> new Obj());
  Obj obj1 = new Obj();
  Obj obj2 = new Obj();
}

This way, we don’t have to worry about the test class not running all the way through due to an exception, and it’s also fairly elegant. Reminds me of why I like to code.

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.

Video suitable for JUnit beginners

Hello everyone,

Today I want share a video for JUnit beginners like us.

“Java Unit Testing with JUnit – Tutorial – How to Create And Use Unit Tests”

By Coding with John

Here is the link: https://www.youtube.com/watch?v=vZm0lHciFsQ

I highly recommend everyone to watch this video before doing Homework 1. Because the function we want to implement on Homework1 is almost logically very similar to what he described. The blogger introduces the working principle of JUnit almost from scratch, and shows step by step how to create a Test Method and its working logic.

For example, From 3 to 10 minutes into the video, he introduces the structure of the Test method, including the use of calculation methods and assert statements.

@Test

void twoPlusTwoShouldEqualFour(){

var calculator = new SimpleCalculator();

assertEquals(expected:4, calculator. add(numberA: 2, unmberB: 2)

}

The above code shows us that if unmberA plus numberB equals 4, then we can pass the test. If it is not 4, it will fail to pass. It also shows us the various functions of assert statement. Such as assertEquals, assertNotEquals, assertTrue, assertFalse, assertNull and so on. We gonna use all of them in every scenario.

Next, the video talks about a more complicated testing method. When there are multiple results, we need to test every scenario that may occur. And he talks about some loopholes in the testing logic. For example, in 15 minutes, he gives an example The condition of return C was changed from 80 to 81, and it still passed the test, even though 80 should return B. This does not mean that our test scenario is bad, but we may need more code to describe the test conditions.

However, I recommend this video because it is really suitable for beginners. When I watched this video, many questions were solved. Although these are very basic things, everything you need to learn later is based on these foundations. I believe that learning the knowledge taught in the video will be very beneficial to our future study. I will follow this blogger. The knowledge he talks about is very easy to absorb and understand.

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

Unraveling Boundary Value Testing with Ranorex

In the realm of software development, ensuring the robustness and reliability of applications is paramount. This week, I wanted to dive deeper into boundary value testing after learning about it recently. The resource I found gave me some interesting insights into when and why you would want to use boundary value testing, specifically how it can be applied to black box testing where you dont have access to the source code.

Why This Resource?

I chose this particular resource due to its comprehensive yet digestible explanation of BVA. The technique’s potential to significantly reduce testing time while ensuring thorough coverage of potential edge cases intrigued me. As someone striving to refine my testing strategies, understanding the nuances of BVA seemed like a crucial step. This resource did a good job at explaining it clearly.

Insights and Reflections

The article offered a clear definition of BVA and its importance in black box testing. By focusing on the boundaries of input ranges, BVA aims to uncover errors where they’re most likely to occur. This approach not only streamlines the testing process but also enhances the software’s reliability.

One of the most striking takeaways was the differentiation between BVA and equivalence partitioning. While both are essential in a tester’s arsenal, understanding their distinct roles in identifying potential errors was enlightening.

The discussion on automating BVA, particularly through tools like Ranorex, opened my eyes to the efficiency gains possible with the right technology. This insight has prompted me to consider how automation can be integrated into my future testing endeavors, potentially transforming my approach to ensuring software quality.

Application in Future Practice

The knowledge gleaned from this article will undoubtedly influence my future work. The ability to effectively utilize BVA will allow me to conduct more efficient, targeted testing. Additionally, the exploration of automation tools like Ranorex has inspired me to further investigate how such technologies can be leveraged to enhance testing processes in my projects. This will especially help in scenarios where I cant see the code to make more specific.

Conclusion

The exploration of Boundary Value Analysis through Ranorex’s article has been an enriching experience, reinforcing the importance of strategic testing techniques in software development. I look forward to applying these insights to my practice, confident in the positive impact they will have on my approach to software testing, especially when combined with other techniques.

Resource Link: https://www.ranorex.com/blog/boundary-value-analysis/

From the blog CS@Worcester – Abe's Programming Blog by Abraham Passmore and used with permission of the author. All other rights reserved by the author.

Efficiently testing code

Having your code and programs work is one thing, ensuring the code works effectively and efficiently is another. You can write good code, but it’s nothing if it does not work properly. When I tested my code, I would just run the whole thing to see if it worked, and with different inputs. When it didn’t work, I would strip it apart, run bits and pieces individually until I found the issue. Instead of meticulously scrolling through lines of code, you could use actual testing methods, like Junit testing

JUnit is a software testing framework for Java. Through the use of method calls, annotations, and assertions, you are able to create tests that will call methods and compare the output to the supposed output that you want. That way, you can create multiple tests for possible outputs your methods and program can have. 

In this blog post, Shinji Kanai writes everything they can about JUnit testing, what it is, how it works, the benefits, and how you can get started using JUnit. They say that JUnit can be used for unit testing, functional testing, and integration testing. They also say JUnit can be used for automation testing, to find errors in your code. They go on to show how to write test files, and how to write test code. They touch upon some other topics, like troubleshooting, assertions, debugging and exceptions, and other things. 

I chose this blog post as a good reference article, something to refer back to when you can’t remember what to do. At the same time, it’s also a really good beginner blog post for those who want to get into testing their code. I think Kanai did a good job encapsulating everything, not only summarizing the overall concept of JUnit testing, but at the same time going in depth about how to do things, and going over more topics for those who may find it helpful. Personally, I was unaware of the automation testing side of JUnit, and how it may be able to remove bugs before I even fix them, which is weird because typically you only catch errors and bugs when you run the code. 

Testing is one of the spots in coding where I knew I was lacking in. Before this, I never knew how to test my code effectively, but with this, I feel more confident in my abilities to write better code that will set me apart from others. As I continue along, I can picture myself as a better developer than I did when I first started university.

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

Java @nnotation

Enhancing Your Code with Metadata

The blog from ioflood.com provides a comprehensive guide on Java Annotations, covering the basics and advanced aspects. It explains the fundamental annotations in Java, such as @Override, @Deprecated, and @SuppressWarnings, and also delves into creating custom annotations. The blog addresses how to deal with common challenges and compares Java Annotations with other metadata approaches like comments and naming conventions. It also touches upon the role of Java Annotations in larger projects and frameworks, emphasizing their importance in modern Java development.

Delving into Java’s built-in annotations, let’s begin with @Override. This annotation safeguards your method overrides, ensuring that you’re correctly extending a superclass method. Missteps in method naming or parameters can lead to subtle bugs, but @Override makes these issues immediately evident.

Next, consider @Deprecated. It’s a polite warning to developers that a particular method or class should be avoided, possibly due to security concerns or improved alternatives. Using @Deprecated helps maintain backward compatibility while steering developers towards better options.

Lastly, @SuppressWarnings plays a key role in managing compiler warnings. While it’s not advisable to ignore all warnings, this annotation is invaluable when dealing with known but unavoidable issues, particularly in cases of backward compatibility or deprecated usage.

Creating and Using Custom Annotations

Custom annotations take this utility a step further. They allow you to create tailor-made metadata suited to your specific project needs. For instance, you could define an @Configurable annotation to mark fields that should be populated from a configuration file.

Creating a custom annotation involves defining an interface with the @interface keyword. The real power lies in understanding and using retention policies effectively. These policies determine how the annotation is stored and used:

  • SOURCE: Discarded by the compiler, useful for annotations processed during source code analysis.
  • CLASS: Stored in the .class file but not available at runtime, ideal for annotations that don’t influence runtime behavior.
  • RUNTIME: Available at runtime, these annotations can be used for runtime processing, like those in many Java frameworks.

Best practices for custom annotations include clear documentation and thoughtful consideration of their scope and retention policy. They can serve myriad purposes, from guiding framework behavior to enforcing coding standards.

Conclusion

Java Annotations, whether standard or custom, represent a powerful aspect of Java programming. They allow for cleaner code, clearer intent, and more robust software design. By understanding and utilizing annotations effectively, Java developers can ensure their code is not only efficient but also well-structured and easier to maintain.

Here is the link of the blog: https://ioflood.com/blog/java-annotations/

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

Black Box vs White Box Testing

In the ever changing and dynamic field that is Software development, understanding the nuances of different testing methodologies is crucial for ensuring quality and reliability. I would like to say that I stumbled upon the blog “Black vs White vs Grey Box Testing” on Shakebugs.com however, the truth is I was still a little confused after our last class and needed further clarification not only on the difference of the two testing methods but just what they do and when they are used. And well this article did just that it resonated with what we were learning and sparked several insights that I believe will impact future practices.

The article navigates through the concept of black, white and grey box testing (I did not even know grey was a thing.) Black box testing, as it explains, is an approach where the tester assesses the functionality without knowledge of the internal workings of the application. White box testing, on the other hand, requires a deep understanding of the code, as tester need to verify the internal processes and pathways. Grey box emerges as a hybrid approach, combining elements of both black and white box testing. It allows testers to apply their partial knowledge of the internal structures while examining the software’s external functionality.

As I mentioned before I chose this resource because it matched the topics we were discussing in class and further helped develop my understanding of the practical applications of the different testing methodologies. The clear and concise explanations paired with practical examples and visuals, provide a framework to differentiate and appreciate the unique attributes and applications

Reading this article was more delightful than I initially anticipated as when I saw a 13 minute read time I almost closed the tab however, I am glad I did not. I learned that while black box testing is excellent for validating user requirements and functionalities, white box testing is indispensable for internal code optimization and security assessments. Grey box testing , with its balanced approach, offers a valuable perspective for comprehensive testing.

Going forward, I intend to integrate these insights into my approach to software testing. In future projects, I will not only consider the functional requirements but also the internal code structure and security aspects when deciding on a testing strategy.

The blog post is a must-read for anyone in the field of software development testing. It offers clear and practical understanding of the different methods, guiding how to apply them effectively. You can read the full article here . This resource not only enhanced my understanding but has also equipped me with practical knowledge I am eager to apply in the future.

From the blog CS@Worcester – Josies Notes by josielrivas and used with permission of the author. All other rights reserved by the author.

Navigating the Software Development Spiral: A Closer Look at the Spiral Model

In the dynamic world of software development, finding the right approach to tackle complex projects and manage uncertainties is an important task since we always need to figure out ways of maneuvering around problems or solving them if need be. One such approach having came across in my searches that has gained recognition for its adaptability and risk management capabilities is the Spiral Model. This Software Development Life Cycle (SDLC) model is something that provides a systematic and iterative method for building software, allowing developers to navigate through the challenges of large and intricate projects.

In the blog post, it delve deep into the intricacies of the Spiral Model, it tries exploring its phases, characteristics, advantages, and disadvantages.
By the end, you’ll have a comprehensive understanding of this powerful SDLC model and its potential applications, helping you make informed decisions about its use in your software development projects. from what i’ve uncovered as to why the Spiral Model is often referred to as a “Meta-Model” and discuss the scenarios where it shines, it’s most likely because of it’s nature to incorporate multiple approaches, being able to seamlessly integrate concepts from other SDLC models, utilizing a step wise approach almost similar to the classic Waterfall method- with every loop representing some kind of a step or phase that’s completed in the development process.

Following that, is usually the Prototyping model/technique; like the name implies we make a prototype model right in the beginning to have something of a baseline to draw on- the prototype is developed at each beginning phase, providing a tangible solution to resolve any risks that may crop up. the iterations in the spiral model can be thought of as evolutionary biology through which the complete systems we have are built.

The primary focus of the spiral model is usually risk aversion and management- by addressing risks at each and every phase- it makes sure that any risks or uncertainties software development cycle is usually kept at a minimum. last but not least is the adaptability of the spiral method- it’s iterative and incremental approach can be useful for any changing requirements or unexpected events that may crop up

I selected this resource because the Spiral Model is a fundamental concept in software engineering. Understanding different SDLC models, their advantages, and disadvantages is crucial in the software development field. The Spiral Model’s focus on risk management and adaptability piqued my interest as it aligns with the evolving nature of software projects.

https://www.geeksforgeeks.org/software-engineering-spiral-model/#

From the blog CS@Worcester – CSTips by Jamaal Gedeon and used with permission of the author. All other rights reserved by the author.

Working Locally And Upstream.

As a student of Computer Science and currently taking a class of Software Process Management, my journey through this course specifically involves a lot of learning, experimenting, and finding better ways to upgrade as a student in this field. In this blog post, I shall share some of the things I have learnt and we’ll delve into the concept of working locally and upstream, highlighting its significance and the benefits it gives in contributing to open-source projects.

What Is “Working Locally and Upstream”?

Before I go into the why and how, let’s clarify what working “locally” and “upstream” means in the context of open source:

  1. Working Locally: When you work locally, you are making changes and improvements to open-source software on your personal development environment. You might be fixing bugs, adding features, or simply experimenting with the code. This is your playground to test, experiment, and learn.
  2. Working Upstream: Once you’ve made changes locally and are confident in your code, the next step is to contribute your changes to the official or “upstream” repository. Upstream is where the original project is maintained, and your contributions become part of the official codebase.

Why Would one Work Locally?

  1. Learning and Experimentation: Working locally allows you to experiment freely. You can try out new ideas, make mistakes, and learn from them without the pressure of affecting the main project.
  2. Skill Development: This is a perfect opportunity to hone your coding, debugging, and collaboration skills. You’ll gain valuable experience that can be applied in your coursework and future career.
  3. Portfolio Building: Every contribution you make locally is a valuable addition to your portfolio. It showcases your practical experience and commitment to open source.

Why Should you Consider Contributing to the Upstream?

  1. Community Engagement: Contributing upstream allows you to be part of a wider community. Your code becomes part of a larger ecosystem, and you collaborate with experienced developers from all over the world.
  2. Impact: Your contributions have a real impact. The changes you make can benefit not only the project but also countless other users and developers who rely on it.
  3. Networking: Working upstream introduces you to industry professionals and like-minded individuals. This networking can be a stepping stone to internships, job opportunities, and mentorship.

How to Get Started Working locally and upstream.

  1. Choose a Project: Find an open-source project that aligns with your interests or field of study. Popular platforms like GitHub offer a wide selection.
  2. Fork the Repository: Forking creates a copy of the project in your GitHub account, which you can work on without affecting the original code.
  3. Make Local Changes: Clone your forked repository to your local machine. Make the desired changes, test them thoroughly, and commit your work.
  4. Make a Pull Request: Once you’re satisfied with your changes, submit a pull request to the original repository. This is your way of proposing your contributions to the upstream maintainers.

In conclusion, Working locally and upstream in open source is a valuable experience for a lot of software developers. It not only helps you grow as a developer but also connects you with a global community of like-minded individuals. So, dive in, fork your first repository, and explore.

Here is where you can find some open source projects to work with:

https://github.com/

https://gitlab.com/

From the blog CS@Worcester – MY_BLOG_ by Serah Matovu and used with permission of the author. All other rights reserved by the author.

learning concurrency

I’ve heard these terms a lot, concurrency and multithreading, but I never really bothered looking into what they actually do. All I’ve really known about these terms was that they make things run faster. I mostly associated multithreading with hyperthreading, I’ve known that CPUs can use multiple cores for the same application to speed up runtime and make games perform better, but I was always sort of confused about how some games have issues with actually taking advantage of modern high-end CPUs. Usually, this is fixed by some sort of modification, if it’s been written already. That being said, my association between the two is only really surface level.

Hyperthreading is really just related to the physical hardware, which makes it different from multithreading in programming. Instead, multithreading is a form of concurrency in which a program has multiple threads that can run simultaneously, with each thread having its own operations and processes that it executes. What this ultimately means is that within a program, multiple operations can be executed at the same time.

This really fascinates me coming from the perspective of only writing straightforward code. While I sort of knew intuitively that programs can probably do multiple tasks at the same time, I’ve only experienced this on the end-user side of things, rather than the individual writing the program. After looking into how threads work in Java on a BairesDev post regarding Java concurrency, I can really see how powerful of a tool concurrency can be for runtime efficiency. This post essentially goes over what concurrency is and the ‘basics’ of utilizing built-in multithreading functions in Java, along with the advantages and disadvantages that this design comes with.

Of course, it does seem like it takes a careful approach to make sure that the implementation of such a tool is actually beneficial to the project. Even with this relatively simple tutorial, I did find myself a little confused at some points, particularly at the point where Locks are introduced. Though this could be the effect of the hour at which I decided to start writing this blog post, it still stands to reason that the complexity of writing a multithreaded program may result in a more difficult development process, especially in debugging.

Regardless, I was truly fascinated by the subject matter and I’m really excited to be going over concurrency in our course (CS-343). This seems like a tool I would really like to use as I enjoy toying with logistics in video games and the like.

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.