This article examines the debate over who should write unit tests—developers or testers—by outlining the advantages and disadvantages of each role, explaining what unit testing is, how to design effective test cases, and offering practical guidance for implementing high‑quality automated tests.
This article explains how to define a unit in testing, discusses who should write unit and integration tests, presents three generations of a custom Java mock framework with code examples, compares its pros and cons, and introduces EvoSuite for automatic test generation within Maven projects.
This article presents pmock, a lightweight, zero‑learning‑cost mock framework for Java unit testing that integrates seamlessly with existing tests, explains the motivation behind unit testing, compares popular mock libraries, and details pmock’s configuration, usage, implementation, and known limitations.
This article explains why unit testing is essential for PHP projects, introduces SOLID design principles, shows how to choose and install PHPSpec, demonstrates writing specifications, mocking, argument matching, exception testing, and configuring code‑coverage reports, all with concrete code examples.
Learn how to enhance PHP code quality by implementing unit tests using PHPSpec and PHPUnit, covering SOLID principles, mock objects, test setup, code coverage integration, and best practices for writing maintainable, reliable backend code.
Testing asynchronous systems requires specialized strategies—monitoring callbacks with synchronization primitives and reliable polling with timeouts, delays, and frequencies—to handle nondeterministic execution, avoid flaky assertions, and improve testability by decoupling business logic from periodic scheduling, as demonstrated by real‑world polling implementations for Elasticsearch and MySQL/Redis jobs.
This article shares practical experiences from unit testing a critical C module, describing common memory‑leak scenarios, their root causes, and concrete solutions while also offering a checklist of typical leak‑prone patterns for developers.
The article examines a flawed implementation of a global process lock using Python's with statement, explains why exceptions raised in __enter__ are not caught by __exit__, demonstrates failing unit tests, and presents three alternative solutions—including a custom ABContext, use of the deprecated contextlib.nested, and a simple if‑statement workaround—to correctly manage exceptions in context managers.
This article explores why unit testing is essential for frontend projects, compares Mocha and Jest across assertions, coverage, environment setup, mocking, snapshots, and watch mode, and offers practical guidance on choosing tools, writing maintainable tests, and balancing coverage with development speed.
The article shares practical insights on planning, designing, developing, testing, and rolling out a large‑scale backend system refactor, emphasizing resource limits, pain points of legacy code, unit‑test protection, layering, decoupling, monitoring, and staged deployment to ensure stability during high‑traffic events.
The article introduces data-ci, a SQL‑driven unit testing framework that lets engineers write, organize, and automate data validation tests for ETL pipelines, providing assertions, failure callbacks, coverage reporting, and CI integration to improve data quality and reliability.
This article explains the fundamentals of unit testing, including its importance, various test types, tool categories, implementation principles, hooks, best‑practice guidelines, and introduces the Jest JavaScript testing framework with installation steps, features, and example test scripts for both synchronous and asynchronous code.
This article provides a detailed overview of software testing fundamentals, covering testing stages across project lifecycles, classifications such as black‑box, white‑box, and gray‑box testing, functional and performance testing, manual versus automated testing, and specialized tests like smoke, regression, random, exploratory, and security testing.
This guide walks you through creating a basic Spring Boot project with Maven, adding the web starter, implementing a simple Hello World REST controller, and writing unit tests using MockMvc, providing step‑by‑step instructions, code snippets, and project structure details to help Java developers quickly get started with lightweight Spring applications.
This article debunks the myth of writing a million lines of code, explains why code quantity matters less than quality, and offers ten practical steps—including solid fundamentals, coding standards, design principles, refactoring, technical debt management, code reviews, static analysis, unit testing, self‑testing, and leveraging open source—to help developers produce high‑quality software efficiently.
This article explains why web releases often miss thorough testing, introduces Jest and its React support, and provides a step‑by‑step guide to implementing snapshot testing and improving unit‑test coverage in modern React applications.
Zuo Ming explains React’s component architecture—props, state, lifecycle methods, server‑side rendering, and React‑Native—using a bamboo water‑wheel analogy, demonstrating prop validation, state updates, lifecycle phases, SSR hydration, cross‑platform code reuse, and unit testing to give front‑end engineers a complete practical foundation.
The article reviews Liulishuo's 2016 engineering experiments, covering their base library choices, componentization for consumer apps and internal tools, mock data generation, unit testing, error monitoring with Sentry, deployment using shipit‑deploy, and outlines goals for improving performance, testing coverage, and robustness in the coming year.
This article introduces front-end automated testing, compares BDD and TDD approaches, reviews popular unit testing frameworks such as Mocha, Jasmine, and QUnit, and outlines integration testing tools like CasperJS, Nightmare, Nightwatch, and DalekJS, providing code examples and practical guidance for efficient test implementation.
Learn how to ensure high‑quality Java code throughout agile development by standardizing coding conventions, applying static analysis, writing unit tests, implementing continuous integration, and conducting thorough code reviews and refactoring, with practical tool recommendations and best‑practice guidelines for each step.
This article explains the importance of unit testing in Android development, outlines why developers should invest time in it, and provides a step‑by‑step guide on writing effective Android unit tests using JUnit, Mockito, Dagger2, and Robolectric, along with practical tips, CI integration, and common pitfalls.
This article explains the fundamentals of unit testing, compares it with integration testing and TDD, describes characteristics of good unit tests, shows a practical .NET example using XUnit, FluentAssertions and Moq, and offers architectural tips for writing test‑friendly code.
This article explains the fundamentals of unit testing, compares it with integration testing and test‑driven development, describes what makes a good unit test, shows how to improve code testability, and provides concrete C# examples using XUnit, FluentAssertions, and Moq.
The article recounts how the author transformed a massive, repetitive three‑tier factory class in a C# data‑center management system into a clean, reflection‑based solution of just a few lines, while sharing practical refactoring lessons, pitfalls of code generators, and advice on unit‑testing and architecture design.
This article shares practical experiences and best practices for Android unit testing, covering why testing matters, simple test structures, mocking with Mockito, dependency injection via Dagger2, using Robolectric, CI integration, common pitfalls, and a detailed checkout flow example.
This guide walks through setting up Node.js unit testing using Mocha and Istanbul, streamlining commands with npm scripts and a Makefile, handling glob patterns, and integrating continuous integration with Travis CI or a custom UITest-ci solution.
This article details a real‑world investigation of a memory‑growth issue in a core backend service caused by improper use of Protocol Buffers, describing the symptoms, reproduction attempts, step‑by‑step root‑cause analysis, the implemented fix, and performance verification results.
A recent developer survey reveals the most popular JavaScript libraries, frameworks, module loaders, and unit testing tools, showing jQuery leading with 91.5% interest overall and 56.53% usage in projects, while other tools like React, AngularJS, webpack, and Mocha capture smaller but notable shares.
This article details Qiniu's evolution from no testing to a comprehensive front‑end testing strategy using Selenium, Karma, Jasmine, AngularJS, and Sinon, covering early challenges, unit‑test design, tool configuration, mock data handling, and the tangible benefits for code quality and maintenance.
This article compiles ten provocative programming viewpoints—from the primacy of using your brain over rigid best‑practice checklists to the limits of unit testing—offering practical reflections on mindset, learning, tooling, and design that can sharpen any developer’s approach.