How to Design Interface Test Cases

Source: Internet
Author: User


Interface testing is a part of project testing. Just like its name, it tests interfaces and tests interfaces between system components. Interface testing is mainly used to detect the interaction between the external system and the tested system and between the internal systems. The focus of the test is to check the data interaction, transfer, and control of the management process and the dependency between systems.


How to design an interface test case?
First, clarify the starting point. Like all tests, the interface test starts with proving that the tested program is incorrect. Guided by this starting point, your design behavior will develop in this direction as much as possible, making it easier to discover problems without any major deviations. Secondly, select the test object. The key to interface testing is to select a tested object for a system interface test. A system has countless interfaces. If each interface is tested separately, it will be very painful. It is not only tedious and wasteful, but also changes to any internal interface, will make our use cases unavailable. We recommend that you take the entire system as a whole and select the outermost interface that the entire system provides for external use and interaction as your testing object, use Cases of this test object will be robust and more efficient. In addition, based on the data flow, these outermost interfaces can be divided into two types: one is the interface for data entering the system, and the other is the interface for data flowing out of the system. The system interface is actually the interface for executing and calling the use case. You can call these interfaces by changing parameters to simulate external use. The outgoing interfaces are the vertices for verification in our use case. We should verify the status of the system when the data flows out and from.
Then, confirm the functions of the complete test object: Confirm what functions the external interface provides to external users who use these interfaces, and what functions the external users actually need. These two functions must be accurate and detailed. the use case design must be strictly in accordance with the functional design of the test object, which is the correct use case. Finally, when the starting point, object, and function are determined, you can design the use case. The following describes in detail how to design an interface test case with a good structure, high readability, and high permeability. The interface test case design is the same as that of other test cases, and should be based on the goal of discovering bugs as much as possible. The content of the case design should include: main test function points, test environment, test data, execution operations, and expected results.

1) There are two types of Interface Test environments: one is the internal environment of the program and the other is the environment in which the program calls the external interface. There is a principle in the design environment: design a real and dangerous environment without ignoring the occasional environment. The truth is that when testing a function in your use case, you should think about what the internal and external environments are when this happens, and simulate the most accurate environment through various means. Dangerous: In this environment, the probability of system problems is very high. When designing the use case environment, if both environments can meet your requirements for this case, we recommend that you select a more dangerous environment. The probability of such an environment is very small. Do not ignore this kind of environment because it rarely appears. Development may also be like this, and the problem may be hidden here.
2) the interface test data is divided into interface parameter data and system data required for case execution. Big Data design knowledge,
Do not be lazy when designing and preparing test cases. Make full use of the test data use case check and error function. The interface parameter data must analyze each parameter based on the actual functions of the test interface, and arrange the parameters in a logical combination in line with the business logic, do not omit data of some boundary values and error points. The system data and interface parameter data required for execution of each use case should use different data as much as possible, and the use case is easier to identify problems.
3) test functions. If an interface has complex functions, we recommend that you divide the structure of the interface use cases so that the use cases are more readable and maintainability. The interface division principle is to divide the appropriate granularity based on the functional points provided by the interface. Use Cases of the same function can be filled with different test environments and data.
4) the interface test case execution is very simple, that is, the call of the tested interface.
5) expected result verification, which is also a key step in the design of the interface case, should be fine and not redundant. Details: vertices to be verified should be listed in detail in use cases. Each use case must be verified. Do not think that all the previous use cases are correct because they are verified. Avoid repeated verification in one use case to improve the efficiency of the test case.

 

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.