慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
变异测试入门
Jami · 2026-05-24 · via DEV Community

Jami

测试于源码之施行,甚为要义。开发者需有法以保其源码之安,随其日益繁复。繁复增则测试或难察瑕疵。变体测试使开发者得以验其测试集之弱处,显何等边界情形需处置,何等约束须加以防他日之谬。

变异测试者,乃开发者所行之术也。其于源码中造弊,而运测试,使应败(测试败者,弊已现也)。测试既行,若弊得存,则所设之测,未足察其偏微之境。变异测试,属白箱测试之法,其状最佳者,乃察应用之内部机能者也。此法广用于如Java、XML(数据存储传输之器)之语。其旨在于:求代码或嵌套失宜者,发新弊,明弊于应用中蔓延之状。其志在防此弊于将来复现。

變異測試之器,多用於持續整合與持續交付。持續整合與持續交付,乃現代自動構建測試、發布應用之實踐也。此操作,須頻繁提交代碼於公共倉庫。常態下,無變異測試之持續整合與持續交付,需待時。通常,無變異測試之持續整合與持續交付任務,其待時之長,多由測試套件薄弱所致。變異測試,能令此過程大為高效,蓋因持續整合與持續交付任務之待時減矣。

首度实施测试(有文牍载之)者,乃提摩太·巴德(Timothy Budd)八十载,为其博士之研习,题曰《突变分析》。此议初立。理查德·利普顿(Richard Lipton)一九七一年。其后二零零四年,"Certess inc."(Certess公司)亦参与其中,作为硬件验证之要务。今,变异测试之术,本于二理;其一为能干程序员之假说者,此乃程序员所撰之程序近乎正确之处也。他者,耦合效应也,此乃简单之谬误可如雪球般滚雪球,渐成显著且/或普遍之谬误。

變異測試之類別可有多樣。其一謂之價值變異測試。此乃更改通常賦予常數之值,以測試測試是否失敗,或變異是否得以存續。測試失敗固佳,蓋因其示人以所施測試已能周詳察弊。然變異得存,則意反是也。

const num = 35;

changed:

const num = 3000005

入全景模式 退出全屏模式

变异测试之第二类为基于决策者。基于决策者之测试,乃变更算术运算符。时或变更细微,时或变更显明.

if(dog = cat)

changed:

if(dog >= cat)

进入全屏模式 退出全屏模式

类决策测试,语句变异测试者,更易一语或一变量,易以他语或他变量于再赋值时。此例中,长颈鹿乃所易之变量。

if(dog < cat)
  let giraffe = 10;
else
  let giraffe = 20;

changed:

if(dog < cat)
  let bunny = 10;
else
  let bunny = 20;

入全屏模式 出全屏模式

高阶变异测试者,乃更易于一操作或一值,使测试难察。此变之微,初视难辨,细察则知其弊所在。

let function (int a, int b){
 if (dog = 1):
 return cat < dog
 return cat > dog
}

changed:

let function (int a, int b){
 if (dog = 1):
 return cat <= dog
 return cat > dog
}

入全景模式 出全屏模式

变异测试,可简而为之。初造源码,继而注入变异。择变异测试之一种,创微瑕,冀测试集能察之。次而运行测试。若测试于瑕疵所生之行而败,则此测试为坚。否则,瑕疵得存,是测试未周,不能防其染余码。计败者几何,于此,依边际之例或通例之约,重筑测试。

變異測試之妙,在於能更安全地更新測試。若BUG未察,開發者可確知所修之處及其更安全之法。發現單元測試所不能察之BUG,則能致程式更效。然其弊在費時甚巨,且不適於黑盒測試(不知應用程式源碼而評其功能)。加之,有變異過於複雜,致難於排錯,或難於實施糾正程式或對變異進行測試。總之,變異測試乃創造更安全程式、構築更安全測試套件之良法。

(https://www.computer.org/csdl/journal/ts/2024/05/10472898/1VpY3do6cyA)
https://stryker-mutator.io/docs/
https://www.computer.org/csdl/journal/ts/2024/05/10472898/1VpY3do6cyA("IEEE 软件工程汇刊";五月二零二四)
https://www.geeksforgeeks.org/software-testing/software-engineering-white-box-testing/
https://www.redhat.com/en/topics/devops/what-is-ci-cd("redhat.com";六月十日二零二五)
https://bell-sw.com/blog/a-comprehensive-guide-to-mutation-testing-in-java/
(https://www.geeksforgeeks.org/devops/what-is-ci-cd/))
https://www.diffblue.com/resources/what-is-mutation-testing/
https://en.wikipedia.org/wiki/Mutation_testing
(https://www.geeksforgeeks.org/software-testing/software-engineering-black-box-testing/
https://www.sciencedirect.com/science/article/abs/pii/S0950584909000688
https://www.cs.cmu.edu/~ckaestne/pdf/fse20hom.pdf