Talk about software testing - automated testing framework

Whether in automated testing practice or in everyday communication, one word is often heard: framework. In the process of learning automated testing before, I have been ignorant of the word "framework".

I have read a lot of automation-related materials recently, plus some of my own practice, I have some understanding of the "framework", this blog, let's talk about some things about the automation framework. . .

1. Common automated testing frameworks

1. Interface automation framework:

①、java+testNG/Junit+Maven/Ant/Gradle+Jenkins+MySQL+testlink/redmine

②、python+unittest/pytest+Git+Jenkins+MySQL+testlink/redmine

③、python+rebot framework+unittest/pytest+Git+Jenkins+MySQL+testlink/redmine

④、jmeter+Maven/Ant+Jenkins+MySQL+testlink/redmine

2. UI automation testing framework

①、java+selenium/appium+testNG/Junit+Maven/Ant/Gradle+Jenkins+MySQL+testlink/redmine

②、python+selenium/appium+unittest/pytest+Git+Jenkins+MySQL+testlink/redmine

③、python+rebot framework+unittest/pytest+Git+Jenkins+MySQL+testlink/redmine

Through some common frameworks above, what did you discover?

They all have common features: programming language + unit testing framework + scan compilation tool + continuous integration tool + database + project management tool .

Programming language: writing test scripts, logging and output;

Unit testing framework: Provides a series of configurations such as test script running, exception checking, etc.;

Scanning and compiling tools: Scanning and compiling test files, it is generally better to use with continuous integration tools;

Continuous integration tool: Jenkins, a classic continuous integration tool;

Database: test data management;

Project management tools: statistical management of test results;

PS: There are too many automated testing tools. The above only lists some open source tools that have a high usage rate and that I personally know. The specific framework selection needs to be determined according to the specific project characteristics, team and personal technical characteristics!

Some understandings and summaries of automated testing frameworks are the above content. Some framework components mentioned may have unreasonable places, which are for reference only. If you have better suggestions, please point them out, I would be very grateful.

2. Automated testing framework

The components that make up the framework should at least have the following functions:

Log: log recording and management functions, set different log levels for different situations, which is convenient for locating problems;

Report: Test report generation and management and instant notification, quick response to test results;

Source: Management of configuration files and static resources, following the principle of high cohesion and low coupling;

Common: Management of public functions, methods and common operations, following the principle of high cohesion and low coupling;

TestCase: Test case management function, one function point corresponds to one or more cases, to improve the coverage rate as much as possible;

TestData: Test data management function, separate data and scripts, reduce maintenance costs and improve portability;

TestSuite: Test component management function, assemble and build different test frameworks for different scenarios and different needs, and follow the flexibility and extensibility of the framework;

Statistics: statistical management function of test results, statistics, analysis, comparison and feedback of the results of each execution test, data-driven, providing reference for software optimization and process improvement;

Continuous: Continuous integration environment, that is, CI environment, including test file submission, scan and compilation, test execution, report generation and timely notification, etc. Continuous integration is the core of automated testing !

3. Automated testing

1. Why automate testing?

①, black box test regression efficiency is low

②, the contingency and uncertainty of manual testing

③ Insufficient coverage of regression

④. The quality of the delivered products cannot be guaranteed, and it all depends on the evaluation

⑤ The more complex the system, the more problems

⑥. Butterfly effect caused by long online time and high component failure rate (fast iteration, more overtime)

2. What problems can automated testing solve?

①, improve the response rate after the problem occurs

②, reduce the cost of return

③, improve regression coverage

④, improve the return efficiency

⑤, improve the stability of regression

3. What are the shortcomings of automated testing?

①. It is impossible to reduce the cost input, but to speed up the feedback of test results and improve the quality of the test

②, automation is suitable for regression and smoke, not for finding bugs

3. The recording and playback function is tasteless, and visualization is not a good practice

④, not all functions of all systems are suitable for automated testing

4. What is a framework

A framework is a frame—meaning its restraint , and a shelf—meaning its support . It is a basic conceptual structure used to solve or deal with complex problems.

In software engineering, framework is the reusable design of the whole or part of the system, which is expressed as a set of abstract components and the method of interaction between component instances;

Another definition holds that a framework is an application skeleton that can be customized by application developers, the former being defined in terms of applications and the latter in terms of purpose.                 

The above concept is relatively abstract, and explained from another angle:

1. The framework itself is generally incomplete enough to solve a specific problem;

2. Frameworks are inherently designed to scale;

3. The framework can provide many auxiliary and supporting convenient and easy-to-use tools for subsequent expansion components, that is to say, the framework is equipped with some libraries or tools to help solve certain types of problems.

Constraints: A software framework for solving a specific problem will first define the boundary of the problem, and then constrain the relevant software components within this boundary, maintaining the cohesion of the framework in solving the problem.

Supportability: The framework itself does not solve any problems, but gives the relevant components to solve the problem a combined foundation. The scientificity and ease of use of this foundation directly affect the scientificity and convenience of further development on top of it.

The above two explanations and definitions of frameworks do not seem to be very simple and straightforward to explain what a framework is. Here are some of my understandings:

Definition: A tool that constrains the boundary to solve some specific problem, supports the entire problem solution, and is composed of some problem-solving components .

Specific Questions: What's the problem? --automated test

Constraint Boundaries: Why Constraints? - Clarify the scope and purpose of the test

Solution: What solution is used to solve the problem? - programming language + tools + other

The components that make up the tool: which components? - use cases, scripts, data, logs, reports, notifications

Tools: What are the features? - Flexibility, scalability, high cohesion and low coupling

V. Summary 

 

Thanks to everyone who read my article carefully, watching the rise and attention of fans along the way, there is always a need for gift exchanges, although it is not a very valuable thing, if you can use it, you can take it directly:

① More than 2000 Python e-books (mainstream and classic books should be available)

② Python standard library information (the most complete Chinese version)

③ Project source code (forty or fifty interesting and classic training projects and source code)

④ Videos on basic introduction to Python, crawler, web development, and big data analysis (suitable for novice learning)

⑤ Python learning roadmap (say goodbye to inexperienced learning)

The information in the picture above is in my QQ technical exchange group (technical exchange and resource sharing, advertisements come in to interrupt you)

You can take it away by yourself. The free information in the group number 953306497 (note "csdn111") is the essence of the author's more than ten years of testing career. There are also peer gods to exchange technology together.

Guess you like

Origin blog.csdn.net/ZangKang1/article/details/123031022