Sie sind auf Seite 1von 5

Task 1: Evaluating white-box testing techniques

Scenario
As a software test engineer in an organization, you need to test a program that validates user passwords.

Exercise
Your assignment for this task is to carry out the instructions in the Steps list. Steps list Number Instructions When testing the application that validates passwords, you need to remember that the password

should be longer than 6 and less than 32 letters should contain at least one lower-case letter, at least one upper-case letter, and at least one number

The pseudocode for the program that validates password is

has_upper = 0 has_lower = 0 has_number = 0

READ password

IF NOT PASSWORD.IS_STRING THEN RETURN FALSE ENDIF

Number

Steps list Instructions


IF password.LENGTH < 6 OR password.LENGTH > 32 THEN RETURN FALSE ENDIF

FOR EACH character IN password DO IF character.IS_LETTER THEN IF character.IS_UPPER THEN has_upper = 1 ELSE IF character.IS_LOWER THEN has_lower = 1 ELSE RETURN FALSE ENDIF ELSE IF character.IS_NUMBER THEN has_number = 1 ELSE RETURN FALSE ENDIF ENDFOR

Number
1 THEN RETURN TRUE ELSE RETURN FALSE ENDIF

Steps list Instructions


IF has_upper = 1 AND has_lower = 1 AND has_number =

ENDFUNCTION

Create a test case to achieve 100% statement coverage. Create a test case for the program that validates user password. The test should ensure maximum decision coverage. The code for the program is the same as the code for the previous task.

Review your solution and, when you are satisfied with it, open the solution page.
Solution:

Solution
The model solution to this task is given in the Analysis section that follows. You can use the Print feature at the top of the page to create a hard copy.

Analysis
The solution for the task is analyzed in the following table. Checkpoints Instructions You create a test case so that it looks like this: Test Case ID: T1 1 Test Case Name: Statement coverage Description: The length of the password should be greater

Task

Task

Checkpoints Instructions than 6 and less than 32 and the password should contain at least one upper-case letter, one lower-case letter, and at least one number. Refer to Table Test case 1 - Statement coverage You create a test case so that it looks like this: Test Case ID: T2 Test Case Name: Decision coverage

Description: The length of the password should be greater than 6 and less than 32 and the password should contain at least one upper-case letter, one lower-case letter, and at least one number.

Refer to Table Test case 2 - Decision coverage Test case 1 - Statement coverage Task Expected Task No. Test data description result Log in to the application User should be 1 Enter user PassWord123 able to log in. name Enter password Log in to the application 2 Enter user name Enter password Log in to the application 3 Enter user name Enter password Log in to the application 4 Enter user name @!@#$$##$%%^ PasWd User should not be able to log in. 12345678900

Actual Status result User should be able PASS to log in.

User should not be able to log in.

User should not be able to log in. User should not be able to log in.

FAIL

FAIL

User should not be able to log in.

User should not be able to

FAIL

Task Enter password Note:


Checkpoints Instructions log in.

The test data for Task 1 can be replaced with any combination of upper-case letters, lower-case letters, and numbers. This is sample data. You can use any numbers from 0 through 9 to instead of the test data for Task 2. This is sample data. The test data for Task 3 can be replaced with any combination of upper-case letters and lower-case letters. The test data for Task 4 can be replaced with any special characters. Test case 2 - Decision coverage

Task Task description No. Log in to the application 1 Enter user name Enter password Log in to the application 2 Enter user name Enter password Note:

Test data

Expected result

Actual result

Status

PassWord123

User should be able User should be to log in. able to log in.

PASS

@!@#$$##$%%^

User should not be able to log in.

User should not be FAIL able to log in.

The test data for Task 1 can be replaced with any combination of upper-case letters, lower-case letters, and numbers. This is sample data. You can replace the test data for Task 2 with any special character.

If you'd like to review the scenario and assignment for this task, return to the task page. To return to the previous task, click Back. To advance to the next task, click Forward.

Das könnte Ihnen auch gefallen