Đang chuẩn bị liên kết để tải về tài liệu:
xunit test patterns refactoring test code phần 4

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Chúng tôi thiết lập các trận đấu thử nghiệm hoặc kiểm tra kết quả bằng cách đi qua một cánh cửa trở lại (chẳng hạn như truy cập cơ sở dữ liệu trực tiếp). Hành vi xác nhận (468): Chúng tôi nắm bắt các kết quả gián tiếp của hệ thống theo thử nghiệm (SUT) như chúng xảy ra và so sánh chúng với các hành vi mong đợi. | Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com Chapter 16 Behavior Smells Behavior Smells Smells in This Chapter Assertion Roulette.224 Erratic Test.228 Fragile Test.239 Frequent Debugging.248 Manual Intervention.250 Slow Tests.253 223 SimpcHPDFRMergeỉ andSplit Unregistered Version - http www.simpopdf.com Assertion Roulette Assertion Roulette It is hard to tell which of several assertions within the same test method caused a test failure. Symptoms A test fails. Upon examining the output of the Test Runner page 377 we cannot determine exactly which assertion failed. Impact When a test fails during an automated Integration Build SCM it may be hard to tell exactly which assertion failed. If the problem cannot be reproduced on a developer s machine as may be the case if the problem is caused by environmental issues or Resource Optimism see Erratic Test on page 228 fixing the problem may be difficult and time-consuming. Causes Cause Eager Test A single test verifies too much functionality. Symptoms A test exercises several methods of the SUT or calls the same method several times interspersed with fixture setup logic and assertions. public void testFlightMileage_asKm2 throws Exception set up fixture exercise constructor Flight newFlight new Flight validFlightNumber verify constructed object assertEquals validFlightNumber newFlight.number assertEquals newFlight.airlineCode assertNull newFlight.airline set up mileage newFlight.setMileage 1122 exercise mileage translator int actualKilometres newFlight.getMileageAsKm verify results int expectedKilometres 1810 assertEquals expectedKilometres actualKilometres Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.ci now try it with a canceled flight newFlight.cancel try newFlight.getMileageAsKm fail Expected exception catch InvalidRequestException e assertEquals Cannot get cancelled flight mileage e.getMessage Assertion Roulette Another possible symptom is that the test automater wants to .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.