The art of testing--general test case paper

Source: Internet
Author: User

PS: For universal test points, only the focus and direction of the test are explained. For the specific project test, the relevant case can be refined.

Common test Case design methods:
1. Boundary value
2. Equivalence class
3. Scenario Method
4. Error-Guessing method
5. For parameter testing

1. Web page General test case
Test point Case Focus Point
Ui/ue Principles: The Display and interface of page elements, the friendliness of hints

The alignment of the page element
Picture, copywriting and other elements around the alignment, or upper and lower alignment (copy too long too short to align);

The page occlusion
If the copy is too long, the page shows whether it is obscured;
All the dropdown boxes are not properly obscured by other elements of the display;

"Normative
Footer,header does not move up or down when the page has no results
HTML page: Description of keyword,description, SEO friendly

Different end of the picture size, title display;
Company logo, etc.


"No JS Error
Function Hint: Boundary value, equivalence class division, Scene method is used here most

Principle:
Each function point
, at least 3 kinds of normal conditions, 3 kinds of abnormal conditions of the separate test
after an operation, be careful to check whether the subsequent actions involved are correct (such as whether or not you can log in properly after you have successfully registered, and whether you can watch the VIP after purchasing the VIP;)



The input box
The input box is long;
The input is empty;
Enter special characters

The upload download
Upload size format limit


"The use of permutations and combinations of different parameters
The processing of different parameters and different treatment situations under different scenarios;
Browser compatible Incompatible points:
1. Page elements in different browsers are obscured,
2. Element Display,
3. Page submission (there is a project, a blank input box, a browser to the back end of the value of an empty string, another browser to the back end of the empty string),
4. Whether the default behavior of the browser affects the normal function (such as the H5 video element when playing videos, different browser to the player will have different takeover behavior, resulting in video playback, full screen, etc. will be affected by different)

"PC-side Web site:

Window
FF,CHROME,IE6-11,360, etc.
Mac:
Safari
"Mobile-side website:
Android:
QQ Browser, UC Browser, Baidu Browser, open Gate Browser, ff,chrome, etc.
Ios:
Safari
Security prompt: Security information includes cookies, URLs, and information displayed on the page

"Cookie
Add: Login or other actions causing the cookie to be added: cookie value, expiration time, etc. no sensitive words
Delete: Log out or other action that causes the cookie to be deleted: Cookie has been invalidated
Modified: When an action   cause  cookie value changes, pay attention to check;

cookie Disabled: when disabled, Whether a cookie is disabled when logging in or other actions involving cookie modification;
for mobile browsers that do not support cookies, how to handle cookies (approximately: 3% of cookies are not supported)


The URL
URL cannot contain an IP address and must use the domain name
URL in which sensitive words are encrypted: sensitive words such as the phone number, such as the password in the
Post body are encrypted


Page Display
page information on the mobile phone number, mailbox, order number, etc. Whether you need to encrypt the display of the

"frequency limit

If the password is entered incorrectly multiple times, the account is disabled;

" page input In the
input box, enter some SQL, JS, etc., whether it will cross the front-end check

"Other information
Some error pages, such as 404, or 500 pages, Did you give a friendly error message such as" the page you visited does not exist ", rather than exposing some program code

Data and caching Tip: The mock interface returns, based on processing such as If/else in the code, and the exception of the interface itself.

"Interface (a mock of dependency and interface)
The return field of the interface is too long (occlusion of the page)
The return of the interface is empty (no result hint for the page, Header,footer does not move up or down)
When the interface returns time-out, the page prompts;
Page error prompt when the interface returns an exception

The cookie Cache
Focus on checking various actions involving cookies when adding, modifying, and deleting cookies:
Value of the cookie (no sensitive word), expiration time

"Localstorage (H5 unique)
For interfaces that do not require real-time invocation, the JSON return of the interface is stored in localstorage (note that the cached data does not affect the timeliness of the page display when the information is modified);
Web page Check "button
When the interface is not returned, the button is grayed out, or can be clicked
button multiple clicks
The forms
If you are registering, repeat the submission form
"Picture, link open Way
new tab open? Or on the current page open (once an item, because using the current page opens, seriously affecting the user's habits) "Enter key page input, the behavior of the ENTER key and processing" back key- back key when the page processing and prompt login, click the Back button, Whether the page is allowed to rewind, whether the page is still in the login state;
Have the input page, directly click Back button, whether there is a page left hint (once the direct back, all the input will be lost, serious consequences)
Different end Tip: If there is a ios,android, such as the use of different ends, test one side of the modification operation, whether to display the changes in real time on the other side
Note: Prevent the page information from being updated in time because of the cache reason
Slow speed The speed of the mobile phone is slow, or when the network is broken, page load check:
When the network speed is slow, the page cannot be blank
Impossible handling of the situation Tip: Error guessing, handling of impossible situations

How to deal with a negative value that cannot occur


2. Interface Test General Caseps: interface testing is focused on the diff code to find the test point (different handling of If/else in the code)
Test point Case Focus Point
Function PS: Design case for boundary value, equivalence class, etc.

The parameter
The combination of different parameters of the interface parameter contains special characters (according to the HTTP protocol requirements, the value of the passed parameter if there is a special character (such as: &,@, etc.), then the value needs to do the URL Encoding (UTF-8), so that the request receiver can receive the correct parameter value ) different processing of if/else in the code
"NULL pointer contains null pointer " result sort
If the result has a sort of field, consider having 0, 1, multiple identical field values when the result is sorted

"Dependent interfaces
If the implementation of the interface calls the other interface, the return of the other interface is performed in a different mock return

Safety "Sensitive word encryption
The sensitive vocabulary returned by the interface "required parameter interface parameters, must contain parameters, optional parameters
Db The Data preparation
No interface data in DB, one interface data, or the return of multiple compliant interface data
"Data-sensitive word encryption in db
Cross-domain If the interface is available for front-end use, you need to determine cross-domain policies

"PC-side web site cross-domain, parameter add callback, interface return JSONP

"Mobile site cross-domain, via security domain control in reponse header (Access-control-allow-origin)
Performance
The return time interface of the interface can withstand resource conditions such as the CPU of a QPS server
Normative Parameter naming, code normalization
Logging and monitoring The log
Log location (critical processing steps), level (easy to debug), log keywords (avoid calling null pointers, correct), size (avoid log increases on the line too much, affect server performance)
"Monitoring
Monitoring of the location, monitoring of indicators, interface normal/abnormal monitoring

Cache If the interface involves caches such as REDIS,MEM, the monitoring of the cache, the size of the cache, the cache hit rate
Error message
Error return status and error prompt error clear, no ambiguity
Multithreading and performance Tip: If the interface involves multithreading


"The correctness guarantee of adding and deleting changes

Guaranteed to be deleted and then added (diff code)
Thread sequencing (consistency of data)

Note: When multithreading, will involve the lock table, print related logs and error

"Server memory Recycling
Linux Jstat and other commands to check the memory recovery of the server to prevent memory leaks;







The art of testing--general test case paper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.