Use PICT (pairwise independent combinatorial testing)

Source: Internet
Author: User
Tags null null

The Pict tool is a paired-combination command line generation tool used within Microsoft. It is now available for external use and can be downloaded on the Internet.

You need to input the input type and its corresponding parameters to a CSV format (CSV: a plain text file separated by commas (,) without any other format. The file uses commas (,) to separate fields and rows. The final file can be opened in Excel or in the import format of the program. The. CSV file will be opened in Notepad .)

For example:

Account name: Null, does not exist, super long, ultra short, normal
Password: Null, ultra-long, ultra-short, unmatched, normal
Verification Code: Null, ultra-long, ultra-short, unmatched, normal
Session: Save for one month, save for three months, save for one year, do not save
Button: OK, cancel

The list shows that there are more than 1000 combinations. Testing it in a short time will be very difficult. Research shows that the number of test cases will be greatly reduced through pict, and a high test coverage rate can be ensured.

For example, run the parameter document directly through Pict and print the test routine on the screen, as shown below:

D: \ Test Method \ two test> PICT login.txt

Account name and password verification code session button

Null does not exist. Do not save for one year. OK.

Null normally saved for one month canceled

Long, unmatched, empty, and saved for three months. OK.

Unsave and cancel

The storage is canceled for three months.

Null, super long, unmatched, not saved, OK

Normal, short, normal, and saved for one month. OK.

No matching exists. Saved for one month. Canceled.

Null, normal, and saved for one year

Super Long, normal storage, one year canceled

Normally, it does not match. It is saved for three months and canceled.

Normal mismatch, too long, not saved OK

No extra long, saved for three months. OK.

Saved for one year.

There is no normal null save for one month OK

Ultra-long, empty, and ultra-short storage canceled for one month

Ultra-short, ultra-short, and unsaved

Normal blank saved for one year OK

Saved for one month.

Super Short, normal, not saved OK

Empty, ultra short, and saved for three months.

Empty, ultra-short, and ultra-long, saved for one year

Normal, ultra-long, ultra-short, not saved, canceled

Null does not exist. Normally, do not save. OK.

Super-long, super-short, unmatched, unsaved, canceled

Saved for one month canceled with Super Short unmatched

Super Long normal Super Long save one month canceled

Null null save for one month OK

Null does not match extra long save one month canceled

No ultra-short, ultra-long, saved for one year canceled

Empty, super long, no storage OK

You can also save the test case to a specified file as follows:

D: \ Test Method \ two test> PICT login.txt> example .xls

 

Parameter file format

It is also called a model file. The file must contain at least parameter definitions. The sub-model definition and constraint definition are optional. As follows:

Parameter Definitions

[Sub-model definitions]

[Constraint definitions]

For example, the preceding logon test parameter file is as follows:

# Logon Parameters

 

Account name: NULL, nonexistent, ultra-long, ultra-short, normal

 

Password: NULL, ultra-long, ultra-short, unmatched, normal

Verification Code: NULL, ultra-long, ultra-short, unmatched, normal

Session: save for one month, save for three months, save for one year, do not save

Button: OK, cancel

Where, # Is the annotator. Note: The parameter file name must be in English, and the separators of parameters and parameter properties must be in English.

By default, Pict will generate test cases in pairs, that is, design test cases according to the two testing principles. However, you can also modify the parameter combination according to the actual situation. It can be implemented through parameter/o.

You can also restrict parameters based on your actual business needs. For example, if the account name, password, and Verification Code attributes are "normal", the session attribute can be "saved for one month", otherwise the session attribute is "not saved ". The parameter file is as follows:

Account name: NULL, nonexistent, ultra-long, ultra-short, normal

Password: NULL, ultra-long, ultra-short, unmatched, normal

Verification Code: NULL, ultra-long, ultra-short, unmatched, normal

Session: save for one month, save for three months, save for one year, do not save

Button: OK, cancel

If [Account name] = "normal" and [Password] = "normal" and [Verification Code] = "normal" then [session] = "save for one month" else [session] =" do not save ";

Note: The Terminator of the Condition Statement is a semicolon.

The condition statements of PICT support: =, <>,>,> =, <, <=, like, not, And, or ...... Parameter comparison is also supported.

PICT reduces the number of test cases while ensuring test coverage. However, if the business logic is complex, you need to write a large number of condition judgment statements in the parameter file. Comprehensive Judgment is required in actual situations. This tool can be used if necessary.

Use PICT (pairwise independent combinatorial testing)

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.