Architecture testing kiểm tra quy tắc cấu trúc code mà không cần thực thi logic, phát hiện vi phạm design sớm. Ví dụ với Pest: arch('Service không được truy cập trực tiếp DB')->expect('App\\Services')->not->toUseClasses(['Illuminate\\Database\\Eloquent\\Model']).
Lợi ích: ngăn tight coupling, bắt dependency injection bị bỏ qua, phát hiện cross-module dependency trái phép, enforce naming convention. Dùng cho: đảm bảo model nằm trong Models/, service trong Services/, controller chỉ gọi service. Vi phạm bị bắt tại CI thay vì runtime—tiết kiệm debug thời gian thực.