Category Archives: CS-443

mocking review (and more)

A while ago, we used the Mockito framework in Java during an in-class activity. If I’m being honest, I wasn’t paying full attention to the material, and so I wanted to review some of the material in addition to looking into mocking more.

The idea with mocking is that unit testing without the actual classes being written is problematic solely because we can’t actually test stuff that isn’t written. This mostly applies to a specification-based testing environment, a subset of black-box testing. Mocking solves this by simulating the construction of objects and allowing set values to pass through for tests, which can then be refactored once the classes are actually created. As such, we can have tests created for the behaviors we want in our project, without having written the project yet, which is great if we’re applying specifications to tests.

This contrasts with stubs, pieces of code that are written as minimally as possible to get the test suite to function. Stubs are useful in that they can quickly provide the correct result for a test without the need of an outside resource, but what seems to happen is that as you write more tests, you end up writing the actual program in the process to make the tests match. This is good for test-driven development, where we actively write tests while we code the actual program, but if our interest is solely on writing the tests based on specifications, this isn’t a great approach.

According to a blog post by Rohit Khankhoje, mocks are great in that they are more cost-effective, acccessible and efficient than writing stubs or creating fakes. By setting up mocks, you have less set-up time for tests because you don’t need to have the system accessible in order to have a fully functioning test suite. While this is great, there are some obvious drawbacks. For example, tests that utilize mocking will still frequently have to adapt to new code changes when functionality is added to the project. This is more pressing with the idea in mind that tests will continue to pass with mocks despite code in the actual project changing, and so mocked tests need to be developed side-by-side with the actual code, otherwise the testing suite isn’t actually portraying accurate information regarding the accuracy and performance of the system.

As such, while mocking is a very strong tool, it seems to only be very useful in an environment where we don’t have access to code, and when we do have access to code (or we are also the coders ourselves, not just testers) it seems much more efficient to implement test-driven development.

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

Week 12 Blog Post

The article “Evaluating Test Cases, Checks, and Tools” explores into the process of evaluating the efficiency of test cases, checks, and tools in software testing. This blog post was written by Michael Bolton, a renowned software tester and consultant, the article provides insightful perspectives on how to critically evaluate these elements to improve the quality of testing practices. Bolton begins by separating between test cases and checks. Test cases are comprehensive procedures designed to explore the behavior and functionality of a software system. On the other hand, checks are automated scripts that verify specific phases of the system’s behavior, typically based on a criteria. While both are important to testing, Bolton emphasizes the importance of recognizing their distinct purposes and limitations. The author highlights the significance of evaluating the value and effectiveness of test cases and checks. Rather than blindly holding to predefined test cases or relying only on automated checks, testers should continually assess their importance and effectiveness in uncovering defects and providing meaningful feedback. Bolton encourages for a dynamic and adaptable approach to testing, where testers actively engage in critical thinking and exploration to uncover issues. Also, Bolton discusses the role of testing tools in the evaluation process. While tools can speed up certain testing activities and enhance efficiency, they are not a answer for all testing challenges. Testers must carefully evaluate tools based on their suitability for the given context, considering factors such as work use, compatibility with the testing environment. Throughout the article, Bolton emphasizes the importance of context-driven testing, where testing strategies are tailored to the unique characteristics and requirements of each project. He encourages testers to adopt a mindset of examination and experimentation, continuously seeking opportunities to improve their testing approaches and improve overall effectiveness. “Evaluating Test Cases, Checks, and Tools” offers valuable insights into the nuanced process of evaluating test cases, checks, and tools in software testing. By organizing a critical and context-driven approach, This was an interesting read considering it was very much so what we have been learning this semester. It helped me understand the value and importance of organizing test and to learn more of adaptable approach of testing

From the blog CS@Worcester – CS- Raquel Penha by raqpenha and used with permission of the author. All other rights reserved by the author.

Week 11

Mocking is a process used in unit testing when the unit being tested has external dependencies. The purpose of mocking is to isolate and focus on the code being tested and not on the behavior or state of external dependencies. These dependencies, such as databases, external services, or third-party libraries, may be difficult to control or reproduce in a testing environment. By creating mock objects that mimic the behavior of these dependencies, we can isolate and test individual components of our code in a controlled and predictable manner. Some benefits of mocking include isolation. Mocking allows us to isolate the unit of code being tested from its external dependencies, ensuring that tests focus solely on the logic within the unit itself. Mock objects provide precise control over the behavior and responses of dependencies, enabling us to simulate various scenarios and edge cases during testing. Debugging is another benefit of mocking. Mock objects can be used to debug code by providing detailed information about how a method is being called and what values are being passed to it. Collaboration:Mock objects can be shared among developers, making it easier to collaborate on testing and ensure that code is tested consistently across different environments.

Some of the challenges that mock testing can cause is maintenance. Mock objects can be difficult to maintain, particularly as systems evolve and change over time. When new features are added, mocks may need to be updated to accurately reflect the behavior of the system. Complexity is another problem. As the complexity of a system increases, the complexity of the mock objects used to test it may also increase. This can make it difficult to understand and modify tests, particularly for developers who are not familiar with the system. Some mock testing best practices include using mock testing sparingly. It’s important to use it well and not rely on it too heavily because it can be hard to maintain. Keeping mock objects simple is important. Mock objects should be simple and easy to understand, with clear and concise code. Write test cases first: Writing test cases before writing code can help ensure that code is designed with testing in mind and that it can be easily tested using mock objects. I chose this article because it talks about the pros and cons of. Using mock testing as well as strategies to use in order not to find a lot of issues with it. Mock testing can be complicated when it’s overly used therefore it’s not advisable to use it all the time.

References.

From the blog CS@Worcester – Site Title by lynnnsubuga and used with permission of the author. All other rights reserved by the author.

Performance Testing

Performance testing is a big part of software development, it helps make sure that the final product can run smoothly without any errors and gives the user an easy experience. The main aspect of product testing is performance testing, which evaluates the speed and stability of the system. The point is to identify and address any performance bottlenecks that could give the user a bad experience. When dealing with performance testing it should always be used after functional testing, as soon as the basic function of the system is tested and verified. Performance testing involves testing a bunch of different parameters like processing speed and workload efficiency. By measuring the response time under different conditions developers should be able to find areas that need improvement and target system performance. So many companies should make sure to sort performance testing by doing diagnostics aid and software problem identification.  Diagnostics aid is when performance testing helps identify computing bottlenecks in the system and allows developers to use recourses to improve its performance. Software problem identification shows the areas where the application is failing and shows developers how to address the software performance issues. Performance testing plays a big role in evaluating the system’s performance, it helps provide ideas about what areas to work on to improve the performance.

I picked this topic because we have been working on testing in class a lot more recently and thought that this topic is a great choice to get a better understanding of performance testing as well as product testing. Performance testing helps developers address common problems and provide solutions to tackle these problems.  I learned that there are different ways to approach performance testing when doing it for example by analyzing the data I would want to share or use those results and retest it after making some small changes. This information has helped me look at system testing a little differently since we’re working on system testing in class but this new information will help me in the future to make sure that I focus on the system behavior and include the test in the development process to make sure that the system runs smoothly.

https://www.techtarget.com/searchsoftwarequality/definition/performance-testing

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.

The Vital Role of Test Plans in Software Engineering

In the intricate world of software engineering, the creation and implementation of a test plan stand as a cornerstone of project success. Test plans, detailed documents outlining the strategy, objectives, schedule, and necessary resources for software testing, play a pivotal role in ensuring that a software product not only meets its intended specifications but also delivers a reliable and functional experience to users.

What is a Test Plan?

At its core, a test plan is a blueprint for the testing process. It begins with a skeletal structure at the project’s inception, fleshing out with details as the project progresses. This dynamic document covers everything from the scope of testing and available resources to the specific methodologies that will be employed to assess each feature of the software product.

Types of Test Plans

Understanding the different types of test plans is crucial:

  1. Master Test Plan: This document offers a comprehensive overview of the testing approach across different test levels, providing insights into the testing efforts and strategies to be employed throughout the project.
  2. Test Phase Plan: Focused on specific test levels or types, these plans delve into the details not covered in the master test plan, outlining schedules, benchmarks, and necessary activities for each phase.
  3. Specific Test Plans: These are dedicated to specific types of testing, such as performance or security, focusing on the unique requirements and methodologies applicable to these areas.

Objectives and Importance of a Test Plan

A well-crafted test plan serves several key objectives:

  • It outlines the start and end points of the testing process, detailing the resources needed.
  • It acts as a roadmap, specifying detailed tasks and guiding the project through its phases.
  • It anticipates challenges, offering solutions and organizing stakeholder interactions effectively.

Moreover, a test plan is crucial for facilitating communication within the team and with stakeholders, helping manage changes and ensuring that testing remains aligned with project requirements.

Key Components of a Test Plan

A robust test plan includes several essential components:

  • Resource Allocation: Who will test what?
  • Training Needs: Identifying skill gaps and training requirements.
  • Scheduling: Planning milestones and task durations.
  • Tools: Listing software and tools for testing and reporting.
  • Risk Management: Identifying potential risks and mitigation strategies.
  • Approach: Detailing the testing strategy and scope.

Crafting an Effective Test Plan

Creating an effective test plan involves several steps, from defining the document’s identifier and introduction to outlining the test items, features to be tested, and the testing approach. It also includes planning for staffing, scheduling, risk management, and detailing the deliverables that stakeholders can expect.

In the evolving landscape of software development, the importance of a comprehensive test plan cannot be overstated. It not only ensures the functionality and reliability of the software but also streamlines the development process, making it more efficient and effective. By adhering to a well-thought-out test plan, software engineering teams can navigate the complexities of project development, mitigate risks, and achieve their goals with precision.

All the data are related to this initial blog which helped me understand more about Software Testing: https://www.knowledgehut.com/blog/software-testing/test-plan-in-software-testing#frequently-asked-questions

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

CS-443: Week 12

Test Driven Development (TDD)

Test driven development is a form of testing done in software development that focuses on creating unit tests before the actual code. Developers create small test cases for every feature with the intention of modifying the code only when the tests fail. Test driven development is also a practice that focuses on the structure of the code that allows for the creation of optimized code that remains reliable over time.

TDD vs Traditional Testing

As stated above, one of the main differences between TDD and traditional testing is that tests are created before the actual code unlike traditional. However some other differences include the testing scope and the processes that each form of testing follows. The testing scope in TDD focuses on testing small, individual pieces of the codebase whereas traditional testing tests the entire system including integration testing. The process of each type of testing also differs in that TDD is an iterative process. As tests are created, this process also includes cycles of developing small chunks of code, testing that code, then refining until all tests pass. An important part of the TDD process is refactoring. Once tests pass, it’s important to check the code if there are any optimizations that can be made, or if there is any redundancy that should be removed.

Benefits to TDD

Test driven development allows for the creation of optimized code by nature because of the process that TDD follows. Once code is written, if the tests fails then the developer is forced to go back and fix the code until the tests pass. The test coverage that TDD covers is greater than traditional testing methods. This is because before any code is written for a specific functionality, the test is created beforehand which ensures every function passes testing. Using test driven development also helps in reducing the number of larger, more complex issues that arise. This is because testing is done on a consistent basis, where development does not progress until each set of tests are complete.

Conclusion

I chose this article because it clearly explained what test driven development is, differences between traditional and test driven development, and the benefits. I also appreciated the use of examples the article used to further explain what the TDD approach would look like in real scenarios. Learning about different approaches to developing software is helpful because I am exposed to approaches that could be more useful than what I already know. I plan to try test driven development in the future.

Resources:

https://www.browserstack.com/guide/what-is-test-driven-development

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

Why is Test Driven Development So Good

Article: https://www.thoughtworks.com/en-us/insights/blog/test-driven-development-best-thing-has-happened-software-design

Last class, we got some hands-on experience with using Test Driven Development. These concepts always feel more concrete and understandable when actually working with them  yourself, rather than only reading articles or looking at examples. I’ve since gotten the hang of this method of development, and wanted to look into how it compares with other development strategies. Such is how I found Test Driven Development is the best thing that has happened to software design by Arek Torczuk.

Throughout the entire article, Torczuk compares the methodologies of code-driven tests and test-driven code. In other words, he judges whether code-first test later is better than test-now code later, respectively. The results for this vary, of course; some companies or teams may benefit more from one strategy than the other. A noted flaw of code-driven testing is that your tests do not challenge the implementation and design of your code. You can create all the tests you’d like on a specific method, but nothing would make you second-guess the way you wrote the method. 

This is where the test-driven approach would come into play. Having already written the tests, you have a better idea of what your code should look like, and how it should act. As Torczuk states, you can ask yourself “What do I expect from the code?” with writing tests before the method (Torczuk). Essentially, with TDD, you know all the answers to your questions and when enough is enough in terms of tests & code. In my mind, it makes the process more streamlined.

Another important part of TDD Torczuk mentions is that it gives quick feedback about the design of your software. You’ll sooner realize the potential issues with your existing codebase, and how it might affect your ability to add new functionality. 

I selected this article because test-driven development piqued my interest after I had more time to experiment with it. This article grabbed my attention specifically because it didn’t just reiterate the concept of Test Driven Development over and over. Another quite useful part of this article is its inclusion of real examples of TDD by the author.

The content of this article was clear cut and organized, and even though it may not have been a ton of new information, it was a different perspective comparing test-driven development and code-driven tests. I learned that generally TDD is more effective at producing well-implemented code than simply writing the method first and tests later. Seeing as we are continuing to learn TDD, I’m confident that I’ll be able to use this in my future projects/jobs if necessary. Or, I could suggest it to my team if we are struggling with writing tests after code.

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.

Unraveling the Efficiency of Pairwise and Combinatorial Testing in Software Development (Week-11)

In the dynamic landscape of software development, ensuring the reliability and functionality of applications is paramount. Traditional testing methods, while thorough, often require substantial time and resources, prompting the industry to lean towards more efficient strategies. Among these, Pairwise and Combinatorial Testing have emerged as pivotal techniques, providing a balance between testing depth and resource allocation.

Pairwise Testing: A Closer Look

Pairwise testing, a subset of combinatorial testing, operates on a principle that most defects in software are triggered by interactions between pairs of input parameters. This method systematically generates test cases to cover all possible pairs of inputs, significantly reducing the number of tests needed to identify potential bugs. According to Capers Jones, a luminary in software engineering, pairwise testing can detect up to 75% of defects, presenting a compelling case for its adoption (Jones, 2008). This efficiency stems from the recognition that not all input combinations are necessary to uncover the majority of the issues, thus optimizing the testing process.

Combinatorial Testing: Expanding the Horizon

Combinatorial testing extends the concept of pairwise testing by considering interactions among three or more parameters. This technique is particularly beneficial in complex systems where interactions extend beyond simple pairs. While it requires more test cases than pairwise testing, it’s still far less than the exhaustive testing of all possible inputs. The National Institute of Standards and Technology (NIST) has highlighted combinatorial testing’s effectiveness, noting its capability to uncover intricate bugs that pairwise might miss, making it an indispensable tool for ensuring software robustness (Kuhn et al., 2013).

Integrating Pairwise and Combinatorial Testing into Development

The integration of these testing methodologies into the software development lifecycle can significantly enhance the quality assurance process. By identifying the most impactful combinations of parameters, developers can preemptively address issues, leading to more stable releases. Tools such as PICT (Pairwise Independent Combinatorial Testing tool) from Microsoft and Hexawise facilitate the implementation of these strategies, enabling teams to automate test case generation and focus on critical test scenarios.

Conclusion

Pairwise and combinatorial testing represent a paradigm shift in software testing, moving away from exhaustive and resource-intensive methods towards a more strategic approach. By focusing on the interactions that most likely contribute to defects, these methodologies offer a practical pathway to improving software quality without the overhead of traditional testing techniques. As software systems grow in complexity, the adoption of pairwise and combinatorial testing is not just advisable but essential for developers aiming to deliver flawless applications efficiently.

The practicality and effectiveness of these testing strategies underscore a broader trend in software development towards optimization and efficiency. As we continue to push the boundaries of what software can achieve, the methodologies we employ to ensure their reliability must evolve accordingly. Pairwise and combinatorial testing stand at the forefront of modern software quality assurance.

References:

  • Jones, C. (2008). Applied Software Measurement. McGraw-Hill Education.
  • Kuhn, D. R., Kacker, R. N., & Lei, Y. (2013). Introduction to Combinatorial Testing. CRC Press.

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.

Intro to Software Testing

Software testing != doing homework bt rather, Software testing == checking homework to make sure it’s done right. In this blog we’ll explore the basics: what testing is, how it’s done, and why it’s important. We’ll cover different ways to test, how deep we go into testing, some smart ways to test, and why testing is worth it. Let’s dive in!

What is Software Testing?

Software testing is the process of verifying and validating whether a software or application is bug-free, meets technical requirements, and satisfies user needs. It ensures that the software functions as expected, identifying errors, faults, or missing requirements in contrast to actual specifications. This process aims to enhance efficiency, accuracy, and usability.

Verification and Validation

  1. Verification: Ensures that the software correctly implements specific functions, answering the question, “Are we building the product right?”
  2. Validation: Confirms that the built software aligns with customer requirements, answering the question, “Are we building the right product?”

Different Types of Software Testing

  1. Functional Testing: Validates whether the software functions according to functional requirements.
  2. Non-functional Testing: Assesses non-functional aspects like performance, scalability, and usability.
  3. Maintenance Testing: Involves modifying and updating software to meet evolving customer needs.

Further, testing can be performed manually or through automation, each with its own set of advantages and applications.

Different Types of Software Testing Techniques

  1. Black Box Testing: Conducted without accessing the source code, focusing on software interface.
  2. White Box Testing: Involves knowledge of internal workings and access to source code.
  3. Grey Box Testing: Blends aspects of both black and white box testing, providing testers with partial knowledge of the internal workings. This approach offers a balanced perspective, allowing for effective testing while maintaining a degree of independence from the code’s intricacies.

Additionally, Grey Box Testing combines elements of both approaches.

Different Levels of Software Testing

  1. Unit Testing: Evaluates individual units or components of the software.
  2. Integration Testing: Tests the interaction between integrated units.
  3. System Testing: Assesses the complete, integrated system or software.
  4. Acceptance Testing: Determines system acceptability based on business requirements.

Each level serves a distinct purpose in ensuring software reliability.

Best Practices for Software Testing

  • Continuous Testing: Test each build as it becomes available to reduce risks and improve functionality.
  • User Involvement: Engage users to understand their needs and perspectives during testing.
  • Test Segmentation: Divide tests into smaller parts for efficient analysis and resource utilization.
  • Metrics and Reporting: Track project metrics and share test results for improved collaboration and decision-making.
  • Regression Testing: Continuously validate the application to maintain its integrity.
  • Avoid Programmer Bias: Programmers should refrain from writing tests to maintain objectivity.
  • Service Virtualization: Simulate systems and services to reduce dependencies and start testing sooner.

Benefits of Software Testing

  • Product Quality: Ensures delivery of high-quality software by detecting and fixing errors early.
  • Customer Satisfaction: Identifies and resolves issues before delivery, enhancing user experience.
  • Cost-effectiveness: Saves time and money by detecting and fixing bugs in early stages.
  • Security: Protects software from internal and external security vulnerabilities.

Sources https://www.geeksforgeeks.org/software-testing-basics/

From the blog CS@Worcester – CS: Start to Finish by mrjfatal and used with permission of the author. All other rights reserved by the author.

Testing Gone Mobile

In another of my classes I am beginning to learn android mobile app development. This gave me a lot of interesting thoughts about how testing might look for mobile app development. As the applications are full-stack applications, and require testing of the back and front ends. I had questions like: “What would testing a front end look like? Simply applying it and clicking around?” and “How might we test back-end functions if they are intrinsically tied to the front-end?”. To find out more I looked on stickyminds, where I find most of my articles. I found an article about Testing Usability in Mobile app Development The title struck me as answering the first of my questions, so I chose to delve into it. The article’s title is Testing Usability for Mobile Applications by Mukesh Sharma.

The article provides an in-depth analysis of the pivotal role of usability in mobile applications. Usability has a profound impact on user engagement and app longevity, and this is something I can corroborate, as I have chosen apps with higher usability over similar apps with better quality and functions, but lesser usability. The article highlights specific usability characteristics: app simplicity to facilitate navigation effectively, helpful error handling mechanisms to guide users through troubleshooting and make it less of a hassle, optimizing efficiency to speed up tasks, and prioritizing user satisfaction to keep the app functional and supported by users. The article also delves into the nuanced focus areas for usability testing, including functionality assessments to verify feature completeness, contextual evaluations to tailor experiences to user preferences and test them against other preferences, rigorous device compatibility testing to ensure seamless performance across diverse models of mobile device and OS, examining in detail and scrutinizing data entry methods, and comprehensive examination of multimodality, to avoid user uncomfortability. The article uses an example of the Skype app to explain these potential problems. When moving the phone away from your ear, it would switch the speaker in your phone from the call speaker, to the loud back speaker. This is similar to the function in my Samsung Galaxybuds. When you take them out of your ear, it stops what’s playing or disconnects entirely. These are examples of uncomfortable features that have not been tested fairly. By adhering to the best practices for testing, developers can fix these issues in the testing phase, and assure no issues come from the software.

This applied extensively to several of my classes. I had been wondering how to think about tailoring mobile applications to the user, since learning about their development in one of my classes. This article has given extensive explanations into some poor features, and how to test to avoid these issues in the creation of the app. This will be very useful not only for mobile applications, but for testing full-stack applications as a whole, as the article covers mainly abstract ideas for testing full-stack applications.

Source:
https://www.stickyminds.com/article/testing-usability-mobile-applications

From the blog CS@Worcester – WSU CS Blog: Ben Gelineau by Ben Gelineau and used with permission of the author. All other rights reserved by the author.