Modern software engineering exercises and discussions Chapter 1 Software Testing

Source: Internet
Author: User

13.5.2 correct errors

 

This question is clearly a boundary value issue, which is indeed a bug and a mistake in Microsoft's algorithm design. Calculation of a leap year:

A. Year divisible by 400

B. The year in which the product is divided by 100, but not 400.

C. The year in which the object is divisible by 100 and 400 at the same time

D. The year in which the object is divided by four but not 100

E. The year in which the object is divided by 4 and 100 at the same time

F. Even number, year not divisible by 4

G. odd year

H. Other invalid year

Another important point is the boundary. The minimum year allowed by the design and the maximum year allowed by the design. Therefore, based on the boundary analysis, the tester must find the first day of the leap year, the last day of the leap year, the first day of the year, and the last day of the year.

 

 

13.5.9 exercise-learn and use test tools on multiple platforms

 

I usually use Java as the development language for projects and eclipse as the IDE tool. Among them, I use JUnit most. Especially when I use hibernate as the framework for EB development, almost every module uses JUnit.

JUnit is a regression testing framework (regression testing framework) written by Erich Gamma and Kent Beck ). JUnit testing is a programmer test, known as white-box testing, because programmers know how the tested software completes its functionality and what kind of functionality. JUnit is a framework that inherits the testcase class and can be automatically tested using JUnit.

STEP (reference, source: callback

Http://wenku.baidu.com/link? Url = sxTuc9Xv3-p4-Nk5-yk02tjeLVPdQEI9otnmmKjz1hStDfxJpw5D8a8K3OzLZVh054_cdak4pTOd4MNU8Obt4gapiK17zBvYv-Dk8LCb7Ii ):

 

1. Import the jar package of JUnit for the project (build path-> Add library-> JUnit ).

2. Create a source folder named test to store the test class source code.

3. The target class and test class should be located under the same report, so that the test class does not need to import the package where the source code is located, because they are located under a package.

4. junit4 does not require the test class to inherit the testcase parent class.

5. In a test class, all public void Methods Modified by the @ test annotation are testcase (test cases) and can be executed by JUnit.

6. Specification: Although junit4 does not require the test method name to start with test, it is best to start with test as per junit3's requirements.

7. In junit4, the @ before annotation is used to implement the same functions as the setup method in junit3.

8. in junit4, you can use the @ beforeclass and @ afterclass annotations to modify a public static void no-Arg method, in this way, the method modified by the @ beforeclass annotation is executed before all test methods are executed.

9. annotation @ lgnore can be used to modify the test class and test method. When the test class is modified, all test methods in the class are ignored. When the test method is modified, the test method is ignored.

10. parameters: @ runwith (parameterized) must be added to the declaration of the class when a test class uses a parameterized runtime. class) annotation, indicating that this class will run without using the built-in runner of JUnit, but with the parameterized runner; the @ parameters annotation should be used to modify the methods that provide parameters in the parameterized running class, and assign values to each parameter in the constructor of the test class (the constructor calls the constructor ), finally, write the test class, which runs the test multiple times according to the number of parameter groups.

11. In junit4, if you want to run multiple tests at the same time, you need to use two annotations @ runwith (suite. Class) and @ suite. suiteclasses ()

 

 

13.5.10 20 major bugs in history (the web page cannot be opened for the time being and can be opened before updating the answer)

Modern software engineering exercises and discussions Chapter 1 Software Testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.