This article explains the Chain of Responsibility design pattern, defines its three core roles, compares external and internal composition, demonstrates a lead‑filtering use case with Java and Spring code, and discusses benefits, drawbacks, and differences from the Strategy pattern.
Unit testing prevents recurring bugs in large front‑end projects by forcing modular, testable code, and with Jest—especially for Vue—developers can quickly write, run, and enforce comprehensive tests covering props, methods, slots, Vuex, and coverage thresholds, while AI tools can scaffold boilerplate test files.
This note introduces several open‑source C unit‑testing frameworks, compares their features, and provides a step‑by‑step guide for porting and using the Unity framework on an STM32 platform, including configuration, test case writing, and result interpretation.
This article explains how the open‑source AutoDev plugin builds an end‑to‑end AI‑assisted coding solution that fine‑tunes open LLMs, constructs a Unit Eval dataset, engineers prompts for unit‑test generation, and enforces quality through a unified write‑evaluate pipeline.
This article explains what unit testing is, why it is essential for software quality, outlines its benefits such as early bug detection and design improvement, and provides practical guidance on writing effective Java unit tests using JUnit5, Mockito, and JaCoCo, along with CI integration and best‑practice principles.
This guide walks through configuring CLI interpreter path mappings, setting up Docker container paths, installing PHPUnit, creating a comprehensive phpunit.xml configuration, organizing test directories, writing a bootstrap script, and generating test reports, providing a complete backend testing workflow for PHP projects.
This article outlines a comprehensive strategy for ensuring code quality within monorepo architectures by isolating unit tests via Git submodules, automating test execution in CI pipelines, and enforcing structured code reviews through a configurable Code Owner mechanism to mitigate integration risks.
This comprehensive guide walks you through Pytest fundamentals, basic usage, fixture mechanisms, conftest configuration, and advanced features such as Allure report beautification, parameterized data‑driven testing, and YAML integration, providing practical code examples for Python test automation.
This guide introduces the PEST PHP testing framework, explains its key features and expressive syntax, and demonstrates how to write tests using the “it” and “test” functions with practical code examples for common arithmetic operations.
This article explains what unit testing is, why it’s essential, and provides a step‑by‑step guide for writing Java unit tests with JUnit, integrating them into Maven projects, and generating detailed coverage reports using IDE features and JaCoCo.
This article describes Huolala's journey from a legacy PHP codebase to a Java‑centric microservice architecture, the common misconceptions and difficulties of unit testing, and the design of an automated CI/CD pipeline that integrates Tekton, SonarQube, GitLab Runner, JUnit5, and Mockito to enforce coverage gates and improve code quality.
This article shows programmers how to harness ChatGPT beyond simple Q&A by using advanced prompting techniques for knowledge summarization, task decomposition, code reading, refactoring, generation, unit‑test creation, and plugin integration, turning AI into a practical development assistant.
This article explains how Volcano Engine identified the tangled authorization, data‑fetching, and performance problems of its advertising AB‑testing platform and refactored it by splitting services, redesigning the data model with MySQL and ClickHouse, applying DAG scheduling, time‑wheel algorithms, Domain‑Driven Design, and rigorous unit testing to achieve a more stable, extensible backend solution.
This article explains why clean code matters, demonstrates how meaningful naming, single‑responsibility classes, well‑structured functions, and disciplined testing (TDD and the FIRST principles) improve readability, maintainability, and productivity, using concrete Java examples, refactorings, and step‑by‑step guidelines.
The article explains that unit, integration, and functional testing should be fully automated and managed by CI/CD platforms to boost release confidence, avoid regressions, and prevent manual testing from slowing down deployment cycles.
The article explains the “front door first” principle for UI component testing, showing how a disabled Buy button can be missed by unit tests, demonstrates proper interaction‑based tests with code examples, discusses interface design and mock usage, and concludes with a promotion for a Python continuous‑deployment course.
This article traces the evolution of software testing from manual QA to developer‑driven automation, explains what unit testing is, presents the testing pyramid, outlines its many benefits, and warns against common anti‑patterns and misconceptions to help teams adopt effective unit testing.
This article introduces five common Python automated testing scenarios—unit testing, API testing, web UI testing, performance testing, and database testing—providing clear explanations and complete code examples to help developers improve software quality and stability.
The article explains that the closer a test is to the code being changed, the easier it is to write effective automated tests, argues for modular, small‑scale units as the ideal test target, and promotes a Python‑focused continuous‑deployment training course.
The article examines why end‑to‑end testing strategies frequently break in practice, illustrates common pitfalls through a realistic scenario, and proposes a more reliable testing pyramid that emphasizes fast, reliable, isolated unit and integration tests while establishing quick feedback loops for developers.
This guide walks you through installing the CodeGPT extension in Visual Studio Code, configuring your OpenAI API key, and using its features—code generation, explanation, refactoring, and unit test creation—to boost productivity with AI-assisted programming.
The article describes how Volcano Engine's DataTester team refactored the advertising AB testing platform by splitting services, redesigning the data model with MySQL and ClickHouse, introducing DAG‑based scheduling and a time‑wheel algorithm, and applying domain‑driven design and rigorous unit testing to improve stability, scalability, and maintainability.
This article explores Test‑Driven Development (TDD), explaining its core concepts, common misconceptions, tool choices such as JUnit, Mockito and JaCoCo, and provides practical case studies including a simple calculator and layered architecture examples in both anemic and DDD models.
This article explains the concepts of narrow and broad unit testing, the shift‑left and shift‑right testing strategies, compares Mike Cohn’s and Google’s test pyramids, discusses the limitations of unit testing, and shows how unit testing fits into traditional and agile development models.
The Golang Unit Testing Plugin 3.0 unifies scripts, uses containerized resources, supports all Go versions, provides precise AST‑based incremental coverage, and generates detailed HTML reports, enabling developers to select the plugin in Aone Lab and automatically compile, test, collect coverage, and upload results, dramatically reducing integration effort and improving CI efficiency across dozens of applications.
This article shares a team's experience of establishing and refining Flutter unit testing across multiple apps, covering preparation, tooling, coverage improvement, effective test writing, efficiency tricks, and a detailed FAQ of common pitfalls and solutions.
This article explains why unit testing is essential for Go development, compares the legacy 2.0 approach with the new 3.0 plugin, details the plugin architecture, execution flow, code snippets, and shows real-world adoption results with clear HTML reports.
This article explores how to effectively use unit testing in daily development, defining its purpose, debunking common misconceptions, presenting the AIR principles, offering coverage level guidelines, and sharing practical tips, code examples, and solutions for handling mocks, static classes, and integration challenges.
This article explains automated testing concepts, compares unit, integration, TDD and BDD approaches, shows how to write Jest test cases without a framework, configure Jest, use matchers, handle async code, hooks, mocks, timers, snapshots, DOM testing, and provides practical code examples and repository links.
This article explains the motivation for writing unit tests for shared React hook modules, demonstrates how an AI assistant in the Cursor IDE can generate Jest test cases from a repository, and details the step‑by‑step process of configuring the environment, fixing failing tests, and reflecting on AI's current limitations.
This article explains what unit testing is, provides C# code examples for a simple calculator, and discusses four reasons why automated unit tests should run in CI/CD pipelines to improve development speed, prevent regressions, and protect code written by other developers.
This guide shows how to prompt ChatGPT as a Java developer, transform a flawed if‑else calculator into a clean Strategy‑pattern implementation, and write comprehensive JUnit tests, while warning about code‑security risks when using large language models.
This article offers pragmatic, engineering‑focused advice on why unit testing matters, what makes a good test, when to write or skip tests, who should write them, and how to structure tests using the classic arrange‑act‑assert pattern.
code qualitysoftware testingtest-driven development
This article explains why unit testing is essential for reusable components, introduces Jest fundamentals, demonstrates how to write and run tests with code examples, and shows how to enhance UI component testing using @testing-library/react, @testing-library/user-event, and @testing-library/jest-dom, providing a complete workflow for reliable front‑end development.
The article shares practical techniques for improving unit test coverage in massive, low‑quality legacy codebases, including creating isolated new modules, applying test‑driven development, decoupling through design patterns, extracting interfaces, using seams, and employing mocking to overcome static dependencies.
This article provides an in‑depth tutorial on unit testing using Spock, covering its advantages over JUnit, core concepts like specifications, fixtures, feature methods, data‑driven testing, mock and stub techniques, interaction constraints, and tooling for automated test generation, all illustrated with Groovy and Java code examples.
This article explains why unit tests should focus on verifying behavior rather than merely increasing coverage, outlines essential testing principles such as AIR, FIRST, and ASCII, provides concrete Java examples for writing, validating, and asserting tests, and offers detailed guidance on handling exceptions and method‑call verification to avoid ineffective testing.
This article explains why clean, well‑structured code is essential for productivity, outlines best practices for naming, class design, function implementation, and testing, and provides concrete examples and refactoring techniques to help developers write maintainable software.
This open‑source C++ mock framework leverages Frida‑gum to replace any function—including static, member, virtual, and library calls—at runtime without source changes, offering simple MOCK and MOCK_RETURN macros, call‑count expectations, automatic scope‑based rollback, and cross‑platform support for reliable, non‑intrusive unit testing.
This article demonstrates how to use JUnit's Assert methods for various checks, creates mock objects and verifies interactions with Mockito, and leverages Java 8 Stream's peek operation for debugging, providing complete code examples for each technique.
The article details how China Construction Bank's software development center enhanced code quality and accelerated delivery by integrating unit testing, test‑driven development, mutation testing, automated test code generation, code‑style scanning, and shared template mechanisms within a mature DevOps pipeline.
The article outlines how to design robust SpringBoot unit tests by first mastering business flows and external dependencies, preparing isolated test data, using Mockito’s @Mock/@MockBean and @Spy/@SpyBean correctly—including proper stubbing techniques—and applying best‑practice rules and the ACTS 2.0 framework for data‑driven, coverage‑verified testing.
This comprehensive guide explains why automated testing is essential for frontend development, outlines the differences between unit, integration, component, and end‑to‑end testing, and recommends practical tools and frameworks such as Jest, Vitest, Testing Library, Cypress, Playwright, and Puppeteer.
Effective unit testing—fast, readable, isolated, deterministic, and focused on a single behavior—relies on disciplined design, proper use of test doubles, the test‑pyramid hierarchy, meaningful assertions, continuous code‑review feedback, and mindful coverage, enabling safe refactoring, reduced maintenance cost, and higher confidence in software changes.
The article explains why unit testing matters, why managers should focus on higher‑level API tests rather than method‑by‑method coverage, and provides practical checkpoints for transaction, query, and compensation interfaces to help technical leaders promote a results‑oriented testing culture without overwhelming developers.
This article explains what unit testing is, why it matters, the characteristics of good tests, practical guidelines for writing effective tests in Flutter, test pyramid concepts, and how to integrate testing into design, refactoring, and team culture to achieve reliable, maintainable software.
This article reviews popular Node.js testing tools—including runners, coverage reporters, assertion libraries, mocking frameworks, HTTP and CLI testing utilities, and CI services—while discussing the practical necessity and ROI considerations of unit testing in modern development.
This article explains how the ICBU low‑code platform’s rendering engine achieves high test coverage by linking each issue to a dedicated unit test and demo, using custom npm scripts, pre‑build cleanup, and a traceable changelog to improve code stability.
This article explains software testing fundamentals, classifies test methods, outlines general testing principles, dives into front‑end testing types and popular frameworks, provides code snippets for a minimal test runner, and compares TDD and BDD approaches, offering a comprehensive guide for developers.
This tutorial explains how to install and use the Squaretest IntelliJ plugin to automatically generate unit test methods for Java classes, covering setup, template selection, generated code examples, handling of getters/setters, and tips for achieving high test coverage quickly.
This article explains unit testing concepts, outlines the differences between TestNG and JUnit—including test suite configuration, annotations, grouping, parameterization, dependency handling, exception and timeout testing—and provides code examples to help developers choose the most suitable Java testing framework.
This article explains what frontend testing is, why it is essential, outlines the various testing types such as unit, integration, end‑to‑end, acceptance, visual regression, accessibility, performance and cross‑browser testing, recommends tools like Jest and Puppeteer, and offers practical advice for building an effective testing strategy.
This article introduces MMKV‑Kotlin, a Kotlin Multiplatform wrapper for Tencent's high‑performance MMKV key‑value storage, covering its background, simple integration steps, architectural decisions, platform‑specific implementations, comprehensive unit and instrumented testing, and the process of publishing the library to Maven Central.
This article provides a comprehensive guide to JUnit runners, detailing the purpose and usage of Suite, Theories, Categories, Enclosed, Parameterized, IgnoredClassRunner and other executors, accompanied by code examples and execution results to help developers apply flexible unit testing strategies in Java projects.
The article proposes a GCC‑plugin‑based tool called TU that automatically extracts AST information from C/C++ source files to generate boundary unit tests, custom cases, and mocks without modifying business code, dramatically reducing the manual effort required for comprehensive test development.
This article explains the purpose and usage of various JUnit runners—including Suite, RunWith, BlockJUnit4ClassRunner, ParentRunner, Theories, Categories, Enclosed, Parameterized, and error‑handling runners—providing code examples and practical insights for flexible unit testing in Java projects.
Unit testing in Java projects, essential for catching over 90% of bugs early, follows the AIR (Automatic, Independent, Repeatable) and BCDE (Boundary, Correct, Design, Error) principles, uses Mockito’s Mock‑Do‑Verify pattern, automated IDE generation, JaCoCo coverage metrics, CI pipelines, achieving 85‑+% coverage, zero production incidents, and guides future TDD adoption.
This article explains the necessity and goals of unit testing, outlines common testing concerns such as independent paths, data structures, error handling, and boundary conditions, and provides a detailed guide to integrating and using OCMock in iOS, covering installation, mock types, stubbing, expectations, verification, and advanced techniques.
This article describes how to set up a low‑maintenance, automated unit‑test and integration‑test environment for Go applications using a Java service in a pre‑integration platform, covering Docker packaging, Go tool installation, coverage plugins, diff‑cover for incremental coverage, and REST APIs for task management.
Unit testing is praised as essential yet dreaded, especially for legacy code, and the article explores why it feels burdensome, reviews tools like Squaretest that auto‑generate massive test suites, critiques other options, and offers practical advice for teams and managers to adopt sustainable testing practices.
Unstable test cases, caused by shared resources and unchecked assumptions, can mislead developers, hide real bugs, and lead to unfair blame, so this article explains why preconditions must be verified, demonstrates flaky test examples, and offers practical strategies such as resource cleanup, unique test resources, and mock file systems to achieve reliable testing.
While end-to-end tests seem appealing by mimicking real user scenarios, they often become unreliable, slow, and costly, leading teams to miss bugs, waste time, and struggle with feedback loops; a balanced testing strategy that emphasizes fast, reliable unit and integration tests, following the test pyramid, yields better quality and faster releases.
The article explains why unit tests are essential for software quality, identifies five typical pitfalls—testing per function instead of per feature, chasing code‑coverage metrics, over‑reliance on mocks, writing tests that never fail, and handling nondeterministic behavior—and provides practical recommendations to overcome each issue.
This article provides a comprehensive overview of the Pytest framework, covering its key features, installation steps, test file conventions, execution commands, assertion methods, and examples of API testing with detailed code snippets.
This article walks through the fundamentals of front‑end unit testing, covering why tests matter, popular frameworks like Jest, core APIs, mocking techniques, and how to use React Testing Library to render components, query elements, and simulate user events for reliable, maintainable code.
The article explains Go’s table‑driven testing pattern, showing how separating test data into a slice of structs simplifies test code, improves quality, and enables subtests, parallel execution, assertions, mocking, and custom templates, illustrated with a GetWeekDay example and advanced techniques.
This article examines common unit‑testing problems in Java projects, analyzes their root causes such as development and maintenance costs, and presents practical solutions including choosing JUnit5, leveraging Mockito, using in‑memory databases, and employing a custom IntelliJ plugin to automatically generate test code and test data.
The article walks through a step‑by‑step evolution of a simple isEmpty utility, demonstrates proper JUnit assertions, introduces Mockito for isolating complex service logic, and explains Spring Boot Test components, illustrating why thorough unit testing saves time and improves code quality.
This article walks through setting up Spock for Java/Groovy projects, lists required Maven dependencies, shows how to handle static‑method mocking with PowerMock and Mockito, and provides concrete code examples for mocking @Autowired components, shared objects, and defining mock behavior.
This guide introduces unit testing for frontend projects, explains its benefits, compares popular frameworks like Jest, Mocha, and Karma, and provides step‑by‑step instructions for installing and configuring Jest with Vue Test Utils, including code examples and best‑practice tips.
Part 4 of Airbnb’s Android testing series presents a dedicated framework that lets developers write concise, single‑function unit tests for ViewModel classes by specifying initial state, parameters, and expected state or dependency calls through a Kotlin DSL, integrating with JUnit, Robolectric, Mockito, and offering scaffolding and IntelliJ plugins for streamlined, systematic ViewModel logic verification.
This article introduces the importance of frontend unit testing, presents survey data on current practices, compares popular frameworks like Jest and Mocha, provides step‑by‑step setup instructions, demonstrates code examples for JavaScript, TypeScript and async functions, and explains how to generate coverage reports and use common assertions.
This article details ByteDance Quality Lab’s SmartUnit system, which intelligently generates and validates backend unit tests using AST analysis, genetic algorithms, and instrumentation, achieving automated test creation, high coverage, precise assertions, and seamless CI integration while addressing the high cost and complexity of traditional unit testing.
This article explains the difference between synchronous and asynchronous method calls in Java, demonstrates how to implement synchronous tasks, convert them to asynchronous using Spring Boot's @Async annotation, and shows how to coordinate completion with Future objects and unit tests.
This article introduces the testing pyramid, explains unit testing concepts, and provides a step‑by‑step guide for writing Go unit tests using the standard testing package, the AAA pattern, Testify assertions, mocks, and test suites, while highlighting the benefits of fast verification, documentation, and sustainable development.
This article shows how to streamline Java backend unit tests by loading JSON fixtures, deserializing them into objects, and re‑serializing results for concise assertions, while providing naming conventions, Maven setup, FastJSON tricks, and advanced Mockito techniques to replace verbose manual object construction.
This article explains how systematic unit testing boosts R&D efficiency, outlines its origins, methods, tools, and evaluation standards, and shares practical insights from JD Retail specialists on implementing effective unit tests in real‑world projects.
This article demonstrates how Groovy's MetaClass can be used at runtime to add object methods, static methods, and properties to classes, and includes a complete Spock unit‑test example that verifies dynamic behavior with detailed code snippets and console output.
This article explores the fasthttp library as a high‑performance alternative to Go's net/http client, demonstrates basic and advanced API usage with object pools, shows how to set up a mock test server, and provides complete Go unit‑test examples with output verification.
This article describes how Keep used Domain‑Driven Design, bounded contexts, hexagonal architecture, CQRS, and an EventStore‑based event‑sourcing solution to rebuild its legacy supply‑chain (inventory) system, improve inventory accuracy, simplify extensions, and establish a reusable DDD practice for future micro‑service development.
This article explains why unit testing is essential for reducing code complexity, outlines common testing models, provides language‑specific best practices for Java, C++, and Python, and describes how to measure test coverage and effectiveness across large‑scale projects.
This article explains what unit testing is, shows how to write Go unit tests using the testing package, demonstrates more expressive assertions with GoConvey, and introduces mock creation with mockery, providing practical code examples and best‑practice tips for backend developers.
This article explains the concepts, benefits, and practical steps for implementing unit tests and generating code‑coverage reports in iOS projects using Xcode, XcodeCoverage, OCMock, and CI tools such as Bamboo and iBiu, while also covering common pitfalls and best practices.
This article shares a developer’s experience converting a Java Spring Boot microservice to Kotlin, covering why Kotlin is attractive, required Maven plugins and dependencies, code‑migration quirks such as open classes and @Jvm annotations, testing hurdles, and the final decision to revert to Java.
This article compiles practical guidelines and personal experiences on writing clean, maintainable code, covering principles such as eliminating duplication, separating concerns, unifying abstraction levels, function design, naming, unit testing, and broader software‑engineering concepts to reduce mental load and improve code quality.
This article explains why developers should switch from JUnit4 to JUnit5, outlines the JUnit5 architecture, shows how to add the proper Maven dependency, and provides practical examples of common annotations, assertions, repeated, parameterized, and nested tests for Spring Boot projects.
Learn how to configure a Spring Boot 2.3.11 project with MyBatis 3.5.6, set up dependencies, pagination, mapper scanning, define mapper interfaces with annotations, implement dynamic SQL providers, and write comprehensive unit tests to verify CRUD operations.
This article demonstrates how to create unit tests for .NET Core methods using xUnit, measure code coverage with Coverlet, generate readable reports with ReportGenerator, and automate testing and coverage analysis in Azure DevOps pipelines, while also showing how to display project badges.
The article presents a comprehensive guide to using the Spock testing framework for Java and Groovy backend development, illustrating its BDD‑style DSL, data‑driven tables, integrated mocking (including static methods via PowerMock), exception verification, in‑memory DAO testing, and enhanced coverage reporting compared to JUnit.
The article explains how to categorize unit tests into side‑effect‑free and side‑effect‑ful groups, discusses the maintenance challenges of the latter, and recommends cleaning up each test’s side effects individually to enable reliable parallel execution and dynamic test environments.
This article introduces Mockito, a Java mocking framework, explains when to use it for testing code with external dependencies, and provides step‑by‑step guidance—including Maven setup, creating mock objects in Scala, and configuring mock behavior—complete with code snippets and reference links.
This guide explains Go’s built‑in testing framework, assertion libraries, table‑driven and sub‑tests, and demonstrates how to mock functions, structs, interfaces, databases, and Redis using tools such as ngmock, gomock, sqlmock and miniredis, while covering test setup, teardown, coverage handling, and best‑practice insights.
The article explains that the primary goal of unit, integration, and functional testing is to increase confidence in each new release, advocating fully automated test suites managed by CI/CD pipelines that run on every deployment and pull request, while discouraging manual test execution.
This article explains how to determine the right amount of testing for a software product by providing evaluation criteria, a step‑by‑step testing strategy—including recording processes, unit, integration and end‑to‑end tests—coverage types, tools, and how to incorporate field feedback for continuous improvement.
This article explains how to write a concurrent unit test for the AssetService.update method using thread pools, CountDownLatch, AtomicInteger, and then suggests optimizations such as replacing AtomicInteger with LongAdder and employing CyclicBarrier to increase contention, providing full code examples and detailed explanations.
This article describes how the PC teacher desktop client adopts a layered MVL architecture, introduces unit testing with GoogleTest and GoogleMock, explains the underlying TEST and RUN_ALL_TESTS macro mechanisms, demonstrates mock view implementation, and shows how code coverage is measured to achieve targeted test coverage levels.
This article walks through setting up Spring Boot 2.3.11 with MyBatis 3.5.6, covering Maven dependencies, pagination and MyBatis configurations, mapper scanning, CRUD mapper definitions, dynamic SQL providers, and comprehensive unit tests, all illustrated with code snippets and diagrams.
This article describes a solution that merges incremental unit test coverage into overall test environment coverage by leveraging Maven Surefire Report Plugin and JaCoCo, detailing steps from CI platform integration, plugin configuration, report generation, to coverage platform processing, enabling comprehensive coverage analysis for release admission.
This comprehensive guide walks Java developers through the principles and practical steps of writing high‑coverage unit tests using Mockito and PowerMock, covering framework basics, Maven dependencies, typical service code, test case structure, mocking techniques, verification methods, exception handling, and common pitfalls with solutions.
This comprehensive guide walks you through writing effective Java unit tests, covering test framework basics, Maven dependencies, typical code examples, step‑by‑step test case creation, mocking techniques with Mockito and PowerMock, verification strategies, handling special cases, and best practices for achieving high coverage.