Tag

unit testing

0 views collected around this technical thread.

FunTester
FunTester
Jun 17, 2025 · Backend Development

How to Test Java ExecutorService Without Thread.sleep(): Reliable Strategies

This article explains why using Thread.sleep() in Java ExecutorService unit tests is unreliable and inefficient, and introduces three robust alternatives—Future.get(), CountDownLatch, and shutdown/awaitTermination—to achieve stable and performant testing of asynchronous code.

CountDownLatchExecutorServiceFuture
0 likes · 13 min read
How to Test Java ExecutorService Without Thread.sleep(): Reliable Strategies
Big Data Technology Tribe
Big Data Technology Tribe
Jun 5, 2025 · Backend Development

Boost Java Code Quality: Essential Best Practices Every Developer Should Follow

This article outlines essential Java coding habits—including unit testing with TDD, using Optional to avoid nulls, preferring StringBuilder, proper exception handling, composition over inheritance, Streams API, try‑with‑resources, dependency injection, naming conventions, and design patterns—to dramatically improve code readability, performance, and maintainability.

Best PracticesJavacode quality
0 likes · 7 min read
Boost Java Code Quality: Essential Best Practices Every Developer Should Follow
Code Mala Tang
Code Mala Tang
May 22, 2025 · Fundamentals

9 Essential Python Debugging Techniques Every Developer Should Master

This guide presents nine practical Python debugging methods—including try‑except blocks, print statements, the pdb debugger, assertions, stack trace analysis, linting tools, IDE breakpoints, logging, and unit testing—to help developers quickly identify and resolve errors in their code.

Error HandlingLoggingPython
0 likes · 4 min read
9 Essential Python Debugging Techniques Every Developer Should Master
php中文网 Courses
php中文网 Courses
May 14, 2025 · Backend Development

Why Static Methods Should Be Avoided in PHP and Better Alternatives

The article explains that overusing static methods in PHP violates core OOP principles, hampers testability, creates global state, and reduces extensibility, while outlining appropriate scenarios for static usage and recommending alternatives such as dependency injection, service containers, and cautious singleton patterns.

OOPPHPdependency injection
0 likes · 6 min read
Why Static Methods Should Be Avoided in PHP and Better Alternatives
Code Mala Tang
Code Mala Tang
May 13, 2025 · Backend Development

Master FastAPI Testing: Unit & Integration Tests with Pytest & HTTPX

This guide walks you through setting up a FastAPI testing environment, creating a project structure, writing both unit and integration tests using pytest, httpx, and FastAPI's TestClient, and running the tests to ensure reliable, maintainable applications.

BackendFastAPIhttpx
0 likes · 6 min read
Master FastAPI Testing: Unit & Integration Tests with Pytest & HTTPX
php中文网 Courses
php中文网 Courses
May 12, 2025 · Fundamentals

Python Unit Testing and Debugging Techniques: From unittest to pytest and CI Integration

This article explains why unit testing and debugging are essential in Python development, introduces the unittest and pytest frameworks, shows how to measure test coverage, demonstrates debugging methods like print statements, pdb, and IDE tools, and provides examples of integrating tests into CI pipelines.

CI/CDPythondebugging
0 likes · 10 min read
Python Unit Testing and Debugging Techniques: From unittest to pytest and CI Integration
FunTester
FunTester
Apr 14, 2025 · Backend Development

Common Mistakes in Go Unit Testing and How to Avoid Them

This article examines nine frequent errors developers make when writing Go unit tests—such as improper test classification, neglecting the race detector, ignoring parallel and shuffle flags, avoiding table‑driven tests, using sleep, mishandling time APIs, overlooking httptest/iotest, misusing benchmarks, and skipping fuzz testing—providing analysis and concrete code‑based solutions to improve test reliability and efficiency.

BenchmarkingGoconcurrency
0 likes · 11 min read
Common Mistakes in Go Unit Testing and How to Avoid Them
Selected Java Interview Questions
Selected Java Interview Questions
Apr 3, 2025 · Fundamentals

How to Write Clean and Maintainable Code: Naming, Classes, Functions, and Testing

This article explains why clean code is essential for team development and provides practical guidelines on naming, class design, function composition, and testing—including SOLID principles, meaningful identifiers, single‑responsibility classes, short functions, and test‑driven development—to improve readability, extensibility, and overall software quality.

Naming Conventionsclean coderefactoring
0 likes · 19 min read
How to Write Clean and Maintainable Code: Naming, Classes, Functions, and Testing
Efficient Ops
Efficient Ops
Mar 23, 2025 · Operations

Why Using Unit Test Coverage as a Hard Gate Fails and What Actually Works

The article critiques the practice of enforcing unit‑test coverage as a strict quality gate, explains why both overall and incremental coverage thresholds can be gamed, and proposes showing incremental coverage in merge requests while improving overall coverage through broader engineering processes.

DevOpsquality gatesoftware engineering
0 likes · 4 min read
Why Using Unit Test Coverage as a Hard Gate Fails and What Actually Works
Code Mala Tang
Code Mala Tang
Mar 12, 2025 · Fundamentals

Master Python Doctest: Embed Tests Directly in Your Docs

This guide explains how Python's built‑in doctest module lets you write test cases inside docstrings, run them from the command line or programmatically, handle common pitfalls like whitespace and floating‑point issues, and integrate doctests into larger projects for reliable documentation‑driven testing.

Code ExamplesPythondoctest
0 likes · 7 min read
Master Python Doctest: Embed Tests Directly in Your Docs
ByteFE
ByteFE
Mar 12, 2025 · Frontend Development

AI-Assisted Unit Testing in Frontend Development: Best Practices with Cursor and Vitest

This comprehensive technical guide explores how to leverage AI-powered coding assistants like Cursor to efficiently generate high-quality unit tests for modern frontend applications, detailing essential frameworks, structural patterns, and practical optimization techniques.

AI-assisted codingCursorReact Testing
0 likes · 26 min read
AI-Assisted Unit Testing in Frontend Development: Best Practices with Cursor and Vitest
Test Development Learning Exchange
Test Development Learning Exchange
Jan 3, 2025 · Backend Development

How to Mock External Services in pytest Using unittest.mock

This guide explains how to install pytest, create a module with a function that calls an external API, and use unittest.mock fixtures and helper functions to mock requests.get for both successful and failing responses, then run the tests with pytest.

BackendMockingPython
0 likes · 9 min read
How to Mock External Services in pytest Using unittest.mock
JD Tech
JD Tech
Nov 28, 2024 · Fundamentals

Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects

This article presents a detailed, step‑by‑step guide on improving unit test coverage in large Java codebases, covering strategies such as mocking, divide‑and‑conquer, tool‑assisted test generation, reflection‑based coverage, Maven configuration, and practical tips for handling static methods, final classes, and test data replay.

Code CoverageJavaJunit
0 likes · 27 min read
Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects
Test Development Learning Exchange
Test Development Learning Exchange
Nov 26, 2024 · Fundamentals

How to Encapsulate and Call Mock Services in pytest

This tutorial demonstrates how to use pytest together with Python's unittest.mock module to mock external HTTP requests, covering fixture creation, mock response setup, and writing test cases for both successful and failed API calls.

API mockingMockingPython
0 likes · 9 min read
How to Encapsulate and Call Mock Services in pytest
php中文网 Courses
php中文网 Courses
Oct 28, 2024 · Backend Development

Introduction to Unit Testing with PHPUnit for PHP

This article explains the concept and importance of software testing, outlines various test types, and provides a step‑by‑step guide with code examples on installing PHPUnit, creating a Calculator class, writing unit tests, and running them to ensure reliable PHP applications.

backend developmentphpunittesting
0 likes · 7 min read
Introduction to Unit Testing with PHPUnit for PHP
php中文网 Courses
php中文网 Courses
Oct 22, 2024 · Backend Development

Structured Approach for Migrating Python Functions to PHP

This guide outlines a systematic method for tracking, testing, and documenting the migration of Python functions to PHP, including creating a mapping table, using version control, writing unit tests, recording edge cases, and conducting regular progress reviews to ensure code quality and functional equivalence.

BackendMigrationPHP
0 likes · 4 min read
Structured Approach for Migrating Python Functions to PHP
Test Development Learning Exchange
Test Development Learning Exchange
Oct 21, 2024 · Fundamentals

Understanding Unit, Integration, and System Testing with Practical Python Examples

This article explains the definitions, goals, and real‑world applications of unit testing, integration testing, and system testing, illustrating each type with clear Python code examples that demonstrate how to verify functionality, interfaces, and overall system behavior in software projects.

Pythonautomationintegration-testing
0 likes · 6 min read
Understanding Unit, Integration, and System Testing with Practical Python Examples
Test Development Learning Exchange
Test Development Learning Exchange
Oct 12, 2024 · Fundamentals

Comprehensive Guide to Common pytest Assertion Techniques

This article introduces the core assertion methods in pytest, covering basic assertions, multiple assertions, exception handling, specific exception messages, list and dictionary checks, floating‑point approximations, string and tuple validation, subset verification, and log capture, each illustrated with clear Python code examples.

AssertionsPythonpytest
0 likes · 8 min read
Comprehensive Guide to Common pytest Assertion Techniques
Test Development Learning Exchange
Test Development Learning Exchange
Oct 9, 2024 · Backend Development

Understanding pytest Fixtures: Concepts, Scope, Dependencies, Parameterization, and Usage

This article explains pytest fixtures, covering their basic concept, definition, scope options (function, module, class, session), dependencies, parameterization, use of yield for cleanup, common usage scenarios such as data preparation, database connections, and mock objects, as well as custom markers and global registration.

fixturepytesttesting
0 likes · 7 min read
Understanding pytest Fixtures: Concepts, Scope, Dependencies, Parameterization, and Usage
Test Development Learning Exchange
Test Development Learning Exchange
Sep 23, 2024 · Backend Development

Getting Started with pytest: Features, Installation, and Example Tests

This article introduces pytest, a popular Python testing framework, outlining its key features, installation steps, how to write and run basic, parameterized, and parallel tests, generate HTML reports, and integrate with CI/CD pipelines, providing code examples throughout.

CI/CDautomationpytest
0 likes · 6 min read
Getting Started with pytest: Features, Installation, and Example Tests