Jianyuan Forum·Model viewing丨Interface-oriented graphical testing technology

Author |  Xiong Yiheng Ph.D., School of Software Engineering, East China Normal University

         Su TingProfessor, School of Software Engineering, East China Normal University

Section|  Jianyuan Forum · View model

01  What is interface-oriented graphical testing (GUI Testing)

Graphical User Interface (GUI) is a user interface that presents information, data, functions, and operations graphically, aiming to provide a more intuitive, friendly, and easy-to-use experience to meet the needs and expectations of users. Graphical user interface is usually composed of components such as windows, menus, buttons, text boxes, icons, labels, etc. Users can interact and operate through input devices such as mouse and keyboard. The design and layout of the GUI interface needs to consider factors such as user habits, visual effects, and ease of use to provide the best user experience.

Interface-oriented graphical testing is a commonly used software testing method, which aims to verify whether the user interface meets business specifications and user needs, and whether the function of the application responds to user operations correctly, so as to ensure the quality and stability of the application. Graphical testing is usually carried out in the middle and late stages of development, which can ensure the functionality of the application and the quality of the user interface, improve user experience, and reduce user complaints and refund rates. This technology can effectively improve test efficiency and test quality, and is widely used in the test of various applications.

For example, if a user visits the website homepage (https://www.jd.com/) of JD.com, he will see navigation bar, search bar, recommendation bar and many other components. Testers can conduct graphical tests on this webpage for different concerns. For example, click the "Free Registration" button, whether the website can pop up the corresponding registration webpage, including whether the navigation, search, form, shopping cart, payment and other functions can respond to user operations normally.

Through graphical testing, problems and defects in the application can be found, the quality of the application and user experience can be improved, and the satisfaction and loyalty of users can be enhanced, thereby increasing the value and competitiveness of the application.

02Common interface-oriented graphical testing technology 

2.1 Human-based testing

Manual-based testing is a traditional software testing method, in which testers discover and report application problems and defects by manually operating the user interface of the application and simulating user behavior and operations. In practical applications, functional problems at the application system level are largely found by manual testing [1]. Manual-based graphical testing requires experienced testers who can comprehensively cover test cases and test scenarios. However, the efficiency and accuracy of testing is greatly affected by the skill level and experience of testers. Manual-based testing mainly includes the following steps:

(1) Understanding project requirements and developing a test plan: Testers must analyze all requirements documents in order to identify the expected behavior of the software and exactly what needs to be tested. Testers develop test plans and test cases based on requirements and specifications.

(2) Test environment and test data preparation: Testers prepare the test environment and test data, including installing and configuring test software, preparing test data, setting test tools and equipment, etc., to ensure the consistency and stability of the test environment.

(3) Manual test execution: Testers manually operate the user interface of the application according to the test plan and test cases, simulating user behavior and operations, including clicking, inputting, selecting, dragging, etc., to verify the functionality and performance of the application , and record test results and exceptions.

(4) Defect report and summary: When testers find a defect, they need to generate a defect report according to the report template formulated by the test team, including defect description, defect classification, defect level, etc., and track and confirm defect repair and verify. After the test is completed, the tester generates a test report according to the test results and submits it to the project team.

The advantages of manual-based testing include: high test flexibility , manual testing can build different test cases based on a function, and adapt to different program performances; high testing accuracy , automated testing tools are not as experienced as testers, manual testing can It is more accurate to judge whether an application performance is a program error; the test feedback is timely , and software defects and problems can be found and reported in time.

However, manual testing also has some disadvantages , such as low testing efficiency , long testing time and workload of testers, when a large number of test cases need to be generated in a short period of time, it is not suitable for manual testing; high testing costs , Compared with automated testing, manual testing requires a lot of manpower and time; the test repeatability is poor , and the test results may be affected by the subjective factors of the testers; the test coverage is limited , and may not cover all test cases and test scenarios.

2.2 Test based on recording and playback

The test based on recording and playback records the user's operation on the graphical interface, generates a test script, and then plays back the test script to the target application to simulate the user's operation and verify the function of the application. Recording and playback testing technology is a form of automated testing. It does not require manual writing of test scripts and reduces the workload of staff. It is suitable for scenarios that require repeated execution of the same test cases, such as regression testing and performance testing. Recording playback testing technology mainly includes the following steps:

(1) Record test scripts: testers open the test tool, start the recording function, and then perform operations and events on the user interface of the application, such as clicking buttons, entering text, selecting menus, etc., the test tool will automatically capture and record the user's Actions and events, and generate test scripts.

(2) Editing test scripts: Testers can edit and optimize the generated test scripts, such as adding assertions, adjusting waiting time, modifying parameters, etc., to ensure that the test scripts can correctly simulate the user's operations and verify the functions and functions of the application. performance.

(3) Playback test script: The tester starts the playback function, and the test tool will automatically execute the test script, simulate the user's operation and verify the function and performance of the application, and record the test results and abnormal conditions at the same time.

(4) Generate test reports: testers analyze test results, including test pass rate, test coverage, etc., find software defects and problems, and provide test reports to the development team.

The advantages of recording playback testing technology include: low cost of testing , no need for professionals who can write test scripts, high testing efficiency, can automatically generate test scripts and automatically execute tests according to testers' recordings; high testing accuracy , can simulate real users The operation and verification of the function and performance of the application; the test maintainability is high , and the test script and test data can be quickly modified and updated.

However, the recording and playback testing technology also has some disadvantages. For example, the reliability and stability of the test script are affected by the changes of the application program and the test environment, and it is necessary to ensure the consistency and stability of the test environment; the maintenance cost of the test script is high , Application codes and interfaces are constantly changing, so test scripts and test data need to be constantly updated and optimized to adapt to these changes; test coverage is limited , relying on the recording of testers, and testers generally prefer to record some core functions and core steps.

Selenium IDE [2] is a very popular open source web automation testing tool under Selenium Suite, its core function is to record and play back tests. It does not require users to have any programming knowledge, it only needs to record the user's interaction with the browser so that it can quickly create, execute and debug automated test scripts. Selenium IDE provides a simple interface to quickly create automated test scripts without writing any code through simple drag-and-drop operations and recording capabilities. It supports a variety of browsers, including Chrome, Firefox, and more. In addition, Selenium IDE can also export test scripts as codes in multiple programming languages, such as Java, C# and Python.

2.3 Model-Based Testing

Model-based testing is an automated testing method that uses models to describe the behavior and structure of the system under test, thereby generating test cases and verifying the correctness and reliability of the system. Model-based testing can improve test efficiency and coverage, reduce the workload of testers, and is suitable for complex and changeable applications, such as embedded systems, software systems, network systems, etc.

Model-based testing mainly includes the following steps:

(1) Modeling: Testers use modeling tools to build models of the system under test based on requirements and specifications, including functional models, state models, data models, etc., to describe the behavior and structure of the system under test.

(2) Model analysis: Testers analyze and verify the model, including model checking, model simulation, model testing, etc., to find and fix errors and problems in the model.

(3) Test case generation: Testers use the model to generate test cases, including coverage-based test cases, random test cases, symbolic execution test cases, etc., to cover all paths and states in the model, and to meet the test objectives and test requirements .

(4) Automated test execution: testers use automated test tools to execute generated test cases, and perform automated tests on the system under test, including functional tests, performance tests, security tests, etc., to verify the correctness and reliability of the system under test .

(5) Test report and summary: Testers sort out test results and problem reports, generate test reports and summaries, including test pass rate, test coverage rate, defect statistics, test suggestions, etc., to provide reference and decision-making for project teams and managers .

The advantages of model-based testing include: high test efficiency , can automatically generate test cases and test scripts, and automatically execute tests; high test coverage , can cover all paths and states in the model; good test repeatability , can be repeated Execute the same test cases and test scripts; the test results are highly accurate and can automatically verify the correctness and reliability of the tested system.

However, model-based testing also has some disadvantages, such as the high cost of model establishment and maintenance , which requires a lot of human and material resources, and requires the modeler to have a good understanding of the application to be tested; the threshold is high , and the construction of the model requires very professional skills. Modelers are proficient in using various professional skills [3]; the application range of the model is limited , and may not cover all test requirements and test scenarios. Therefore, in actual testing, different testing methods and tools should be selected comprehensively according to the testing requirements and the characteristics of the application program, so as to improve the testing efficiency and quality.

Fastbot [4] is an open-source model-based GUI testing tool developed by ByteDance Quality Lab to discover stability issues in mobile apps. Fastbot abstracts the GUI information of the app into the state in the model, abstracts the executed actions into the actions in the model, and then generates test cases based on the built model, and provides a variety of algorithm strategies, with the goal of achieving a higher Activity coverage and Strong problem finding ability. At the same time, Fastbot also supports cross-platform testing and multi-machine collaborative testing on massive devices. Fastbot also uses image detection technology to support a richer image UI anomaly detection capability (black and white screen, image overlapping, control occlusion, etc.).

03Challenges  of interface-oriented graphical testing

According to the report on the statista website, 48% of mobile application testers regard the graphical interface as the main testing focus [5]. Interface-oriented graphical testing plays a vital role in the function and quality of applications, and there are many challenges in practical applications:

(1) Code and design changes: In view of the frequent updates of application interfaces and functions, testers need to constantly adjust test scripts to adapt to new test scenarios.

(2) Error handling: When testing complex applications, various program problems may be encountered to interfere with the testing process. How to deal with these problems is a common problem.

(3) Synchronization between the test tool and the software under test: If there is a problem with the synchronization between the test tool and the test object, it is likely to cause the test to fail and affect the accuracy of the test results [6].

(4) Dependence on testing tools: firstly, it is necessary to select an appropriate testing tool, and to customize and configure the testing application accordingly.

(5) Professional skills are required: certain programming and testing skills are required to write test scripts and configure and use automated test tools.

(6) Diversity: Different software interface designs are different, and testers need to be familiar with various interface styles and interaction methods.

04  Summary

Interface-oriented graphical testing technology has become one of the important means of various application testing. This testing technique is widely used in the testing of various applications, especially for those applications with complex user interface and strong interaction, such as games, mobile apps, websites, etc. This technology can effectively improve test efficiency and test quality. Although great progress has been made, the testing technology still faces many challenges, and academia and industry are constantly exploring and trying various new technologies and methods to improve the efficiency and quality of testing.

references:

[1] Itkonen J, Mantyla M V, Lassenius C. How do testers do it? An exploratory study on manual testing practices[C]//2009 3rd International Symposium on Empirical Software Engineering and Measurement. IEEE, 2009: 494-497.

[2] Selenium IDE -https://www.selenium.dev/selenium-ide/.

[3] Dias Neto A C, Subramanyan R, Vieira M, et al. A survey on model-based testing approaches: a systematic review[C]//Proceedings of the 1st ACM international workshop on Empirical assessment of software engineering languages and technologies: held in conjunction with the 22nd IEEE/ACM International Conference on Automated Software Engineering (ASE) 2007. 2007: 31-36.

[4] Fastbot https://github.com/bytedance/Fastbot_Android.

[5] “Focus areas for testing mobile applications from 2013 to 2017” -https://www.statista.com/statistics/500605/worldwide-mobile-application-testing-focus-areas/.

[6] Alégroth E, Feldt R, Ryrholm L. Visual gui testing in practice: challenges, problemsand limitations[J]. Empirical Software Engineering, 2015, 20: 694-744. 

Guess you like

Origin blog.csdn.net/TICPSH/article/details/130282755