Backend Development 10 min read

Exploring Baidu's Scalable Intelligent Testing: Automated Test Case Generation for Code, API, UI, and GUI

This article details Baidu's large‑scale intelligent testing framework, describing how AST‑based unit test generation, automated API test creation, visual UI interaction case synthesis, GUI traversal action set generation, and front‑end assertion automation work together to achieve high‑coverage, low‑cost automated testing across multiple languages and platforms.

Baidu Intelligent Testing
Baidu Intelligent Testing
Baidu Intelligent Testing
Exploring Baidu's Scalable Intelligent Testing: Automated Test Case Generation for Code, API, UI, and GUI

In Baidu's intelligent testing platform, testing activities are organized into five stages—test input, execution, analysis, localization, and evaluation—to enable large‑scale, integrated testing across code, API, UI, and GUI layers.

01 AST‑Based Exception Unit Test Generation focuses on automatically creating unit tests by analyzing abstract syntax trees (AST). The process extracts structured function features (calls, variable declarations, relationships, literals, mock points), generates test data using boundary, random, mutation, and symbolic execution techniques, and employs search‑based algorithms such as genetic algorithms to prioritize high‑risk paths, achieving extensive branch coverage while limiting invalid test cases. The system currently supports C++, Go, and Objective‑C, detecting over 1,000 exception patterns.

02 Interface‑Level Test Case Automation replaces manual API test writing by parsing interface definitions, logs, and traffic captures to automatically generate comprehensive API request cases. It also automates assertion generation by learning from historical case outcomes, producing contract‑level checks and value‑based assertions, resulting in more than 20,000 smart API cases that constitute over 80% of the total case pool.

03 UI Shallow Interaction Test Case Generation addresses the high cost of UI test authoring by employing visual techniques. Offline data mining uses DNN object detection to build component‑level and page‑level models, while a mining module records key DOM actions to create context‑aware operation sequences. Real‑time execution replays these sequences and validates results with visual diff, enabling low‑cost, high‑recall UI test generation that has uncovered dozens of defects across multiple product lines.

04 GUI Traversal Action Set Generation automates the creation of high‑coverage GUI action sets for mobile devices and emulators. By converting UI hierarchies into weighted graphs and applying Deep‑Q‑Learning‑based intelligent traversal, the system balances resource usage and coverage, achieving a 33% increase in coverage and a 75% reduction in testing time compared to traditional random Monkey testing.

05 Front‑End Test Assertion Automation tackles the challenges of writing complete and consistent assertions. It generates assertions using both reference‑based (comparing against known good versions) and anomaly‑based (detecting white screens, garbled text) methods, leveraging multi‑level page understanding and feature extraction to achieve over 97% accuracy and intercept more than 2,000 bugs daily.

The article concludes with references to further reading on Baidu's intelligent testing deployment and invites interested engineers to apply for related positions.

code generationmachine learningASTTest AutomationUI testingAPI testingBaidu
Baidu Intelligent Testing
Written by

Baidu Intelligent Testing

Welcome to follow.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.