Best of TestingAugust 2024

  1. 1
    Article
    Avatar of communityCommunity Picks·2y

    Step-by-Step Guide to Testing React Components with Jest and React Testing Library

    Learn how to test React components using Jest and React Testing Library. Understand the importance of testing in React development, set up a testing environment, and get acquainted with essential Jest syntax. Follow a practical guide to create, run, and debug test cases for a Todo application, enhancing the robustness and reliability of your React applications.

  2. 2
    Article
    Avatar of nodejsdevelopersNode.js developers·2y

    Node.js Tip of the Week

    Node.js introduces a new feature in its native test runner, allowing developers to mock method calls using mock.method(object, method). This feature supports the optional provision of a custom implementation.

  3. 3
    Article
    Avatar of mdnblogMDN Blog·2y

    How to debug mobile apps across devices

    Bugs in mobile apps harm user experiences, affect first impressions, and increase uninstallation rates, leading to lost revenue. Mobile app debugging involves finding and fixing bugs, often using real device clouds to ensure thorough testing across different environments. Debugging on multiple devices is essential due to device fragmentation, variations in operating systems, vendor UI modifications, considerable system changes, and hardware optimizations. Techniques like analyzing trace log files, using breakpoints, and external debuggers aid in this process. Tools like Android Studio, Xcode, and LambdaTest are highly valuable for debugging across various devices effectively.

  4. 4
    Article
    Avatar of atomicobjectAtomic Spin·2y

    4 Tips for Writing More Testable Code

    Learn how to make your code more testable by choosing specific input types, avoiding object mutations, keeping complex logic out of the database, and creating new modules or services when needed. These practices not only facilitate easier testing but also improve overall code quality and maintainability.

  5. 5
    Article
    Avatar of programmingdigestProgramming Digest·2y

    How Uber Tests Payments In Production

    Uber's approach to ensuring well-run payment systems involves engineers focusing on catching unknown unknowns quickly. This strategy is integral to developing reliable payment systems in production environments.

  6. 6
    Article
    Avatar of lobstersLobsters·2y

    Working with Protobuf in 2024

    Protocol Buffers (protobuf), a data serialization tool from Google, has become integral in software development for its compact data structuring. Traditional workflows involving manual compilation and error-prone build steps have seen improvements with new tooling. Innovations like JSON to Proto, Protobuf Pal, and Buf CLI simplify protobuf development, offering features such as automated code generation, dependency management, and consistent code formatting. Tools like Buf Studio, Postman, Insomnia, and k6 further enhance testing capabilities. FauxRPC allows developers to create realistic mock gRPC services for faster prototyping. These advancements collectively streamline protobuf workflows and improve productivity.

  7. 7
    Video
    Avatar of awesome-codingAwesome·2y

    Write Better Code

    Writing high-quality code requires adhering to several core principles. Avoid excessive comments and instead focus on making code self-explanatory through good naming conventions for variables and methods. Maintain small, focused functions to reduce complexity and follow practices that prevent code deterioration over time. Effective error handling is crucial, using exceptions instead of return codes and avoiding null values. Embrace the principle of simplification in your development process. Lastly, prioritize simple, clear, and balanced testing to ensure robust and maintainable software.

  8. 8
    Article
    Avatar of itnextITNEXT·2y

    Exploring API Stubbing Strategies in Node.js

    API stubbing is crucial for testing Node.js applications that depend on external services. The post explores two key tools, Nock and stub-service, which allow you to mock HTTP requests or create stub servers, respectively. Nock is ideal for intercepting HTTP requests within the same process, while stub-service lets you set up a local stub server quickly. Understand their use cases and limitations to choose the right tool for effective testing.

  9. 9
    Article
    Avatar of amigoscodeAmigoscode·2y

    Testing Pyramid

    The testing pyramid guides the strategy for test automation in software development, emphasizing a balance with a strong foundation of unit tests, and a smaller number of higher-level tests like integration, end-to-end, and UI tests.

  10. 10
    Article
    Avatar of baeldungBaeldung·2y

    DDD with jMolecules

    Learn how to leverage jMolecules to express Domain-Driven Design (DDD) concepts using annotations and type-based interfaces. The post covers key DDD elements such as Value Objects, Entities, Aggregate Roots, and Repositories, and demonstrates how to use jMolecules for building a domain model of a blogging application. It also explains how to integrate jMolecules with popular Java and Spring libraries and enforce DDD principles using ArchUnit.

  11. 11
    Article
    Avatar of hnHacker News·2y

    How I program in 2024

    A programmer reflects on the evolution of their coding practices from 2015 to 2024. They discuss moving away from heavy use of tests and version control, towards more intuitive and context-specific programming strategies. Key insights include the importance of simplicity, avoiding unnecessary abstractions, and the value of periodically rewriting software from scratch to better understand and optimize its function.

  12. 12
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Generating Java Test Data With Instancio

    Manual test data creation in Java can lead to boilerplate code and limited test coverage. Instancio is a Java library designed to automate test data generation with a fluent API, reducing verbosity and enhancing test reliability by incorporating randomized data. Instancio allows customization of fields, exclusion of specific properties, and enables reproducible tests through seed values. It also supports Bean Validation for generating constraint-compliant test data and integrates seamlessly with JUnit and Spring Boot. Instancio simplifies creating JSON request bodies for `@WebMvcTest` and promotes reusable test data templates to further enhance test clarity and maintainability.

  13. 13
    Article
    Avatar of awegoAwesome Go·2y

    Full Introduction to Golang with Test-Driven Development. Part I

    This post provides a comprehensive introduction to Golang with a focus on Test-Driven Development (TDD). It guides you through writing a classic 'Hello, World!' program using TDD principles, including creating and organizing folders, initializing a Go module, and writing functional tests. It also covers the basics of Go packages, the `go.mod` file, and the use of the `fmt` package for printing to the terminal.

  14. 14
    Article
    Avatar of atomicobjectAtomic Spin·2y

    Tips for Using React Testing Library to Write Unit Tests

    Unit testing ensures code functions as expected. Test-driven development (TDD) at Atomic Object involves writing tests based on code requirements first. This post offers tips for using React Testing Library efficiently, such as choosing the right query method (getBy, findBy, queryBy), avoiding multiple assertions in a waitFor, and using screen instead of destructuring functions from render. Also, using an ESLint plugin can help avoid common pitfalls.

  15. 15
    Article
    Avatar of storybookStorybook·2y

    Component testing in Storybook

    Web UI technology has evolved significantly, but maintaining production UIs remains challenging. Storybook advocates for component testing as a balance between end-to-end and unit tests, offering high fidelity and reliability. Component tests render a UI component in the browser, providing the speed and compactness of unit tests while simulating user interactions like end-to-end tests. This approach ensures thorough UI coverage and complements traditional testing methods. Storybook 8.2 supports component testing, and upcoming improvements will enhance its capabilities further.

  16. 16
    Article
    Avatar of softwaretestingmagazineSoftware Testing Magazine·2y

    Web Application Testing in 2024: 10 Best Practices

    Web application testing in 2024 requires a holistic approach to ensure apps are bug-free and user-friendly. Key practices include starting testing early, balancing automated and manual tests, prioritizing security, ensuring usability, conducting cross-browser testing, and leveraging real user monitoring. Documenting processes and adapting to agile methodologies are crucial, as is staying updated with the latest tools and trends like AI-powered and visual testing tools.

  17. 17
    Article
    Avatar of fluttersquadFlutter Developers·2y

    Api Integration

    Postman is a powerful tool for API integration, making it easier to create requests, visualize responses, and handle complex workflows. It significantly enhances the development process by simplifying API testing and management.

  18. 18
    Article
    Avatar of communityCommunity Picks·2y

    Understanding and Creating Test Cases in Software Testing

    Test cases are vital for validating a software application's functionality, quality, and reliability. This guide explains different types of test cases—such as functional, non-functional, regression, negative, boundary, smoke, and integration tests—along with how to measure test coverage and use various tools for managing test cases. Additionally, leveraging AI can help identify and generate edge cases, enhancing test coverage and system robustness.

  19. 19
    Article
    Avatar of baeldungBaeldung·2y

    Automated End-to-End Testing With Playwright

    End-to-end testing helps ensure software reliability by simulating real user interactions. Using Playwright with TypeScript facilitates the automation of these tests. Detailed steps to set up Playwright via VS Code, along with scenarios for user registration and product search on a sample eCommerce site, are provided. Cloud-based platforms like LambdaTest can enhance the testing process by offering cross-browser capabilities on multiple operating systems. The article includes comprehensive code snippets for setting up and performing these tests.

  20. 20
    Article
    Avatar of nordicapisNordic APIs·2y

    6 Ways AI Can Enhance API Testing

    Discover how AI, particularly large language models (LLMs), can enhance API testing by generating quality mock data, validating heuristic responses, simulating loads, modeling security threats, discovering vulnerabilities, and validating error handling. These advancements promise more effective and efficient testing while considering the technology's limitations.

  21. 21
    Article
    Avatar of flutter_comFlutter Community·2y

    Enterprise Mobile Apps Development Principles

    Building efficient complex mobile applications involves simplifying problems rather than over-complicating architectures. Use well-defined boundaries between modules and prefer simple, understandable code. Unified tools and patterns improve maintainability and consistency across projects. Tests are crucial for validating application behavior and enabling refactoring. Experimentation within isolated modules can lead to improvements, but should be cautiously scaled. Effective documentation should be kept close to the code to ensure it remains up-to-date and relevant.

  22. 22
    Article
    Avatar of lnLaravel News·2y

    Use Laravel's Built-in SetUp Hooks for Application Test Traits

    Laravel provides useful test traits to help automate setup tasks in feature tests. The base TestCase class uses the setUpTheTestEnvironment() method to clear resolved instances, refresh the application, and run setup operations for various traits. This process includes checking and invoking specific setup and teardown methods defined in traits, which helps avoid repetitive boilerplate code and centralizes initialization logic. A practical example discussed is creating a trait to interact with a Wiremock server, simplifying setup and cleanup tasks.

  23. 23
    Article
    Avatar of droidcondroidcon·2y

    Flutter clean code and best practices

    Learn the approach for clean code and best practices in Flutter, covering essential aspects like maintainability, readability, and scalability. Explore principles like naming conventions, consistent formatting, code reviews, project structure, and optimization techniques. Understand the importance of using Dart’s type system, leveraging Flutter’s widgets, and writing tests. Additionally, discover tips for performance and network optimization, such as caching, progressive loading, memory management, and more, to build efficient and high-quality Flutter applications.

  24. 24
    Article
    Avatar of lobstersLobsters·2y

    Why Playwright is less flaky than Selenium

    Playwright is considered less flaky than Selenium because its speed forces correct UI test writing from the start. Selenium's slower performance can allow race conditions to pass undetected, leading to erratic test failures. Switching to Playwright may reveal pre-existing issues in tests, which is beneficial for writing more reliable tests.

  25. 25
    Article
    Avatar of logrocketLogRocket·2y

    Vitest adoption guide: Overview, examples, and alternatives

    Vitest is a robust testing library built on top of Vite, supporting various JavaScript frameworks and Node.js for backend testing. It offers out-of-the-box features like hot module reload (HMR), TypeScript, and ECMAScript module (ESM) support. Vitest is Jest-compatible, making transitions easy, and is particularly efficient with incremental testing. It's highly configurable, integrates well with IDEs, and includes extensive documentation and community support. Vitest also provides features like inline testing, mocking, snapshots, and test coverage.