The editbox of application of equivalence class partitioning method

Source: Internet
Author: User
Tags control characters

In this week's software testing lesson we learned the equivalence class partitioning method, and in this work further familiar with the application of this method, using this method to study the editbox use case.

Functional Requirements:

Allow 1 to 6 English characters or numbers, press OK to end

Valid equivalence classes:

Length: 1 to 6

Character: a-z,a-z,0-9

invalid equivalence class:   Length: 0,7

Characters: English/numeric characters, control characters, punctuation

equivalence class partitioning:

Valid classes Invalid class
Length 1 to 6 0,7
Character A-z,a-z,0-9 English/numeric characters, control characters, punctuation

test Case:

Number Input overriding equivalence classes Output
Test1 123456 Length 1 to 6, character 0-9 Enter the correct
Test2 123abc Length 1 to 6, character 0-9, A-Z Enter the correct
Test3 Length of 0 Please enter a character with a length of 1-6
Test4 1234567 Length 7, character 0-9 Please enter a character with a length of 1-6
Test5 Abcdefg Length is 7. Character A-Z Please enter a character with a length of 1-6
Test6 123! Length 1 to 6, English/numeric characters, control characters, punctuation Only English characters and numbers are allowed

Code and results:

This experiment would like to use the Java language to achieve, but there is a period of time useless some unfamiliar, instead of using JSP language to achieve.

Here is the code:

The results are as follows:

The editbox of application of equivalence class partitioning method

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.