SlideShare a Scribd company logo
1 of 12
Congratulations!! You have been selected to create a banking
simulator. After meeting with the clients, you have agreed on
requirements and even have developed a basic design of the
program. Basically, the software must be able to create
accounts, deposit, withdraw, and transfer funds, and deal with
fees, interest, etc.
You have decided to embrace Test-Driven Development (TTD)
for this project. This means that, now that the requirements and
design have been developed, the next step is to design unit tests
for all the classes identified in the design. (Normally you might
develop the tests at the same time as starting the
implementation, but for this project, we are only developing
unit tests.)
View the UML class diagram for the bank simulation. (You can
learn about UML from the class resources.)
Requirements:
In this project, you will be given a list of classes and their
public methods, for a simple (not realistic) banking simulation
program. Your group's task is to create a thorough set of unit
tests. In order to run your tests, you will skeleton classes with
stub methods; you should not attempt to actually create a
banking simulation program! To save time, I have provided a
Zip file with the skeleton classes. You should probably add all
those, and a package for your unit tests, before your initial
commit.
Download BankSimSkeleton.zip.
Since there is no real code to test (only stub methods), it is
expected that all your tests will fail. Keep in mind you are only
to create unit tests, not a working program.
Naturally a real banking system needs persistent data (CRUD)
to hold account data between runs of the program and many
other features. Normally you would need to test that
functionality as well. To keep this project simple, no
persistence classes or methods need to be tested, and are not
mentioned in this project's requirements. No exception handling
is included in this project either.
In other words, this simulation is not terribly realistic. (As a
matter of fact, it is not a great design either!) For a first project
where you must create unit tests in a group, it should be
complex enough as is. Keep in mind the requirements for testing
on financial software is high, so be sure to have sufficient tests
for the simulator (and not just a few “happy path” tests).
Note that of the six classes shown, some may not have any
methods except trivial ones, and thus do not require any unit
tests. Some of the methods shown might be considered trivial by
your team; you shouldn't include tests for those either.
Additionally, some methods cannot be tested easily using JUnit,
such as methods that display a GUI. Don't try to test such
methods, although some of them are shown in the requirements.
Testing such functionality requires advanced tools and
techniques, such as GUI testers and a mocking framework (e.g.,
Mockito).
I have also omitted nearly all getters and setters, toString,
compareTo, clone, and other such methods from the
requirements, but of course a real program must have them as
needed. You can actually see those methods in the skeleton
classes, for example the “Account.getBalance()” method. In
general, such methods are trivial to implement and do not need
unit tests, although it is likely you will need to use getters and
possibly setters in your unit test methods. However, if your
team feels any of those methods merit a unit test, add
appropriate unit tests for them. (It isn't as if adding additional
tests is ever a bad thing, just that often it's a waste of time.)
The Classes to Test:
For the initial version, we can find many candidate classes but
in the end only a few are needed to meet the requirements for a
simple banking simulation. These classes and their more
important methods are described below. Note all classes are in
the package banking.
Take some time to example these classes and their methods. See
how they can be used in your tests. For example, to create a
SavingsAcccount to test you need to create a Customer first,
since the only method to create accounts is
Customer.addSavingsAccount. Similarly, you will need a Bank
object to create a Customer.
Class Bank
Class Bank is responsible for the main method, managing
customers, and keeping track of various fees and interest rates;
only the fees and rates have setter methods (only one shown in
the class diagram).
Bank ( name )
Creates a new Bank object with the given name
static void main ( String[] args )
Handles initialization tasks (such as persistence, if that was
implemented in this project, which it is not)
void addCustomerGUI ()
Add a new customer to the bank, using a GUI
String addCustomer ( String lastName, String firstName )
Add a new customer to the bank; return the customer's ID
Customer getCustomer ( String customerId )
Get a Customer object, given a customer's ID
List getCustomer ( String lastName, String firstName )
Get a List of Customer objects, given a customer's last and first
names. (In general there may be multiple customers with the
same names; for testing, assume customer names are unique.)
SortedSet getAllCustomers ()
Generates a report of all current customers, in customer ID
order, and returns a SortedSet of customers
void removeCustomer ( String customerId )
Deletes a customer from the bank. (In reality, just marks the
customer as non-current.)
SortedSet getAllAccounts ()
Generates a report of all current accounts by all customers, in
account ID order, and return a Sorted Set of accounts
Getters, setters, toString, and other methods as needed
You need to test any non-trivial methods your group decides are
a good idea.
Class Customer
Class Customer is responsible for managing a customer's
details, including that customer's accounts. Fields include a
reference to the owning bank, a unique customer ID, Customer's
first and last names, and a SortedSet of transactions (not a List
for no particular reason). Only the customer's name fields have
setters.
Customer( String lastName, String firstName )
Creates a new Customer object from a name. Note for this
project, we assume names are unique.
SavingsAccount addSavingsAccount ( double initBal, String
description )
Creates and returns new savings account, with the specified
initial balance and account description
Account getAccount ( String accountId )
Returns an Account with the given account ID, or null if no
such account
SortedSet getCustomerAccounts()
Returns a read-only SortedSet of the customer's active accounts
(if any)
void removeAccount ( String accountId )
Removes an Account with the given account ID; in a real
program, you don't delete info, just mark it deleted.
double YtdFees ()
the total fees paid by this customer for year-to-date
double YtdInterest ()
Returns the total interest paid to this customer for year-to-date
Getters, setters, toString, and other methods as needed
You need to test any non-trivial methods your group decides are
a good idea.
abstract class Account
Class Account is responsible for managing the details of any
type of account, including an accountId, customerId,
description, account creation date, the current balance, and the
account's transaction list. Only the account description has a
setter.
Account ( Customer cust, double initBal, String description )
Constructor for abstract class, taking a customer, initial
balance, and an account description.
abstract void deposit ( double amount )
Add money into account
abstract void withdraw ( double amount )
remove money from account
static void transfer ( Account fromAccount, Account toAccount,
double amount )
Transfer funds between two accounts of a single customer.
List getTransactions ()
Returns a List of all transactions for this account.
Transaction getTransaction ( int transactionId )
Returns the specified transaction.
Getters, setters, toString, and other methods as needed
(For example, getBalance.) You need to test any non-trivial
methods your group decides are a good idea.
class SavingsAccount extends Account
Class SavingsAccount is an Account, but includes monthly
interest payments. A field defaultInterestRate holds the
assigned monthly interest rate, and has both a setter and a
getter.
SavingsAccount ( double initialBalance, String customerId,
String description )
Create a new savings account with the specified initial balance,
for the specified customer, and with the given account
description
void addInterest ()
Adds a transaction "INTEREST PAYMENT" based on this
account's monthly interest rate.
Getters, setters, toString, and other methods as needed
You need to test any non-trivial methods your group decides are
a good idea.
class Transaction implements Comparable
Class Transaction objects represent any deposit, withdrawal, or
other transaction on an account. (Note transfers are
implemented as a pair of transactions.) This class contains files
for a transaction ID, a timestamp (the date and time of the
transaction), the type of transaction, the amount, and a
description. None of these fields have setters.
Transaction(TransactionType type, double amount, String
description)
Create a new transaction
Getters, setters, (for example, to get and possibly set the id,
transaction timestamp, type, amount, and description), toString,
and other methods as needed
You need to test any non-trivial methods your group decides are
a good idea.
enum TransactionType
Enum TransactionType lists all possible transaction types:
DEPOSIT, WITHDRAWAL, INTEREST, CHECK, FEE,
PENALTY, and ADJUSTMENT.
Potential Changes (Requirements not part of the provided RFP):
To be determined, but there are sure to be lots of them.
Project Procedure:
You will need to create skeleton classes with stub methods for
all classes and methods in the design. (A Zip with the skeletons
is provided for you, as a starting point.) They should compile
and run, but do nothing. Do not implement any methods!
Once you have created that skeleton (it shouldn't take long),
you can write and then run the JUnit tests. Naturally, it is
expected that all the tests will fail, since the stub methods don't
do what they are supposed to do. While developing tests, you
may decide additional classes and/or methods are needed. If so,
include skeletons/stubs for those as well. Do not forget to
include any such design documents (if you change or add to the
design) in your projects documentation
A great way to proceed is propose tests for everything, and then
you can merge the best ideas of those. (If you don't do that,
design the tests for each public class member.) In addition to
producing a list of tests, you should also document which
methods you have decided not to test, and state why. (Not
necessary for missing getters, setters, toString, etc.)
Hints:
In this project, I will be grading the quality and thoroughness of
your unit tests, and the quality of the accompanying
documentation (which methods you didn't feel it necessary to
test, as described above). I will also be checking if you have
tests you shouldn't, such as a Getter method that does only
“return value;”. You should review the Testing resources
provided on the class web page, which include the testing
lecture notes, links to JUnit API and other documentation, and
examples and demos.
Short JUnit Refresher:
With JUnit, you use the methods of the class org.junit.Assert,
such as assertEquals or assertFalse, inside of test methods
which are marked with the “@Test” annotation. These test
methods, along with other methods and fields, are part of a class
known as a test suite.
For example, for the scoreDetail method, your test might look
something like this:
public class MyTestSuite {
@Test
public void testScoreDetailLegalInput () {
final int[] correctScores = { ... };
final Round r = new Round( ...);
int [] scores = r.scoreDetail();
assertNotNull( scores );
assertArrayEquals( correctScores, scores );
}
}
That is just one test case, with a single legal Round object. It is
likely your tests will need many Round or other objects, so you
should check into creating a test fixture. A test fixture is simply
one or more methods that get called prior to each test method's
invocation. Such methods can reset (or initialize) various fields
in your test suite, so each test starts with a clean slate. In this
case, you could create a method that sets up some objects for
you:
public class MyTestSuite {
private List courseList;
private Round legalRound1;
private int [] legalRound1CorrectScores;
private Round badRound;
...
@Before
public void init () {
courseList = ...;
legalRound = ....;
legalRound1CorrectScores = { ... };
badRound = ....;
...
}
@Test
public void testScoreDetailLegalInput1 () {
int [] scores = legalRound1.scoreDetail();
assertNotNull( scores );
assertArrayEquals( legalRound1CorrectScores, scores );
}
@Test
public void testScoreDetailBoundryValues1 () {
...
}
...
}
Methods marked with @Before all get called before every
@Test method does, every time. You can also create @After
methods, to cleanup stuff. (You can also have static methods
marked with “@BeforeClass”, which get run once at the start of
a test run. You could use that to re-create a sample file, setup a
database, or start some server program.)
Remember that both Eclipse and NetBeans have wizards to
create test suites (Eclipse uses the term Test Case for the class).
The hard part is to come up with a good set of tests. You want
confidence that if all the tests pass, the code being tested
correctly implements the design.

More Related Content

Similar to Congratulations!! You have been selected to create a banking simulat.docx

Insert Your Name and ClassIT Online Training (ITOT) Analys.docx
Insert Your Name and ClassIT Online Training (ITOT) Analys.docxInsert Your Name and ClassIT Online Training (ITOT) Analys.docx
Insert Your Name and ClassIT Online Training (ITOT) Analys.docxcarliotwaycave
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptxanguraju1
 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modelingShahid Riaz
 
2Jubail University CollegeDepartment of Business Adm.docx
2Jubail University CollegeDepartment of Business Adm.docx2Jubail University CollegeDepartment of Business Adm.docx
2Jubail University CollegeDepartment of Business Adm.docxlorainedeserre
 
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9i
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9iCUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9i
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9iAkash Gupta
 
Bco1102 case study project report
Bco1102 case study project reportBco1102 case study project report
Bco1102 case study project reportOzPaperHelp3
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfmallik3000
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxruthannemcmullen
 
Advance sql - window functions patterns and tricks
Advance sql - window functions patterns and tricksAdvance sql - window functions patterns and tricks
Advance sql - window functions patterns and tricksEyal Trabelsi
 
Quality management for dummies
Quality management for dummiesQuality management for dummies
Quality management for dummiesselinasimpson2501
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxgilpinleeanna
 
The Three Essential Process Layers - New York Business Process Professionals ...
The Three Essential Process Layers - New York Business Process Professionals ...The Three Essential Process Layers - New York Business Process Professionals ...
The Three Essential Process Layers - New York Business Process Professionals ...Samuel Chin, PMP, CSM
 
Data ware dimension design
Data ware   dimension designData ware   dimension design
Data ware dimension designSayed Ahmed
 
Data ware dimension design
Data ware   dimension designData ware   dimension design
Data ware dimension designSayed Ahmed
 
2020 Updated Microsoft MB-200 Questions and Answers
2020 Updated Microsoft MB-200 Questions and Answers2020 Updated Microsoft MB-200 Questions and Answers
2020 Updated Microsoft MB-200 Questions and Answersdouglascarnicelli
 
Ashish Kumar Prajapati
Ashish Kumar PrajapatiAshish Kumar Prajapati
Ashish Kumar PrajapatiAshish kumar
 
BIS09 Application Development - III
BIS09 Application Development - IIIBIS09 Application Development - III
BIS09 Application Development - IIIPrithwis Mukerjee
 

Similar to Congratulations!! You have been selected to create a banking simulat.docx (20)

Insert Your Name and ClassIT Online Training (ITOT) Analys.docx
Insert Your Name and ClassIT Online Training (ITOT) Analys.docxInsert Your Name and ClassIT Online Training (ITOT) Analys.docx
Insert Your Name and ClassIT Online Training (ITOT) Analys.docx
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptx
 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modeling
 
2Jubail University CollegeDepartment of Business Adm.docx
2Jubail University CollegeDepartment of Business Adm.docx2Jubail University CollegeDepartment of Business Adm.docx
2Jubail University CollegeDepartment of Business Adm.docx
 
Uml doc
Uml docUml doc
Uml doc
 
Spreadsheet Auditing
Spreadsheet  AuditingSpreadsheet  Auditing
Spreadsheet Auditing
 
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9i
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9iCUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9i
CUSTOMER CARE ADMINISTRATION-developer-2000 and oracle 9i
 
Bco1102 case study project report
Bco1102 case study project reportBco1102 case study project report
Bco1102 case study project report
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdf
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
 
Shop management system
Shop management systemShop management system
Shop management system
 
Advance sql - window functions patterns and tricks
Advance sql - window functions patterns and tricksAdvance sql - window functions patterns and tricks
Advance sql - window functions patterns and tricks
 
Quality management for dummies
Quality management for dummiesQuality management for dummies
Quality management for dummies
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
 
The Three Essential Process Layers - New York Business Process Professionals ...
The Three Essential Process Layers - New York Business Process Professionals ...The Three Essential Process Layers - New York Business Process Professionals ...
The Three Essential Process Layers - New York Business Process Professionals ...
 
Data ware dimension design
Data ware   dimension designData ware   dimension design
Data ware dimension design
 
Data ware dimension design
Data ware   dimension designData ware   dimension design
Data ware dimension design
 
2020 Updated Microsoft MB-200 Questions and Answers
2020 Updated Microsoft MB-200 Questions and Answers2020 Updated Microsoft MB-200 Questions and Answers
2020 Updated Microsoft MB-200 Questions and Answers
 
Ashish Kumar Prajapati
Ashish Kumar PrajapatiAshish Kumar Prajapati
Ashish Kumar Prajapati
 
BIS09 Application Development - III
BIS09 Application Development - IIIBIS09 Application Development - III
BIS09 Application Development - III
 

More from breaksdayle

Use up-to-date credible references1.Discuss the benefits and.docx
Use up-to-date credible references1.Discuss the benefits and.docxUse up-to-date credible references1.Discuss the benefits and.docx
Use up-to-date credible references1.Discuss the benefits and.docxbreaksdayle
 
Use your imagination to develop your own data visualization that dis.docx
Use your imagination to develop your own data visualization that dis.docxUse your imagination to develop your own data visualization that dis.docx
Use your imagination to develop your own data visualization that dis.docxbreaksdayle
 
Use your Library to research and explain the relationship between as.docx
Use your Library to research and explain the relationship between as.docxUse your Library to research and explain the relationship between as.docx
Use your Library to research and explain the relationship between as.docxbreaksdayle
 
Use your needs assessment results toDevelop three to five learnin.docx
Use your needs assessment results toDevelop three to five learnin.docxUse your needs assessment results toDevelop three to five learnin.docx
Use your needs assessment results toDevelop three to five learnin.docxbreaksdayle
 
Uses of Information TechnologyHow could a business use informa.docx
Uses of Information TechnologyHow could a business use informa.docxUses of Information TechnologyHow could a business use informa.docx
Uses of Information TechnologyHow could a business use informa.docxbreaksdayle
 
Using a minimum of 150 words, address the following What did fr.docx
Using a minimum of 150 words, address the following What did fr.docxUsing a minimum of 150 words, address the following What did fr.docx
Using a minimum of 150 words, address the following What did fr.docxbreaksdayle
 
Use thisdiscussion sampleas a guide when completing your own.docx
Use thisdiscussion sampleas a guide when completing your own.docxUse thisdiscussion sampleas a guide when completing your own.docx
Use thisdiscussion sampleas a guide when completing your own.docxbreaksdayle
 
Use your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docxUse your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docxbreaksdayle
 
Use this link to complete httpneave.complanetarium It is a v.docx
Use this link to complete httpneave.complanetarium It is a v.docxUse this link to complete httpneave.complanetarium It is a v.docx
Use this link to complete httpneave.complanetarium It is a v.docxbreaksdayle
 
Use the video Twelve Angry Men” as a case study and analyze how inf.docx
Use the video Twelve Angry Men” as a case study and analyze how inf.docxUse the video Twelve Angry Men” as a case study and analyze how inf.docx
Use the video Twelve Angry Men” as a case study and analyze how inf.docxbreaksdayle
 
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docx
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docxUSE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docx
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docxbreaksdayle
 
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docx
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docxUSE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docx
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docxbreaksdayle
 
Use the Internet  to research three trends in HR. Next, examine the .docx
Use the Internet  to research three trends in HR. Next, examine the .docxUse the Internet  to research three trends in HR. Next, examine the .docx
Use the Internet  to research three trends in HR. Next, examine the .docxbreaksdayle
 
Use the Internet to find the corruption perception index for various.docx
Use the Internet to find the corruption perception index for various.docxUse the Internet to find the corruption perception index for various.docx
Use the Internet to find the corruption perception index for various.docxbreaksdayle
 
Use the Internet to find a post of your interest regarding a social .docx
Use the Internet to find a post of your interest regarding a social .docxUse the Internet to find a post of your interest regarding a social .docx
Use the Internet to find a post of your interest regarding a social .docxbreaksdayle
 
Use the publicly-traded company you chose in M1 Assignment 3 and.docx
Use the publicly-traded company you chose in M1 Assignment 3 and.docxUse the publicly-traded company you chose in M1 Assignment 3 and.docx
Use the publicly-traded company you chose in M1 Assignment 3 and.docxbreaksdayle
 
Use the Internet to research a company in your local area that sells.docx
Use the Internet to research a company in your local area that sells.docxUse the Internet to research a company in your local area that sells.docx
Use the Internet to research a company in your local area that sells.docxbreaksdayle
 
Use the Hispanic as acultural group in creating a cultural a.docx
Use the Hispanic as acultural group in creating a cultural a.docxUse the Hispanic as acultural group in creating a cultural a.docx
Use the Hispanic as acultural group in creating a cultural a.docxbreaksdayle
 
Use SQL to Create a table with at least 4 attributes one of which is.docx
Use SQL to Create a table with at least 4 attributes one of which is.docxUse SQL to Create a table with at least 4 attributes one of which is.docx
Use SQL to Create a table with at least 4 attributes one of which is.docxbreaksdayle
 
Use the Behaviors and Consequences document to do the following.docx
Use the Behaviors and Consequences document to do the following.docxUse the Behaviors and Consequences document to do the following.docx
Use the Behaviors and Consequences document to do the following.docxbreaksdayle
 

More from breaksdayle (20)

Use up-to-date credible references1.Discuss the benefits and.docx
Use up-to-date credible references1.Discuss the benefits and.docxUse up-to-date credible references1.Discuss the benefits and.docx
Use up-to-date credible references1.Discuss the benefits and.docx
 
Use your imagination to develop your own data visualization that dis.docx
Use your imagination to develop your own data visualization that dis.docxUse your imagination to develop your own data visualization that dis.docx
Use your imagination to develop your own data visualization that dis.docx
 
Use your Library to research and explain the relationship between as.docx
Use your Library to research and explain the relationship between as.docxUse your Library to research and explain the relationship between as.docx
Use your Library to research and explain the relationship between as.docx
 
Use your needs assessment results toDevelop three to five learnin.docx
Use your needs assessment results toDevelop three to five learnin.docxUse your needs assessment results toDevelop three to five learnin.docx
Use your needs assessment results toDevelop three to five learnin.docx
 
Uses of Information TechnologyHow could a business use informa.docx
Uses of Information TechnologyHow could a business use informa.docxUses of Information TechnologyHow could a business use informa.docx
Uses of Information TechnologyHow could a business use informa.docx
 
Using a minimum of 150 words, address the following What did fr.docx
Using a minimum of 150 words, address the following What did fr.docxUsing a minimum of 150 words, address the following What did fr.docx
Using a minimum of 150 words, address the following What did fr.docx
 
Use thisdiscussion sampleas a guide when completing your own.docx
Use thisdiscussion sampleas a guide when completing your own.docxUse thisdiscussion sampleas a guide when completing your own.docx
Use thisdiscussion sampleas a guide when completing your own.docx
 
Use your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docxUse your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docx
 
Use this link to complete httpneave.complanetarium It is a v.docx
Use this link to complete httpneave.complanetarium It is a v.docxUse this link to complete httpneave.complanetarium It is a v.docx
Use this link to complete httpneave.complanetarium It is a v.docx
 
Use the video Twelve Angry Men” as a case study and analyze how inf.docx
Use the video Twelve Angry Men” as a case study and analyze how inf.docxUse the video Twelve Angry Men” as a case study and analyze how inf.docx
Use the video Twelve Angry Men” as a case study and analyze how inf.docx
 
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docx
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docxUSE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docx
USE THESE LINKS ANDOR BOOKhttpsplato.stanford.eduentriesp.docx
 
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docx
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docxUSE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docx
USE THE UPLOADED READING IN ORDER TO FINISH THIS ASSIGNMENT.Usin.docx
 
Use the Internet  to research three trends in HR. Next, examine the .docx
Use the Internet  to research three trends in HR. Next, examine the .docxUse the Internet  to research three trends in HR. Next, examine the .docx
Use the Internet  to research three trends in HR. Next, examine the .docx
 
Use the Internet to find the corruption perception index for various.docx
Use the Internet to find the corruption perception index for various.docxUse the Internet to find the corruption perception index for various.docx
Use the Internet to find the corruption perception index for various.docx
 
Use the Internet to find a post of your interest regarding a social .docx
Use the Internet to find a post of your interest regarding a social .docxUse the Internet to find a post of your interest regarding a social .docx
Use the Internet to find a post of your interest regarding a social .docx
 
Use the publicly-traded company you chose in M1 Assignment 3 and.docx
Use the publicly-traded company you chose in M1 Assignment 3 and.docxUse the publicly-traded company you chose in M1 Assignment 3 and.docx
Use the publicly-traded company you chose in M1 Assignment 3 and.docx
 
Use the Internet to research a company in your local area that sells.docx
Use the Internet to research a company in your local area that sells.docxUse the Internet to research a company in your local area that sells.docx
Use the Internet to research a company in your local area that sells.docx
 
Use the Hispanic as acultural group in creating a cultural a.docx
Use the Hispanic as acultural group in creating a cultural a.docxUse the Hispanic as acultural group in creating a cultural a.docx
Use the Hispanic as acultural group in creating a cultural a.docx
 
Use SQL to Create a table with at least 4 attributes one of which is.docx
Use SQL to Create a table with at least 4 attributes one of which is.docxUse SQL to Create a table with at least 4 attributes one of which is.docx
Use SQL to Create a table with at least 4 attributes one of which is.docx
 
Use the Behaviors and Consequences document to do the following.docx
Use the Behaviors and Consequences document to do the following.docxUse the Behaviors and Consequences document to do the following.docx
Use the Behaviors and Consequences document to do the following.docx
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Congratulations!! You have been selected to create a banking simulat.docx

  • 1. Congratulations!! You have been selected to create a banking simulator. After meeting with the clients, you have agreed on requirements and even have developed a basic design of the program. Basically, the software must be able to create accounts, deposit, withdraw, and transfer funds, and deal with fees, interest, etc. You have decided to embrace Test-Driven Development (TTD) for this project. This means that, now that the requirements and design have been developed, the next step is to design unit tests for all the classes identified in the design. (Normally you might develop the tests at the same time as starting the implementation, but for this project, we are only developing unit tests.) View the UML class diagram for the bank simulation. (You can learn about UML from the class resources.) Requirements: In this project, you will be given a list of classes and their public methods, for a simple (not realistic) banking simulation program. Your group's task is to create a thorough set of unit tests. In order to run your tests, you will skeleton classes with stub methods; you should not attempt to actually create a banking simulation program! To save time, I have provided a Zip file with the skeleton classes. You should probably add all those, and a package for your unit tests, before your initial commit. Download BankSimSkeleton.zip. Since there is no real code to test (only stub methods), it is expected that all your tests will fail. Keep in mind you are only to create unit tests, not a working program.
  • 2. Naturally a real banking system needs persistent data (CRUD) to hold account data between runs of the program and many other features. Normally you would need to test that functionality as well. To keep this project simple, no persistence classes or methods need to be tested, and are not mentioned in this project's requirements. No exception handling is included in this project either. In other words, this simulation is not terribly realistic. (As a matter of fact, it is not a great design either!) For a first project where you must create unit tests in a group, it should be complex enough as is. Keep in mind the requirements for testing on financial software is high, so be sure to have sufficient tests for the simulator (and not just a few “happy path” tests). Note that of the six classes shown, some may not have any methods except trivial ones, and thus do not require any unit tests. Some of the methods shown might be considered trivial by your team; you shouldn't include tests for those either. Additionally, some methods cannot be tested easily using JUnit, such as methods that display a GUI. Don't try to test such methods, although some of them are shown in the requirements. Testing such functionality requires advanced tools and techniques, such as GUI testers and a mocking framework (e.g., Mockito). I have also omitted nearly all getters and setters, toString, compareTo, clone, and other such methods from the requirements, but of course a real program must have them as needed. You can actually see those methods in the skeleton classes, for example the “Account.getBalance()” method. In general, such methods are trivial to implement and do not need unit tests, although it is likely you will need to use getters and possibly setters in your unit test methods. However, if your team feels any of those methods merit a unit test, add
  • 3. appropriate unit tests for them. (It isn't as if adding additional tests is ever a bad thing, just that often it's a waste of time.) The Classes to Test: For the initial version, we can find many candidate classes but in the end only a few are needed to meet the requirements for a simple banking simulation. These classes and their more important methods are described below. Note all classes are in the package banking. Take some time to example these classes and their methods. See how they can be used in your tests. For example, to create a SavingsAcccount to test you need to create a Customer first, since the only method to create accounts is Customer.addSavingsAccount. Similarly, you will need a Bank object to create a Customer. Class Bank Class Bank is responsible for the main method, managing customers, and keeping track of various fees and interest rates; only the fees and rates have setter methods (only one shown in the class diagram). Bank ( name ) Creates a new Bank object with the given name static void main ( String[] args ) Handles initialization tasks (such as persistence, if that was implemented in this project, which it is not) void addCustomerGUI ()
  • 4. Add a new customer to the bank, using a GUI String addCustomer ( String lastName, String firstName ) Add a new customer to the bank; return the customer's ID Customer getCustomer ( String customerId ) Get a Customer object, given a customer's ID List getCustomer ( String lastName, String firstName ) Get a List of Customer objects, given a customer's last and first names. (In general there may be multiple customers with the same names; for testing, assume customer names are unique.) SortedSet getAllCustomers () Generates a report of all current customers, in customer ID order, and returns a SortedSet of customers void removeCustomer ( String customerId ) Deletes a customer from the bank. (In reality, just marks the customer as non-current.) SortedSet getAllAccounts () Generates a report of all current accounts by all customers, in account ID order, and return a Sorted Set of accounts Getters, setters, toString, and other methods as needed You need to test any non-trivial methods your group decides are a good idea.
  • 5. Class Customer Class Customer is responsible for managing a customer's details, including that customer's accounts. Fields include a reference to the owning bank, a unique customer ID, Customer's first and last names, and a SortedSet of transactions (not a List for no particular reason). Only the customer's name fields have setters. Customer( String lastName, String firstName ) Creates a new Customer object from a name. Note for this project, we assume names are unique. SavingsAccount addSavingsAccount ( double initBal, String description ) Creates and returns new savings account, with the specified initial balance and account description Account getAccount ( String accountId ) Returns an Account with the given account ID, or null if no such account SortedSet getCustomerAccounts() Returns a read-only SortedSet of the customer's active accounts (if any) void removeAccount ( String accountId ) Removes an Account with the given account ID; in a real program, you don't delete info, just mark it deleted. double YtdFees ()
  • 6. the total fees paid by this customer for year-to-date double YtdInterest () Returns the total interest paid to this customer for year-to-date Getters, setters, toString, and other methods as needed You need to test any non-trivial methods your group decides are a good idea. abstract class Account Class Account is responsible for managing the details of any type of account, including an accountId, customerId, description, account creation date, the current balance, and the account's transaction list. Only the account description has a setter. Account ( Customer cust, double initBal, String description ) Constructor for abstract class, taking a customer, initial balance, and an account description. abstract void deposit ( double amount ) Add money into account abstract void withdraw ( double amount ) remove money from account static void transfer ( Account fromAccount, Account toAccount, double amount )
  • 7. Transfer funds between two accounts of a single customer. List getTransactions () Returns a List of all transactions for this account. Transaction getTransaction ( int transactionId ) Returns the specified transaction. Getters, setters, toString, and other methods as needed (For example, getBalance.) You need to test any non-trivial methods your group decides are a good idea. class SavingsAccount extends Account Class SavingsAccount is an Account, but includes monthly interest payments. A field defaultInterestRate holds the assigned monthly interest rate, and has both a setter and a getter. SavingsAccount ( double initialBalance, String customerId, String description ) Create a new savings account with the specified initial balance, for the specified customer, and with the given account description void addInterest () Adds a transaction "INTEREST PAYMENT" based on this account's monthly interest rate. Getters, setters, toString, and other methods as needed
  • 8. You need to test any non-trivial methods your group decides are a good idea. class Transaction implements Comparable Class Transaction objects represent any deposit, withdrawal, or other transaction on an account. (Note transfers are implemented as a pair of transactions.) This class contains files for a transaction ID, a timestamp (the date and time of the transaction), the type of transaction, the amount, and a description. None of these fields have setters. Transaction(TransactionType type, double amount, String description) Create a new transaction Getters, setters, (for example, to get and possibly set the id, transaction timestamp, type, amount, and description), toString, and other methods as needed You need to test any non-trivial methods your group decides are a good idea. enum TransactionType Enum TransactionType lists all possible transaction types: DEPOSIT, WITHDRAWAL, INTEREST, CHECK, FEE, PENALTY, and ADJUSTMENT. Potential Changes (Requirements not part of the provided RFP): To be determined, but there are sure to be lots of them. Project Procedure:
  • 9. You will need to create skeleton classes with stub methods for all classes and methods in the design. (A Zip with the skeletons is provided for you, as a starting point.) They should compile and run, but do nothing. Do not implement any methods! Once you have created that skeleton (it shouldn't take long), you can write and then run the JUnit tests. Naturally, it is expected that all the tests will fail, since the stub methods don't do what they are supposed to do. While developing tests, you may decide additional classes and/or methods are needed. If so, include skeletons/stubs for those as well. Do not forget to include any such design documents (if you change or add to the design) in your projects documentation A great way to proceed is propose tests for everything, and then you can merge the best ideas of those. (If you don't do that, design the tests for each public class member.) In addition to producing a list of tests, you should also document which methods you have decided not to test, and state why. (Not necessary for missing getters, setters, toString, etc.) Hints: In this project, I will be grading the quality and thoroughness of your unit tests, and the quality of the accompanying documentation (which methods you didn't feel it necessary to test, as described above). I will also be checking if you have tests you shouldn't, such as a Getter method that does only “return value;”. You should review the Testing resources provided on the class web page, which include the testing lecture notes, links to JUnit API and other documentation, and examples and demos. Short JUnit Refresher: With JUnit, you use the methods of the class org.junit.Assert,
  • 10. such as assertEquals or assertFalse, inside of test methods which are marked with the “@Test” annotation. These test methods, along with other methods and fields, are part of a class known as a test suite. For example, for the scoreDetail method, your test might look something like this: public class MyTestSuite { @Test public void testScoreDetailLegalInput () { final int[] correctScores = { ... }; final Round r = new Round( ...); int [] scores = r.scoreDetail(); assertNotNull( scores ); assertArrayEquals( correctScores, scores ); } } That is just one test case, with a single legal Round object. It is likely your tests will need many Round or other objects, so you should check into creating a test fixture. A test fixture is simply one or more methods that get called prior to each test method's invocation. Such methods can reset (or initialize) various fields in your test suite, so each test starts with a clean slate. In this case, you could create a method that sets up some objects for you:
  • 11. public class MyTestSuite { private List courseList; private Round legalRound1; private int [] legalRound1CorrectScores; private Round badRound; ... @Before public void init () { courseList = ...; legalRound = ....; legalRound1CorrectScores = { ... }; badRound = ....; ... } @Test public void testScoreDetailLegalInput1 () { int [] scores = legalRound1.scoreDetail(); assertNotNull( scores );
  • 12. assertArrayEquals( legalRound1CorrectScores, scores ); } @Test public void testScoreDetailBoundryValues1 () { ... } ... } Methods marked with @Before all get called before every @Test method does, every time. You can also create @After methods, to cleanup stuff. (You can also have static methods marked with “@BeforeClass”, which get run once at the start of a test run. You could use that to re-create a sample file, setup a database, or start some server program.) Remember that both Eclipse and NetBeans have wizards to create test suites (Eclipse uses the term Test Case for the class). The hard part is to come up with a good set of tests. You want confidence that if all the tests pass, the code being tested correctly implements the design.