pythonAutomated testing (2)
Basic technical principles of automation
1 Overview
Before It was mentioned in the article: The first ability to do automation is to see the essence through the phenomenon, and when implemented in actual IT work, it is to see the data through the interface.
It is not easy to master the above skills. You must have a solid foundation of computer theory in order to see the deep and essential things.
2 ApplicationSoftware Logical Structure
Database Application System Probably the most typical network application , its software architecture is as follows:
is generally divided into 4 logical layers:
User interface layer UI
Provides an interactive human-computer interface for end users
Business logic layer BLL
Abstracts the database Objects are spliced into specific business logic objects and process organized
Data access layer DAL
ORM for the DB layer, allowing upper-layer applications to control the database in the form of objects
Data persistence layer DB
Store data, persist data, and share data with different clients
In the traditional C/S architecture, applications (for example, client applications under Windows) are generally a central database Service server (DB), and then corresponds to N clients (DAL-BLL-UI).
For junior testers, the understanding of the software may only stay at the UI layer, so what can be done during testing is: repeat it day by day Day after day, year after year, I have clicked with my mouse.
3 Internet Software Architecture
The basic architecture of the application software mentioned in the previous part, although it is in "C/S" It was proposed in the era, but it has continued to the present. The most common "ABC/S" mode to this day:
App/Server
Browser/Server
Client/Server
Actually Essentially, the UI layer is placed on the client side, and the UI layer below is placed on the server side.
Clients have different forms of expression under different platforms, forming the now popular so-called "ABC/S" model architecture, which has basically become the current Internet The product comes standard. The specific architecture is as follows:
The communication protocol Http/Https is used between the server and the client, and the format of data exchange is Xml/Json format.
Based on the above model, the methodology of software testing has undergone some changes:
With the cost-effective highest "based on communication encoding format "Interface Test", it means spending 20% to solve 80% of the work
Interface testing can be fully automated, and it does not have to be forced to use the same interface as the development project Language, you can uniformly use a more efficient scripting language
#Interface naturally has a need for stability, so automated testing projects will not have to be tossed over and over again
Interface testers have become referees between many platforms
Interface specifications come from design documents and can be implemented Design generates tests, test drivesDevelopment standard model
With the ability to abstract into data, many things you see can be converted into reasonable equivalents:
The background of the web page is red
Equivalent to: the color of the background of the background elementAttribute is #FF0000
## The words displayed on the button are "Submit"
- which is equivalent to: the value of the button element is
Submit
- The user performed a recharge activity and recharged 20 yuan, and there was an extra 20 yuan on his account
- is equivalent to: calling the recharge interface with 20 as the parameter, and then comparing the interfaces of calling the account
to query twice before and after. The difference is exactly the recharge parameter value
information.
The computer system calculates, stores, transmits, etc. these data, and finally lights up the dot matrix at different positions on the LCD display to form an optical analog output, which is transmitted to the human eye. This completes the acquisition ofinformation.
The above example can be simplified as follows: mechanical physical quantities generate electrical physical quantities for input, and after processing by the computer digital system, optical physical quantities are output. For computer systems, both input and output are diverse:Input device
- Various sensors can be used as the main input, such as the currently booming smart hardware and the hotly-hyped
Internet of Things.
- ##Output device
Since the fields of electronic technology and communications often detect physical quantities, which are difficult to quantify with the naked eye, the test threshold will be very high. However, various testing instruments have developed quite well, and the degree of automation is quite high. On the other hand, in the upper application software layer of the IT industry, people rely too much on manual operations and naked eye observation, but ignore automation. As a result, the testing industry has always had low personnel quality and weak technical strength. This is obviously very serious. It is not advisable, at least it is very inconsistent with the current needs of the software engineering industry.
5 Summary
This article logically layers the application software to explain the software automation testing and basic principles. In the second half of the article Part of the automated testing of electronic technologies involved in the currently popular
Intelligent Hardwarehas also been briefly discussed, hoping to give some inspiration to people who have never automated testing. The following series of articles will implement these theories from a technical level.
To summarize, for those who want to enter this industry and have in-depth development, we have the following conclusions and suggestions: The essence of software is not the interface but the data To understand the essence of software, you must have a good computer foundation People engaged in the Internet industry can be familiar with linux and establish this Software is data worldview as early as possible interface for automation Testing is the one with the highest investment and return ratio (from the perspective of engineers from Google) To do a good job in automated testing, you must have software development capabilities and system design capabilities Writing this, let me finally "Amway"Linux, because compared to MacOS and Windows systems, Linux does not do a good job in the interface. , but it has powerful CLI interaction and supports powerful scripting, which is very helpful for realizing automation. (Unfinished, to be continued...) I will continue to write python's automation tools and programming applications in the future.
The above is the detailed content of Basic technical principles of python automation. For more information, please follow other related articles on the PHP Chinese website!

The reasons why Python scripts cannot run on Unix systems include: 1) Insufficient permissions, using chmod xyour_script.py to grant execution permissions; 2) Shebang line is incorrect or missing, you should use #!/usr/bin/envpython; 3) The environment variables are not set properly, and you can print os.environ debugging; 4) Using the wrong Python version, you can specify the version on the Shebang line or the command line; 5) Dependency problems, using virtual environment to isolate dependencies; 6) Syntax errors, using python-mpy_compileyour_script.py to detect.

Using Python arrays is more suitable for processing large amounts of numerical data than lists. 1) Arrays save more memory, 2) Arrays are faster to operate by numerical values, 3) Arrays force type consistency, 4) Arrays are compatible with C arrays, but are not as flexible and convenient as lists.

Listsare Better ForeflexibilityandMixdatatatypes, Whilearraysares Superior Sumerical Computation Sand Larged Datasets.1) Unselable List Xibility, MixedDatatypes, andfrequent elementchanges.2) Usarray's sensory -sensical operations, Largedatasets, AndwhenMemoryEfficiency

NumPymanagesmemoryforlargearraysefficientlyusingviews,copies,andmemory-mappedfiles.1)Viewsallowslicingwithoutcopying,directlymodifyingtheoriginalarray.2)Copiescanbecreatedwiththecopy()methodforpreservingdata.3)Memory-mappedfileshandlemassivedatasetsb

ListsinPythondonotrequireimportingamodule,whilearraysfromthearraymoduledoneedanimport.1)Listsarebuilt-in,versatile,andcanholdmixeddatatypes.2)Arraysaremorememory-efficientfornumericdatabutlessflexible,requiringallelementstobeofthesametype.

Pythonlistscanstoreanydatatype,arraymodulearraysstoreonetype,andNumPyarraysarefornumericalcomputations.1)Listsareversatilebutlessmemory-efficient.2)Arraymodulearraysarememory-efficientforhomogeneousdata.3)NumPyarraysareoptimizedforperformanceinscient

WhenyouattempttostoreavalueofthewrongdatatypeinaPythonarray,you'llencounteraTypeError.Thisisduetothearraymodule'sstricttypeenforcement,whichrequiresallelementstobeofthesametypeasspecifiedbythetypecode.Forperformancereasons,arraysaremoreefficientthanl

Pythonlistsarepartofthestandardlibrary,whilearraysarenot.Listsarebuilt-in,versatile,andusedforstoringcollections,whereasarraysareprovidedbythearraymoduleandlesscommonlyusedduetolimitedfunctionality.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Chinese version
Chinese version, very easy to use

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
