Friday, 12 October 2012

Regular Expressions Exercises



CASE STUDY:  LIBRARY MANAGEMENT SYSTEM

FUNCTIONAL SPECIFICATION #1:  In LMS (Library Management System), Library employees can go to registration, during this process, library employer can give below type values in the fields:

·         Employee Name = One or more words
·         Password = Alphanumeric with underscore from 4-8 positions
·         Retype Password = Equal to password
·         After filling the above fields, employ can click REGISTRATION button to get EMPLOYEE ID for valid data, and error message for invalid data. 
·         Here, employee ID must be in following format:  LMS_EMP_xxxx (4 digit number)
·         At times, employee can also CANCEL button to close registration window at any time.

QUESTION:  Prepare test scenarios and test cases for Employee Registration Module functional testing in LMS

TEST SCENARIO #1:  Validate employee name field

BVA SIZE for Employee Name
Min
1
Alphabets
Valid
Min -1
Blank
Alphabets
Invalid
Min +1
2
Alphabets
Valid
Max
256
Alphabets
Valid
Max -1
255
Alphabets
Valid
Max +1
257
Alphabets
Invalid


ECP TYPE for Employee Name
VALID
INVALID
·         ([\w][\s]?){1,}
·         [0-9]
·         [^\s]
·         Blank Field



[^\s] = All special characters except [\s] space


 
TEST SCENARIO #2:  Validate password field

BVA SIZE for Password
Min
4
Positions
Valid
Min -1
3
Positions
Invalid
Min +1
5
Positions
Valid
Max
8
Positions
Valid
Max -1
7
Positions
Valid
Max +1
9
Positions
Invalid


ECP TYPE for Password
VALID
INVALID
·         [.]{4,8}
OR
[a-bA-B0-9_][4,8]
·         [^_]
·         Blank Field




TEST SCENARIO #3: Validate Retype password field

 DT for Retype Password
RETYPE PASSWORD
CRITERIA
·         Equal to Password

·         Other
·         Valid

·         Invalid


TEST SCENARIO #4:  Validate Employee registration operation by clicking REGISTER button

DT with OA for Register Button
Fields
Expect Output by clicking Register button
·         All fields valid
·         Any field invalid
·         Any field blank
·         Returned Employee ID
·         Error message
·         Error message


TEST SCENARIO #5:  Validate Employee ID value format after successful registration

BVA SIZE for Employee ID
Min
12
Positions
Valid
Min -1
11
Positions
Invalid
Min +1
13
Positions
Invalid
Max
12
Positions
Valid
Max -1
11
Positions
Invalid
Max +1
13
Positions
Invalid



ECP TYPE for Employee ID
VALID
INVALID
[L][M][S][_][E][M][P][_]
[0-9]{4}
·         [^LMSEP]
·         [a-z]
·         [^_]
·         DUPLICATE
·         Blank Field




TEST SCENARIO #6:  Validate Cancel button to close employee registration window

Fields
Expect Output by clicking CANCEL button
·         All fields filled
·         Some fields filled
·         All fields blank
·         After getting employee ID returned
·         After getting error message
·         Window closed
·         Window closed
·         Window closed
·         Window closed


·         Window closed


FUNCTIONAL SPECIFICATION #2:  After completion of registration, employees are using login window daily to connect to library server.  The login window consists of Employee ID & Password fields

·         Employee ID:  LMS_EMP_xxxx (4 digits) format
·         Password:  Alphanumeric with 4-8 positions long
·         After entering Employee ID and Password, employee can click “OK” button to get to next window for valid data and error message for invalid data
·         Employee can click “CANCEL” button at any time to close the login window

QUESTION:  Prepare test scenarios and test cases for LOGIN module functional testing in LMS

TEST SCENARIO #7:  Validate employee ID field

BVA SIZE for Employee ID
Min
12
Positions
Valid
Min -1
11
Positions
Invalid
Min +1
13
Positions
Invalid
Max
12
Positions
Valid
Max -1
11
Positions
Invalid
Max +1
13
Positions
Invalid

ECP TYPE for Employee ID
VALID
INVALID
[L][M][S][_][E][M][P][_]
[0-9]{4}
·         [^LMSEP]
·         [a-z]
·         [^_]
·         Blank Field

TEST SCENARIO #8: Validate Password field


BVA SIZE for Password
Min
4
Positions
Valid
Min -1
3
Positions
Invalid
Min +1
5
Positions
Valid
Max
8
Positions
Valid
Max -1
7
Positions
Valid
Max +1
9
Positions
Invalid


ECP TYPE for Password
VALID
INVALID
·         [.]{4,8}
OR
[a-bA-B0-9_][4,8]
·         [^_]
·         Blank Field



TEST SCENARIO #9:  Validate Login by clicking OK button

DT with OA for Login OK Button
Fields
Expect Output by clicking OK button
·         All fields valid
·         Any field invalid
·         Any field blank
·         Next window opened
·         Error message
·         Error message

  TEST SCENARIO #10:  Validate Cancel button to close employee login window

DT with OA for CANCEL Button
Fields
Expect Output by clicking CANCEL button
·         All fields filled
·         Some fields filled
·         All fields blank

·         Window closed
·         Window closed
·         Window closed



FUNCTIONAL SPECIFICATION #3:  After successful login employee can get into next window with options. 

·         Employee can select READER REGISTER option to get reader register window, this window consists of below fields
·         Reader’s Name:  One or more words but every word must be in upper case
·         Reader’s Age:  16-60
·         Reader’s Address: Alphanumeric along with /-, as one or more words
·         Telephone:  Valid in India
·         Email ID:  Valid with respective WWW (W3C) Rules
·         After filling the above fields, employee can click register button to get Reader’s ID for valid data, and error message for invalid data
·         Here, Reader’s ID must in following format: LMS_MM_YY_xxxxxx (6 digits)
EXP:  LMS_10_12_345876
·         Employee can click back button at any time to go back to Options window from reader’s registration window

QUESTION:  Prepare test scenarios and test cases for Reader’s Registration Module functional testing in LMS project.

TEST SCENARIO #11:  Validate Readers Registration option from options window

DT for Readers Registration Window
Options
Expect Output by selecting Readers Registration option
·         Select Readers Registration option
·         Other options

·         Reader’s Registration

·         Other windows opened



TEST SCENARIO #12:  Validate Readers Name field from Readers Registration window

BVA SIZE for Readers Name from Readers Registration window
Min
1
Alphabets
Valid
Min -1
Blank
Alphabets
Invalid
Min +1
2
Alphabets
Valid
Max
256
Alphabets
Valid
Max -1
255
Alphabets
Valid
Max +1
257
Alphabets
Invalid

ECP TYPE for Readers Name from Readers Registration window
VALID
INVALID
·         ([A-Z]+[\s]?){1,}
·         [a-z0-9]
·         [^\s]
·         Blank Field

TEST SCENARIO #13:  Validate Readers age field from Readers Registration window

BVA SIZE for Readers Age from Readers Registration window
Min
16
Digits
Valid
Min -1
15
Digits
Invalid
Min +1
17
Digits
Valid
Max
60
Digits
Valid
Max -1
59
Digits
Valid
Max +1
61
Digits
Invalid

ECP RANGE for Readers Age from Readers Registration window
VALID
INVALID
·         (([1][6-9])|([2-5][0-9])|([6][0]))
·         [A-Za-z]
·         Special Characters
·         Blank Field
TEST SCENARIO #14:  Validate Readers Address fields from Readers Registration window

BVA SIZE for Readers Address from Readers Registration window
Min
1
Alphanumeric
Valid
Min -1
Blank
Alphanumeric
Invalid
Min +1
2
Alphanumeric
Valid
Max
256
Alphanumeric
Valid
Max -1
255
Alphanumeric
Valid
Max +1
257
Alphanumeric
Invalid


ECP TYPE for Readers Address from Readers Registration window
VALID
INVALID
·         ([A-Za-z0-9/-,]+[\s]?){1,}
·         [^/-,\s]
·         Blank Field


TEST SCENARIO #15:  Validate Telephone number field in India from Readers Registration window

BVA SIZE for Telephone Number from Readers Registration window
Min
10
Digits
Valid
Min -1
9
Digits
Invalid
Min +1
11
Digits
Valid
Max
12
Digits
Valid
Max -1
11
Digits
Valid
Max +1
13
Digits
Invalid


ECP TYPE for Telephone Number from Readers Registration window
VALID
INVALID
·         [0-9]{10,12}
·         [a-bA-Z]
·         Special Characters
·         Blank Field


TEST SCENARIO #16:  Validate Email ID field from Readers Registration window

BVA SIZE for Email ID from Readers Registration window
Min
7
Positions
Valid
Min -1
6
Positions
Invalid
Min +1
8
Positions
Valid
Max
256
Positions
Valid
Max -1
255
Positions
Valid
Max +1
257
Positions
Invalid

ECP TYPE for Email ID from Readers Registration window
VALID
INVALID
·         [.\.] or ([A-Za-b0-9_\.]+[@][A-Za-z0-9]+[\.][A-Za-z]{2,4}[\.][A-Za-b]{2,3}){0,1}

·         [^@_\.-]
·         Special Characters
·         Blank Field


TEST SCENARIO #17:  Validate Readers ID function by clicking Registration button from Readers Registration window

DT for OA for Readers ID function from Readers Registration Window
Fields
Expect Output by clicking Registration Button
·         All fields valid
·         Any field invalid
·         Any field blank

·         Readers ID returned
·         Error message
·         Error message



TEST SCENARIO #18:  Validate Readers ID format after successful registration

BVA SIZE for Readers ID
Min=Max
16
Positions
Valid
Min -1
15
Positions
Invalid
Min +1
17
Positions
Invalid


ECP TYPE for ID format
VALID
INVALID
·         ([L][M][S][_]([0][1-9]|[1][0-2])[_][0-9]{2}[_][0-9]{6})
·         [^LMS]
·         [a-z]
·         [^_]
·         Blank Field
·         Duplicate


TEST SCENARIO #19:  Validate Back button operation by clicking from Readers registration window

DT for Back button function from Readers Registration Window
Fields
Expect Output by clicking Back Button
·         All fields filled
·         Some fields filled
·         No fields filled
·         After getting Readers ID
·         After getting error message

·         Options window focused
·         Options window focused
·         Options window focused
·         Options window focused

·         Options window focused



2 comments: