惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
V
V2EX
Jina AI
Jina AI
S
Schneier on Security
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
美团技术团队
小众软件
小众软件
L
LangChain Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
T
Threatpost
T
Tor Project blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
N
News | PayPal Newsroom
I
Intezer
博客园 - 聂微东
U
Unit 42
Cisco Talos Blog
Cisco Talos Blog
量子位
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
Webroot Blog
Webroot Blog
I
InfoQ
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
Cisco Blogs

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) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Test Cost Reduction Playbook: AI-Powered Testing on a Shoestring Budget
xulingfeng · 2026-05-20 · via DEV Community

Test Cost Reduction Playbook

AI-Powered Testing on a Shoestring Budget


Stop burning money on test automation. Start testing smarter.


1. Know Your Current Test Costs

Most teams don't know what they're actually spending on testing. Here's a framework to calculate your real costs.

The Real Cost of Testing Worksheet

Category A: API & Infrastructure

Item Monthly Cost Notes
AI model API calls $_____ Check your usage dashboard
GPU / cloud instances $_____ For vision models or local LLMs
CI runner minutes $_____ GitHub Actions, Jenkins, etc.
Domain & hosting $_____ For test management tools
Subtotal $_____

Category B: Human Time

Activity Hours/Month Hourly Rate Cost
Writing test scripts _____ $_____ $_____
Debugging flaky tests _____ $_____ $_____
Test data setup _____ $_____ $_____
Reviewing results _____ $_____ $_____
Subtotal _____ $_____

Category C: Context Switching & Waste

  • Tools purchased but never used: $_____
  • Failed test runs that needed re-execution: $_____
  • Time spent fighting brittle selectors: $_____

The Rule of Thumb

If your AI testing API bill exceeds $50/month for a solo tester, you're overpaying.

If your team spends more than 30% of testing time on maintenance (not new tests), you have a cost problem.


2. Three Most Expensive Mistakes

Mistake #1: Vision Models for Everything

The trap: Every AI testing tutorial pushes multi-modal vision models. Screenshot → AI analyzes → click. It feels magical.

The real cost:

  • Qwen-VL-Plus: ~$0.011/step, 50 steps = $0.55
  • GPT-4o vision: ~$0.015/step, 50 steps = $0.75
  • Claude 3.5 Sonnet vision: ~$0.012/step, 50 steps = $0.60

The fix: Ask yourself: Does this test actually need to SEE the page?

90% of web testing is CRUD operations — filling forms, clicking buttons, reading text. The DOM already has all that information as structured text. Vision is only needed for:

  • Visual regression (did the layout break?)
  • CAPTCHAs
  • Canvas / SVG-heavy apps

For everything else, text-based approaches cost 200-300x less.

Mistake #2: Self-Hosting GPU Instances

The trap: "I'll run a local LLM — no API costs!"

The real cost:

  • NVIDIA A100 cloud instance: ~$3,000/month
  • RTX 4090 (one-time): ~$1,600 + electricity
  • Setup time: 2-5 days
  • Maintenance: ongoing

The fix: Use API-based models for development, switch to local only if you have very high volume (>100k requests/month) and engineering time to manage it.

For reference: DeepSeek V4 Flash API costs $0.14/M input tokens. A typical test step uses ~2000 tokens ≈ $0.00035. You'd need to run 300,000+ test steps per month to justify a GPU.

Mistake #3: Over-Automating Everything

The trap: "We need 100% automation coverage!"

The real cost:

  • Each automated test requires 2-5x more maintenance than its manual equivalent
  • Flaky tests waste debugging time
  • 20% of tests catch 80% of bugs

The fix: The 80/20 rule:

  • Automate the happy path and critical flows
  • Keep edge cases manual
  • Review automation ROI quarterly

A focused suite of 20 well-maintained tests beats 200 flaky ones every time.


3. The Text-Only DOM Approach

This is the core technique that cut my costs by 300x. It works for any web application.

How It Works

Task: "Login system, search product, add to cart"
         ↓
① Extract interactive elements from DOM tree
   (No screenshots. Pure text. Zero image tokens.)
         ↓
② LLM analyzes structure + decides next action
   (~2000 tokens/step ≈ $0.00035)
         ↓
③ Execute action (Playwright click / fill / select)
         ↓
④ Back to ① until task completes

Enter fullscreen mode Exit fullscreen mode

What the AI Actually Sees

Instead of a screenshot:

URL: https://example.com/login
Title: Login Page
Interactive elements: 12

[0] <input placeholder="Email" name="email">
[1] <input placeholder="Password" type="password">
[2] <button>Sign In</button>
[3] <a>Forgot password?</a>
[4] <a>Register</a>
...

Enter fullscreen mode Exit fullscreen mode

That's it. Clean, structured, cheap. No base64 image data, no rendering overhead.

Cost Comparison

Approach Per Step 50-Step Test 1000 Tests/Month
Vision model (Qwen-VL) ~$0.011 ~$0.55 ~$550
Vision model (GPT-4o) ~$0.015 ~$0.75 ~$750
Claude Sonnet vision ~$0.012 ~$0.60 ~$600
DOM + DeepSeek V4 Flash ~$0.00035 ~$0.018 ~$18
DOM + GPT-4o mini ~$0.00015 ~$0.0075 ~$7.50

Implementation in 10 Lines

// The core loop: extract -> decide -> act -> repeat
const extractDOM = async (page) => {
  return page.evaluate(() => {
    const elements = document.querySelectorAll(
      'button, a, input, select, textarea, [role="button"], [tabindex]'
    );
    return [...elements]
      .filter(el => el.offsetParent !== null)
      .map((el, i) => `[${i}] <${el.tagName.toLowerCase()}>${el.textContent.trim() ? ' "' + el.textContent.trim() + '"' : ''}${el.placeholder ? ' placeholder="' + el.placeholder + '"' : ''}`)
      .join('\n');
  });
};

Enter fullscreen mode Exit fullscreen mode

No API call for vision. No screenshots. Just structured text.

When This Approach Fails

  • Canvas-rendered apps (Figma, games): Need vision
  • Highly dynamic SPAs with shadow DOM: Need custom element extraction
  • Visual assertions (the blue button should be red): Need screenshots

For everything else — login, forms, navigation, CRUD — text-only wins on cost, speed, and reliability.


4. Mobile Testing on a Budget

Mobile testing doesn't have to mean expensive device farms and premium cloud services.

The Budget Mobile Stack

Component Budget Option Cost
Device Android emulator (MuMu, BlueStacks) Free
UI extraction uiautomator2 Free
Text input ADB shell input + send_keys Free
OCR EasyOCR (local, no API) Free
Decision engine DeepSeek V4 API ~$0.00035/step
Physical device Old Android phone on USB $0-50

Total setup cost: $0 (if you already have a computer)

The Hybrid Approach

Android apps can't give you a clean DOM tree like web pages. But they give you something close enough:

  1. Use uiautomator2 to extract the native UI hierarchy (text-based, just like DOM)
  2. Fall back to ADB screencap + local OCR only when UI tree is empty (e.g., WebView pages)
  3. Same decision engine — just different input sources

The WebView Input Hack

Hybrid apps (Uni-app, React Native WebView, Flutter WebView) won't respond to standard set_text(). The fix:

# Python + uiautomator2 for hybrid app inputs
import uiautomator2 as u2
d = u2.connect()
input_field = d(text="Type a message")
input_field.click()
import time; time.sleep(0.5)
# Use send_keys, NOT set_text - critical difference
d.send_keys("Hello from automated test", clear=True)
# Click send button
d.click(1260, 2470)

Enter fullscreen mode Exit fullscreen mode

send_keys() sends characters through the IME (input method editor), which works where set_text() fails because it bypasses the app's event handling.


5. When You SHOULD Spend Money

Cost reduction doesn't mean zero spending. Here's where money is well spent.

Worth Every Penny

Spend Why Monthly Budget
Good API model (DeepSeek V4 / GPT-4o mini) Cheaper than your time debugging bad decisions $5-20
Playwright Free, open source, no-brainer $0
CI minutes (GitHub Actions) Free tier covers small teams $0
Local OCR (EasyOCR, PaddleOCR) One-time setup, zero API cost $0

Nice to Have (when budget allows)

Spend Why Monthly Budget
Visual regression tool (Percy, Applitools) Catches layout bugs $50-200
Device cloud (BrowserStack, SauceLabs) Physical device coverage $50-200
Test management tool (TestRail, qTest) Reporting for stakeholders $25-50

Never Spend On

  • ❌ GPU instances for solo testing (use APIs instead)
  • ❌ Multiple AI subscriptions you barely use
  • ❌ Over-engineered test frameworks

6. Tool Comparison & Cost Matrix

AI Models for Testing

Model Cost/M Input Cost/M Output ~Cost/Step Best For
DeepSeek V4 Flash $0.14 $0.28 ~$0.00035 DOM-based decisions
GPT-4o mini $0.15 $0.60 ~$0.00015 DOM + some reasoning
Gemini 2.0 Flash $0.10 $0.40 ~$0.0001 Budget alternative
Claude 3 Haiku $0.25 $1.25 ~$0.0003 Fast, reliable
Qwen-VL-Plus $0.08/img $0.08 ~$0.08 Visual testing
GPT-4o $2.50 $10.00 ~$0.015 Complex visual analysis

Test Automation Frameworks

Framework Cost AI-Native Cross-Platform Learning Curve
Playwright Free No Web Medium
uiautomator2 Free No Android Low
Midscene.js Free Yes Web Medium
browser-use Free Yes Web High

The Optimal Budget Stack (Solo Tester)

Category Tool Cost
Web automation Playwright Free
Android automation uiautomator2 Free
AI decision engine DeepSeek V4 Flash ~$5-10/month
Local OCR EasyOCR Free
CI/CD GitHub Actions Free
Version control GitHub Free
Total $5-15/month

7. The Solo Tester Cost-Cutting Checklist

Setup Phase

  • [ ] Audit current API spending — check last 3 months
  • [ ] Cancel unused subscriptions (be ruthless)
  • [ ] Set up cost alerts on all API dashboards
  • [ ] Install local OCR (EasyOCR / PaddleOCR — free)
  • [ ] Choose one primary LLM for test decisions

Monthly Review

  • [ ] Review test suite: remove tests that haven't caught bugs in 3 months
  • [ ] Check API bill: is it under $20?
  • [ ] Audit flaky tests: are >10% flaky? Fix or remove
  • [ ] Visual model usage: did you really need it?
  • [ ] CI minutes: are you paying for wasted runs?

Quarterly

  • [ ] Re-evaluate tool subscriptions
  • [ ] Compare current LLM pricing (models drop prices fast)
  • [ ] Review automation ROI: time saved vs. time spent
  • [ ] Update test suite: add new critical paths, remove stale ones

Red Flags

  • [ ] API bill > $50/month for a solo tester
  • [ ] Test maintenance > 30% of testing time
  • [ ] Running vision models on DOM-interactable pages
  • [ ] Self-hosting GPU for testing
  • [ ] >5 test automation tools installed but only 2 used regularly

Appendix: Quick Starts

A. DeepSeek V4 Setup (5 minutes)

# 1. Get API key from platform.deepseek.com
# 2. Set environment variable
export DEEPSEEK_API_KEY=sk-your-key-here

# 3. Test the API
curl https://api.deepseek.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -d '{
    "model": "deepseek-chat",
    "messages": [{"role": "user", "content": "Extract interactive elements from this page: [paste DOM here]"}]
  }'

Enter fullscreen mode Exit fullscreen mode

B. Playwright DOM Extraction (2 minutes)

const { chromium } = require('playwright');
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://your-test-url.com');

const dom = await page.evaluate(() => {
  const els = document.querySelectorAll('button, a, input, select, textarea');
  return [...els]
    .filter(el => el.offsetParent !== null)
    .map((el, i) => `[${i}] ${el.tagName} "${el.textContent.trim()}"`)
    .join('\n');
});
console.log(dom);

Enter fullscreen mode Exit fullscreen mode

C. uiautomator2 + ADB (3 minutes)

# Install
pip install uiautomator2

# Connect device
python -m uiautomator2 init

# Quick test script
python -c "
import uiautomator2 as u2
d = u2.connect()
print(d.info)
ui = d.dump_hierarchy()
print(ui[:500])
"

Enter fullscreen mode Exit fullscreen mode


This playbook was built from real production experience — running AI-powered testing on web and Android apps across healthcare, fintech, and e-commerce projects. Every cost figure comes from actual API bills, not theoretical estimates.

15 years in software testing, from manual testing to AI-driven automation. Currently building cost-effective testing solutions for solo engineers and small teams.


More practical testing prompts and techniques:
👉 xulingfeng.gumroad.com/l/vkhhq