tailieunhanh - The art of software testing second edition p9

(Lưu ý: Chúng tôi đang sử dụng một ví dụ rất đơn giản để minh họa cho vấn đề cơ bản của kiểm tra cực Trong thực tế bạn sẽ có một đặc điểm kỹ thuật chương trình chi tiết hơn có thể bao gồm các hạng mục như giao diện người dùng yêu cầu và đầu ra | 188 The Art of Software Testing eight test cases identified. Note We are using a very simple example to illustrate the basics of Extreme Testing. In practice you would have a much more detailed program specification that may include items such as user-interface requirements and output verbiage. As a result the list of test cases would increase substantially. Test case 1 from Table combines two test scenarios. It checks whether the input is a valid prime and how the application behaves with a valid input value. You may use any valid prime in this test. Appendix B provides a list of the prime numbers less than 1 000 that could be used. We also test two scenarios with test case 2 What happens when the input value is equal to the upper bounds and when the input is not a prime number This case could have been broken out into two unit tests but one goal of software testing in general is to minimize the number of test cases while still adequately checking for error conditions. Test case 3 checks the lower boundary of valid inputs as well as testing for invalid primes. The second part of the check is not needed because test case 2 handles this scenario. However it is included by JUnit is a freely available open-source tool used to automate unit tests of Java applications in Extreme Programming environments. The creators Kent Beck and Erich Gamma developed JUnit to support the significant unit testing that occurs in the Extreme Programming environment. JUnit is very small but very flexible and feature rich. You can create individual tests or a suite of tests. You can automatically generate reports detailing the errors. Before using JUnit or any testing suite you must fully understand how to use it. JUnit is powerful but only after you master its API. However whether or not you adopt an XP methodology JUnit is a useful tool to provide sanity checks for your own code. Check out for more information and to download the test suite. In addition there is a .