What is client SDK testing? How to measure?

01. What is

Client SDK is a software development toolkit provided for third-party developers, including SDK interface, development documentation, Demo examples, etc. What is the relationship between SDK and applications? Take the Yunxin instant messaging service as an example. As shown in the figure below, the application client calls the Yunxin SDK interface to perform operations such as message query and storage, or communicates with the Yunxin server through protocols. communicate.

02. What to measure

1. Objects tested by client SDK

Client SDK testing is testing the content in the tool kit provided to developers

Therefore, the main contents of the test are:

  • SDK interface and documentation
    The SDK interface is the main object of testing and also the core content

  • SDK log
    For developers, the specific implementation in the SDK interface istransparent. When problems are encountered when calling the upper layer, you can only rely on the logs printed by the SDK for location analysis. Therefore, whether the SDK log is complete and whether it helps solve the problem is important to both application developers and SDK providers

  • Demo or industry solution
    Demo is used by the SDK provider to demonstrate how to call the interface to achieve specific functions. It can also be used as a developer to intuitively experience the effect of SDK access. Industry solutions are similar to Demo, but more like a product than Demo,with relatively complete and typical industry application scenarios. It allows industry developers to know more clearly how effective the products made by accessing this SDK are.

  • Other peripherals
    Such as UIkit, etc., may only be incidental output in SDK development, but for some developers, they can greatly reduce access costs

2. Client SDK interface test type

Depending on the needs and development platforms of the client SDK, you may need to choose different test types to test the SDK interface.

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:691998057【暗号:csdn999】

Common test types are:

  • Functional testing
    Ensure the SDK interface functioncorrectness and completeness. Client SDK interface testing is similar to server interface testing, including scenario coverage and interface parameter coverage

    It mainly tests the return value under various parameter combinations, considers whether the data is cached and stored, whether there is a callback, and whether the request succeeds or fails, it can be processed as expected.

  • Performance testing
    Ensure that the SDK interface meets specific performance requirements, such as resource usage and mobile device consumption Power, etc. In the Yunxin IM login scenario, a large number of synchronization data packets and offline message packets may be received during login, so the parsing of these data packets and the performance of local storage must be guaranteed, otherwise the login response may be slow or even stuck. problem, so you need to consider the performance of this scenario when testing

picture

  • Compatibility testing
    ensures that the SDK is compatible with specific device platforms and is compatible with other software. The workload of compatible device platforms is usually relatively large. First, analyze the device platforms that need to be adapted based on product needs and market status, and then prioritize coverage based on the models, system versions, resolutions, etc. that need to be covered

    Mobile SDK compatibility testing needs to consider support for the simulator, because many developers may develop on the simulator first. If the client SDK covers multi-platform devices, the interoperability of multi-terminal message data packets should also be considered

  • Stability test
    Check whether the interface function and device resource usage are abnormal when the business scenario continues to run for a period of time under certain pressure. For example, in the real-time audio and video call scenario of Yunxin, it is necessary to ensure that there are no abnormalities in the interface function and device resource usage when multiple people are talking for a long time and people are constantly coming in and out

  • Network-related tests
    Ensure that the SDK interface can be used underdifferent network types and different network environments Better handling. When it comes to multimedia resources or audio and video communications, there are many demands for testing under weak networks, and the processing under weak networks usually requires repeated optimization and comparison, not only comparing the effects of new and old versions, but alsoComparative test of the performance of competing products

  • Security testing

    Regarding privacy data protection, access rights control, user service authentication, etc., the SDK interfacesecurity issues are also quite prominent. Security is often taken into consideration during architecture design and development design, but it is best to have dedicated security testing

03. How to test the function

Among the many test types mentioned above,functional testing takes precedence. Before conducting client SDK testing, you need to fully understand the details of the test object:

  • Understand the business process, combine the API interface documentation and development guide, and rationalize the usage scenarios and calling relationships of the interface;

  • Understand the SDK protocol, understand the meaning of the fields in the protocol and the processing logic on the server side;

  • Understand each interface or protocolReturn code and analyze the corresponding scenario;

  • Understand the development implementation details, which can be drawn into diagrams to facilitate test analysis and layered verification.

To test the client SDK, the hierarchical testing methods that can be used from top to bottom are: based on Demo and solution -> based on interface call -> based on code.

1. Testing based on Demo and solution

When most client SDKs are proposed for testing, a corresponding demo or solution will be submitted for testing, so can cover the interface or business scenario corresponding to the demo or solution. . Moreover, testers can see the interface performance more intuitively and get started quickly, so it is commonly used in client SDK testing and is also more effective.

However, this testing method also has many shortcomings. The Demo has limited coverage of interfaces and business scenarios, cannot fully cover the input and output parameters of the interface, and increases the complexity of locating when problems are discovered. Well-designed demos and multiple solutions may be able to meet testing needs to the greatest extent, but they require a large investment in demo development and testing, which also greatly delays the time for problem exposure. Testing based on demos and solutions can be manual or UI layer automated testing.

2. Automated testing based on interface calls

Testing based on interface calls, includingtesting of a single interface, also includingbusiness scenarios< /span> coverage. This testing method is direct and effective and requires a certain development foundation

Currently, my colleagues in the project team also have some practices. Taking the Yunxin iOS SDK test as an example, the minimum regression test corresponding interface has also been automated.The basic structure of the test project is as follows:

Automated testing based on interface calls requires product ideas, development knowledge and testing thinking, which is difficult to do. However, because the SDK interface is usually relatively stable, once it is implemented and put into use, the benefits in testing efficiency and quality will be huge and it is worth having.

3. Code-based unit testing

Unit testing is an important part of ensuring the quality of development code. On the road of moving testing to the left, everyone is increasingly aware of the important value of unit testing. Especially in some core businesses, it is worthy for development students to invest their energy in it.

The development of other test types is similar to application layer testing. The methods and tools introduced in the Hangyan QA white paper can basically meet the testing needs, so they will not be repeated.

Finally, I would like to thank everyone who read my article carefully. Looking at the increase in fans and attention, there is always some courtesy. Although it is not a very valuable thing, if you can use it, you can take it directly!

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
 

Insert image description here

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/134999042