Best of TestingJuly 2024

  1. 1
    Article
    Avatar of hnHacker News·2y

    darrenburns/posting: The modern API client that lives in your terminal.

    Posting is a terminal-based HTTP client designed for efficient keyboard-centric interactions. It stores requests locally in YAML files, ensuring easy version control. Key features include 'jump mode' navigation, environment/variable management with autocompletion, various themes, and a command palette. Installation requires Python 3.11 or later and can be done using pipx. Users can also import OpenAPI 3.x specifications to create collections. Configuration is flexible, supporting YAML files, environment variables, and .env files.

  2. 2
    Article
    Avatar of communityCommunity Picks·2y

    Understanding Tdd vs Bdd : A Guide For Developers

    TDD (Test Driven Development) and BDD (Behavior Driven Development) are two development approaches that emphasize testing and collaboration but have distinct differences. TDD is developer-centric and focuses on code correctness, while BDD is user-centric and revolves around system behavior. TDD involves writing tests before code, whereas BDD involves writing behavior specifications before code. Both methodologies can be complementary, with TDD ensuring technical correctness and BDD ensuring the application meets user expectations. Examples and steps to implement each approach are provided.

  3. 3
    Article
    Avatar of communityCommunity Picks·2y

    Playwright: A Fast and Practical Introduction

    This post offers a quick and practical introduction to Playwright, a fast e2e testing framework. It guides readers through key testing concepts such as navigating, selecting elements, performing actions, writing assertions, and mocking API calls. Practical code examples illustrate these concepts, making it easier to start writing effective and resilient tests.

  4. 4
    Article
    Avatar of webtoolsweeklyWeb Tools Weekly·2y

    JavaScript Libraries, Testing Tools, Git/CLI

    Issue #574 of Bytes covers a wide range of JavaScript topics including libraries such as Rezact, Bridge, and Flitter, testing tools like screen-scaler and Quickboot.js, and Git/CLI tools such as git-cliff and concurrently. The newsletter also includes commercial apps and services, and a call to action for developers to share tools they've created.

  5. 5
    Article
    Avatar of cypresscypress·2y

    Introducing UI Coverage

    UI Coverage by Cypress introduces a visual approach to test coverage, helping development teams analyze and report on untested areas in their applications. It automatically detects which pages and elements remain untested, providing a dynamic visual map to highlight gaps. This tool simplifies setup, offers instant coverage reports without additional configuration, and enables teams to make data-driven decisions for comprehensive testing and efficient resource allocation.

  6. 6
    Article
    Avatar of lambdatestLambdaTest·2y

    How To Write a Test Cases in Java

    Writing test cases in Java is essential for ensuring code reliability and robustness. This guide covers fundamental concepts like the importance of test cases, locating WebElements, and setting up a project using Maven and Eclipse IDE with TestNG and Selenium frameworks. It also explains structuring the tests, setting up and tearing down WebDriver instances, and executing tests both locally and on the LambdaTest cloud platform. Additionally, best practices for writing test cases are provided to help make your tests maintainable and reliable.

  7. 7
    Article
    Avatar of phProduct Hunt·2y

    VCCGenerator - Virtual Credit Card Generatior for Developers and Testers

    VCCGenerator, launched on July 5th, 2024, is a new tool designed for developers and testers to generate virtual credit cards. It caters to SaaS and developer tool needs, assisting in various testing scenarios involving credit cards.

  8. 8
    Article
    Avatar of codemazeCode Maze·2y

    How to Test IServiceCollection Registrations in .NET

    Unit testing IServiceCollection registrations in .NET is essential for catching errors related to dependency injection setups early in the development cycle. By testing service configurations—such as Singleton, Scoped, and Transient lifetimes—developers can ensure that dependencies are correctly registered and injected, improving code reliability and maintainability. The process involves creating extension methods for service registration and validating them through unit tests, promoting best coding practices and overall application stability.

  9. 9
    Video
    Avatar of wdsWeb Dev Simplified·2y

    100% Code Coverage Is Useless

    Testing is crucial for high-quality software, but 100% code coverage is an unreliable metric for code quality. Code coverage measures how many lines of code are executed but doesn't guarantee that all scenarios or intentions behind the code are tested. High code coverage may lead to neglecting important integration and end-to-end tests, which better simulate how users interact with an application. Instead of focusing on code coverage, developers should aim to test the intent and purpose behind their code, especially for user-critical functionalities.

  10. 10
    Article
    Avatar of communityCommunity Picks·2y

    Building an Elixir Rate Limiter with ExRated, ExUnit, and Doctests via TDD

    Learn to build a rate limiter in Elixir using ExRated, ExUnit, and doctests in a step-by-step guide. The tutorial covers the setup of ExRated for bucket-based rate limiting, using TDD for development, and implementing unit tests along with logging. Highlights include the use of `@doc` blocks for documentation-driven tests and exploring the limitations of doctests. It emphasizes the importance of real unit tests for comprehensive testing, and covers additional enhancements like function typespecs and input guards.

  11. 11
    Article
    Avatar of rustdevsRust Developers·2y

    Testing in Rust

    Testing is an integral part of software development, and Rust simplifies this process with built-in functionalities. The post explores basic testing in Rust, showcasing sample test functions using #[test] and macros like assert! and assert_eq!. It also covers scenarios of failing tests, adding custom failure messages, and testing for panics using #[should_panic]. Error handling in tests through Result<(), E> is also demonstrated.

  12. 12
    Article
    Avatar of newstackThe New Stack·2y

    How To Test How Much Memory Your Java Application Uses

    Understanding a Java application's memory requirements is crucial for maximizing performance and minimizing operational costs. This guide shows how to use garbage collector (GC) logs to determine the necessary memory size. Key steps include simulating real-world loads, interpreting GC logs, and using tools like JMeter for load testing. Practical examples with the Spring PetClinic application and different Java runtimes are provided to illustrate the process.

  13. 13
    Article
    Avatar of typescripttvTypeScript.TV·2y

    Boost Your TypeScript Tests with Mutation Testing

    Mutation testing enhances your TypeScript test suite by introducing small code changes and verifying if your tests can detect them. Using the Stryker framework, you can set up mutation testing, detect weak tests, identify ineffective code, and handle large codebases with incremental testing. This approach helps in significantly improving test accuracy and overall code quality.

  14. 14
    Article
    Avatar of communityCommunity Picks·2y

    Revolutionising Unit Test Generation With Llms

    Comprehensive testing is crucial as software systems grow in complexity, but writing unit tests can be time-consuming and repetitive. Traditional manual unit testing consumes around 30% of a developer's time. AI-driven tools like GitHub's Copilot offer assistance but often result in non-functional tests. Meta's TestGen-LLM offers an innovative, automated approach to improve unit test coverage using Large Language Models (LLMs). This method ensures high coverage and reliability with minimal human intervention by generating candidate test cases, integrating them into the build system, and validating their effectiveness. Despite current limitations, such as high costs and incomplete automation capabilities, AI-driven unit test generation represents a significant advancement over manual methods.

  15. 15
    Article
    Avatar of freekFREEK.DEV·2y

    How to make all routes in your Laravel app work by writing just a single test

    The spatie/pest-plugin-route-testing package allows you to test all common routes in a Laravel app with a single test, simplifying the process of ensuring that pages work as intended. It supports testing specific routes, excluding certain routes, and working with route model bindings, thereby providing flexibility for developers. This package automates the testing of new pages, making it easier to maintain comprehensive test coverage.

  16. 16
    Article
    Avatar of appsignalAppSignal·2y

    Exploring the Node.js Native Test Runner

    Node.js has introduced a stable test runner in its standard library starting from version 18. This inclusion aims to emphasize the importance of testing as an integral part of development and to provide core tooling out-of-the-box, addressing the minimalist philosophy traditionally held by Node.js. The post walks through the core capabilities of the test runner, from writing and executing tests to organizing and customizing them. It also demonstrates the usage through examples, showing how to write unit tests, run them, handle test failures, and organize test cases.

  17. 17
    Article
    Avatar of hnHacker News·2y

    codeintegrity-ai/mutahunter: Open Source Language Agnostic LLM-based mutation testing tool

    Mutahunter is an open-source, language-agnostic mutation testing tool that leverages LLM models to inject context-aware faults into codebases for comprehensive testing. It surpasses traditional AST-based methods by generating mutations that closely resemble real vulnerabilities, enhancing software security and quality. The tool supports various programming languages and generates detailed mutation coverage reports. Mutahunter can be integrated with CI/CD platforms and supports self-hosted LLM models, ensuring data security. Installation and usage instructions are provided, along with examples of command options and report generation features.

  18. 18
    Video
    Avatar of oxylabsOxylabs·2y

    Playwright vs Selenium: Which One to Choose

    Selenium and Playwright are two popular web automation frameworks used for web scraping and testing. Selenium supports a wide range of programming languages and browsers but requires individual WebDriver installations. On the other hand, Playwright, although supporting fewer languages and browsers, offers an easier implementation and faster performance due to its modern architecture and built-in drivers. Both tools have their own strengths, making Selenium suitable for flexibility and extensive community support, while Playwright is best for simpler and quicker implementations.

  19. 19
    Article
    Avatar of lambdatestLambdaTest·2y

    How To Generate Pytest Code Coverage Report

    Code coverage measures how much of an application's source code is exercised by tests, typically expressed as a percentage. Using the pytest framework, developers can generate detailed code coverage reports using tools like coverage.py and pytest-cov. These tools provide various reporting options, such as HTML or XML, and support extensive customization. Achieving high code coverage helps identify untested code, minimizing the risk of undetected bugs. Walkthroughs and examples demonstrate how to set up and execute tests for comprehensive code coverage, even on cloud-based platforms like LambdaTest.

  20. 20
    Article
    Avatar of jetbrainsJetBrains·2y

    Snapshot Testing in .NET with Verify

    Snapshot testing focuses on verifying the entire state of an object after an action, rather than asserting individual properties. This technique helps catch unintended changes in your code. The Verify library supports snapshot testing in .NET and integrates with various unit testing frameworks. It involves creating initial snapshots that developers manually verify and commit to source control. Verify also provides customizable settings and supports serialized comparisons of various objects beyond JSON.

  21. 21
    Article
    Avatar of lnLaravel News·2y

    Assert the Exact JSON Structure of a Response in Laravel 11.19

    Laravel 11.19 introduces several new features including the assertExactJsonStructure() method for testing precise JSON responses, the whereNone() query builder method, withoutHeader() for excluding headers in test requests, new HTML assertion methods, and a Number::trim() method for trimming zeros after decimal points. These additions enhance testing and query capabilities in Laravel.

  22. 22
    Article
    Avatar of ardlbsArdan Labs·2y

    Ep. 11: Enhancing Go Code with Effective Application Layer Tests

    Learn how to enhance Go code with effective application layer tests that ensure comprehensive coverage, manage dependencies, and handle context for better software quality. Strategies include organizing tests at the domain level using subtests and setting up mock APIs to ensure seamless component interaction and robust error handling.

  23. 23
    Article
    Avatar of telerikTelerik·2y

    Testing Services in Angular

    Learn how to test Angular services to ensure proper interactions with APIs. The guide covers cloning a project, installing dependencies, and setting up TestBed with HttpClient and HttpTestingController for mocking API responses. Detailed steps are provided for writing and running tests, including checking instance creation and validating HTTP requests using Jasmine matchers.

  24. 24
    Article
    Avatar of bytesdevBytes by ui.dev·2y

    Vitest and the future of testing

    Vitest 2.0 includes a major new feature called Browser Mode, enabling component testing with real browser events for more accurate results. It unifies tooling by allowing the same configuration to be used across unit, component, and end-to-end tests. Additionally, discussions include using StackBlitz for improved design systems and updates on various web development tools and frameworks.

  25. 25
    Article
    Avatar of collectionsCollections·2y

    How Uber Minimizes Flaky Tests

    Uber's innovative Testopedia system minimizes flaky tests in their continuous integration infrastructure. Testopedia tracks test statistics like reliability and execution time, categorizes tests, and alerts teams of unhealthy tests. Key features include a bucketing algorithm for efficient data querying and a sliding window algorithm to detect flaky tests. Strategies such as running critical tests regardless of flakiness and using non-blocking modes for PRs help maintain a stable development workflow.