Skip to main content

2 posts tagged with "Testing"

Types of tests, what each one covers and how to pick the right level.

View All Tags

Test-Driven Development (TDD) in the AI-Driven Development Life Cycle (AI-DLC): A Review of the Evidence and a Proposed Practice

· 27 min read
Nguyễn Huỳnh Minh Tiến
Middle Fullstack Developer @ Utop.vn
Summary

Abstract. Test-Driven Development (TDD) is a technique that repeats three steps: write a failing test (Red), write the minimum code that makes it pass (Green), then restructure the code while keeping all tests passing (Refactor). Empirical studies from before the AI era are mixed: a case study of four industrial teams recorded a 40–90% reduction in defect density at the price of 15–35% more initial development time, while a meta-analysis of 27 studies found only a small quality improvement. In the AI-Driven Development Life Cycle (AI-DLC), where source code is increasingly generated by large language models (LLMs), tests acquire an additional function: they act as executable specifications that clarify intent and verify AI output. Studies of test-driven code generation from 2023 to 2026 report that giving tests to an LLM improves results on benchmarks, and the newest approach lets the model generate and then jointly refine both tests and code. However, the evidence comes mainly from small-scale benchmark problems, the quality of the test suite itself caps any claim of correctness, and no evaluation yet exists at the level of the whole AI-DLC.

Keywords: TDD, AI-DLC, unit testing, large language models, executable specification, refactoring.

Các loại kiểm thử API: 9 loại, khác nhau ở đâu và chạy lúc nào

· 13 min read
Nguyễn Huỳnh Minh Tiến
Middle Fullstack Developer @ Utop.vn
Summary

Kiểm thử API là việc gửi request thẳng vào tầng API và kiểm tra response, thay vì thao tác qua giao diện. Nó nhanh hơn và ổn định hơn kiểm thử UI vì bỏ qua trình duyệt. Chín loại phổ biến trả lời chín câu hỏi khác nhau: smoke hỏi API có sống không, functional hỏi có đúng đặc tả không, integration hỏi các service ghép lại có đúng không, regression hỏi thay đổi mới có phá cái cũ không, load và stress hỏi chịu được bao nhiêu và sập thế nào, security hỏi có lỗ hổng không, UI hỏi dữ liệu hiển thị đúng không, fuzz hỏi đầu vào rác có làm sập không. Chúng không thay thế nhau.

Câu hỏi "nên dùng loại kiểm thử nào" hầu như luôn sai đề. Mỗi loại trả lời một câu hỏi riêng, và một hệ thống chạy thật thường cần nhiều loại cùng lúc ở những thời điểm khác nhau trong quy trình. Bài này xếp chín loại theo đúng câu hỏi mà chúng trả lời.