Assume you have been asked to use Equivalence Partitioning method to check the ATM machine login function regarding to PIN number validation. Here are some detailed requirements: Users must use valid ATM card and enter a correct PIN number to access their accounts. Otherwise, a rejection message will be displayed to them. Here are some specification descriptions relating to a valid PIN number.  Each valid PIN number must be formed with letters (‘a’ to ‘z) and digitals  Each PIN must include at least one up-case letter and one lower-case letter.  Each PIN is acceptable if it includes one special chars from the following list: o !, #, @, $  The length of each valid PIN must be in the range from 8 to 12. Whenever an invalid PIN is entered, one of following messages will be displayed: “Incorrect Password” - This suggests that a PIN (entered by a user) is valid but not correct. “Invalidated Password”- This suggests that a PIN (entered by a user) is invalid. a) Please list your identified equivalence classes when you testing this function, and present them using a table (or a diagram).  b) Based on these equivalence classes identify and present test cases in a table.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Assume you have been asked to use Equivalence Partitioning method to check the ATM machine
login function regarding to PIN number validation. Here are some detailed requirements:
Users must use valid ATM card and enter a correct PIN number to access their accounts. Otherwise, a
rejection message will be displayed to them.
Here are some specification descriptions relating to a valid PIN number.
 Each valid PIN number must be formed with letters (‘a’ to ‘z) and digitals
 Each PIN must include at least one up-case letter and one lower-case letter.
 Each PIN is acceptable if it includes one special chars from the following list:
o !, #, @, $
 The length of each valid PIN must be in the range from 8 to 12.
Whenever an invalid PIN is entered, one of following messages will be displayed:
“Incorrect Password” - This suggests that a PIN (entered by a user) is valid but not correct.
“Invalidated Password”- This suggests that a PIN (entered by a user) is invalid.
a) Please list your identified equivalence classes when you testing this function, and present them using a
table (or a diagram). 
b) Based on these equivalence classes identify and present test cases in a table.

Expert Solution
Step 1

public class Customer {

String customerId;

String customerName;

String atmCardNumber;

String atmPin;

public Customer(String customerId, String customerName, String atmCardNumber, String atmPin){

this.customerId = customerId;

this.customerName = customerName;

this.atmCardNumber = atmCardNumber;

this.atmPin = atmPin;

}

public String getCustomerId() {

return customerId;

}

public void setCustomerId(String customerId) {

this.customerId = customerId;

}

public String getCustomerName() {

return customerName;

}

public void setCustomerName(String customerName) {

this.customerName = customerName;

}

public String getAtmCardNumber() {

return atmCardNumber;

}

public void setAtmCardNumber(String atmCardNumber) {

this.atmCardNumber = atmCardNumber;

}

public String getAtmPin() {

return atmPin;

}

public void setAtmPin(String atmPin) {

this.atmPin = atmPin;

}

}

public class PinValidator {

private String pin;

public PinValidator(String pin){

this.pin = pin;

}

public void validate(){

String regexp = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#?])(?=\\S+$).{6,10}$";

if(pin.matches(regexp))

System.out.println("Login Successful"); else System.out.println("Invalidated Password");

}

}

import java.util.ArrayList;

import java.util.List;

import java.util.Scanner;

public class TestPin {

public static void main(String[] args){

Customer customerOne = new Customer("1", "John", "1234 5678 9812","Hes@322");

// Creating an user base of customers

List<Customer> listOfCustomers = new ArrayList<>();

listOfCustomers.add(customerOne);

// Add more customers to the user base as per requirement

// Can also use a database for maintaining the user base

System.out.println("Enter Card Number: ");

Scanner scannerOne = new Scanner(System.in);

String cardNumber = scannerOne.nextLine();

for(Customer customer : listOfCustomers){

if(customer.getAtmCardNumber().equals(cardNumber)){

System.out.println("Enter PIN: ");

String pin = scannerOne.nextLine();

if(customer.getAtmPin().equals(pin)){

PinValidator pinValidator = new PinValidator(pin);

pinValidator.validate();

break;

}

else{

System.out.println("Incorrect Password");

break;

}

}

else{

System.out.println("Invalid Card Number");

break;

}

}

}

}

The above program validates ATM pins entered by the user.

Here we have three classes - Customer, PinValidator and TestPin.

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY