简体   繁体   中英

What's difference between UI level testing and API level testing?

I got this question while interviewing some companies. I don't think I answer the question well. However, based on my understanding:

The UI level testing is more about the what end user will see and would be better to use for acceptance testing.

The API level test is good for performance testing, since it's easier to simulate multiple users to access the resource at the same time. And, it's easier to look at where the problem will be.

Can anyone give me more detail about that? And when should we choose to use which type of testing?? Thanks a lot.

UI stands for User Interface. UI allows the user to interact with the application.

UI testing refers to testing graphical user interfaces, such as how user interacts with the application, testing application elements like fonts, layouts, buttons, images, colors, etc. Basically, UI testing concentrates on the look-and-feel of an application.

For more details on API testing, see:

http://www.guru99.com/gui-testing.html

API is an acronym for Application Programming Interface. API enables communication between two separate software systems. A software system implementing an API contains functions/sub-routines which can be executed by another software system.

API testing is checking API of a Software System. In order to check the API , it needs to be called from the calling software . Necessary test environment, database, server, application setup needs to be prepared before doing API Testing.

API testing is focused on the functionality of the business logic (such as a calculating total price) and it is entirely different from UI testing. It mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.

For more details on API testing, see:

http://www.guru99.com/api-testing.html

Eric

In few words:

UI testing is testing between users (humans in most cases) and front end or client side (aka presentation logic) of the application such as a browser.

API testing is testing between backend or server side of the application (aka business logic) and backend of another application.

Testing at the API layer enables the robust, low-noise regression tests that are essential for continuous testing. It also helps you zero in on problems that might not be evident from the UI level — for example, an error in writing the expected values to the database.

GUI Testing--testing on visible elements in pages or screens called as Gui testing.some other names to GUI are Sites testing/ front end testing/ screens testing.

API testing --Testing on invisible services functionalities called as API testing. other names to API are Services testing/ middleware Testing/SOA testing.

End-to-End Testing --testing related to integration of a site and a service is called as End-to-End testing. other names are Inter System testing/ interoperability testing.

In everyday testing, basicly there are three uses for API testing from the testers' point of view.

  1. When an application is brand new, and the backend is ready/being developed, and there is no GUI yet, that is when API is tested. Also when the new functionality is newly developed, and is not yet deployed to the GUI ready code base. This is usually the phase of the project that most, and highest priority business requirements are implemented in the code.
  2. When you encounter a API call error in your browser's DevTools, it could be usefull to test different API resources.
  3. When the tester reports a defect, in the defect ticket, the developers post in the result of new fix, or operations the result of the fix/configuration in the environment, as a quick check of the isolated functionality.

But in general, once a GUI is ready, usually API testing in not needed, at least for testers. Of course for developers, it is useful to test new functionalities, as a higher level testing (integration testing) after unit tests.

Instead of going into a long explanation, where you can find volumes written on the Internet, let me give you a couple of additional keywords. For UI testing, also look at FUNCTIONAL and EXPLORATORY testing. For API, also look at UNIT and AUTOMATED testing.

I find this resource useful http://www.stickyminds.com/testandevaluation.asp?Function=FEATUREDETAIL&ObjectId=17275

Pick the one your boss will give you a promotion for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM