SE4452A-F16
1
THE UNIVERSITY OF WESTERN ONTARIO
FACULTY OF ENGINEERING SCIENCE
DEPARTMENT OF ELECTRICAL & COMPUTER ENGINEERING
SE4452A
Software Verification and Validation
Fall 2016
Assignments # 2
Due on Nov. 25, 2016
Q1. Review the following
– High level description of Purchase Order application, attached below
– The java script code file ‘purchaseOrder.js’ located located at OWL SE 4452A 001
Resources/Assignments/Assignmnet-2
Then use the required specifications attached below to develop effective functional (black box) unit test
suite for the project to include:
Q1. a. [15%] Equivalence classes testing
Q1. b. [15%] Boundaries values testing
Q1. c. [15%] Decision table testing
Q1. d. Use mocha, jasmine or any other framework to run the test cases for the “purchaseOrder”
code as follows
I. | [45%] provide test case suites code for the above test cases (a, b and c) embedded with appropriate comments and description. [10%] Isolate the unit tests when applicable using stubs. [15% Bonus] Provide the analysis report of the test and fix the errors when applicable. |
II. III. |
SE4452A-F16
2
Purchase Order Requirements Specifications
The main purpose of the system is to assess the qualified status of the purchase orders based on the
client account status, credit status and the product availability as follows.
All orders will be ‘accepted’ with shipping date notification if:
o The client has very good account status
o The client account status and credit status is good
o The client account status below good but have good credit status and the product status is
available.
All orders will be in ‘pending’ status which is accepted but the shipping date is not specified, if
o The client has fair account status, good credit status and the product status limited or sold-out.
o The client has poor account status, good credit status and the product status is limited.
All orders will be ‘under_review’ which the company needs to do some financial reviews for the client, if:
o The client has good account status and credit status is bad.
o The client has fair account status and credit status is bad and the product status is available.
All orders will be ‘rejected’ which the company can’t locate this order, if:
o The client has fair account status; credit status is bad and the product status is limited or sold-out.
o The client has poor account status; credit status is good and the product status is sold-out.
o The client has poor account status and credit status is bad.
The following are the main variables that are used in the product ordering system with their description,
types and cardinalities:
1. The client structured as {accountAge, accountBalance, creditScore}
o accountAge integer >=0 and <=100
o accountBalance integer >=-100 and <=1B
o creditScore integer >=0 and <=800
2. The store structure is array of products {name, quantity}
o name string
o quantity integer >=0 and <=100
3. orderStatus: is the system response to the order request. It is one of the following set:
{‘accepted’, ‘pending’, ‘under_review’, ‘rejected’}
4. accountStatus: is the calculated client’s account status. It is one of the following set: {‘very
good’, ‘good’, ’fair’, ‘poor’}
5. creditStatus: is the calculated client’s credit status. It is one of the following set: {‘good’, ‘bad’}
6. productStatus: reflects the product quantity status. It is one of the following set: {‘sold-out’,
‘limited’, ‘available’}
7. storeThreshold: is the threshold for the limited quantity of the products in the store. It is
Integer >=0 and <=100
8. creditCheckMode is the factor used to determine the creditStatus. It is one of the following set:
{‘restricted’, ‘default’}
SE4452A-F16
3
Figure 1 below depicts the logic architecture of the Purchase Order system.
Figure 1. Purchase Order Logical Architecture
The project includes the following function and requirements:
1. AccountStatus(account)
Generates and returns the status of the client account (AccountStatus) based on accountFactor:
accountFactor = ageFactor * balanceFactor
accountFactor | AccountStatus |
accountFactor <0 | invalid |
accountFactor >=0 and accountFactor <=700 | poor |
accountFactor > 700 and accountFactor <=3000 | fair |
accountFactor > 3000 and accountFactor <=10k | good |
Above 10k | very good |
2. getAgeFactor(account)
It takes the client accountAge and returns the equivalent ageFactor per the following:
accountAge | ageFactor |
Age <0 or Age >100 | -1 |
Age =0 | 1 |
Age >0 and Age<2 | 5 |
Age >=2 and Age<5 | 10 |
Age >=5 and Age<10 | 20 |
Age >=10 and Age<=100 | 50 |
3. getBalanceFactor(account)
It takes the client account balance(accountBalance) and returns the equivalent factor (balanceFactor)
per the following:
accountBalance | balanceFactor |
Balance < -100 or Balance> 1B | -1 |
Balance >= -100 and Balance < =0 | 6 |
Balance > 0 and Balance < 1000 | 16 |
Balance >= 1k and Balance < 50k | 30 |
Balance >= 50k and Balance < 100k | 70 |
Balance >= 100k and Balance <= 1M | 200 |
Balance >1M | 500 |
SE4452A-F16
4
4. creditStatus(client, creditCheckMode)
It takes the client credit score (creditScore) and returns the credit status based on the credit check
mode (creditCheckMode)
creditStatus | creditCheckMode | creditScore |
bad | restricted | less than 750 |
default | less than 700 | |
good | restricted | more or equal to 750 |
default | more or equal to 700 |
5. productStatus(product,store,storeThreshold)
It returns the status of the product in store based on store threshold (storethreshold)
productQuantity | productStatus |
0 | sold-out |
< storethreshold | limited |
> = storethreshold | available |
6. “orderHandling(client,product,store,storeThreshold,creditCheckMode)”
Receives the order from the client for a product (name) in specific store with specific storeThreshold
and creditCheckMode, then returns the orderStatus based on the following conditions:
orderStatus | Conditions |
‘accepted’ | ‘very good’ accountStatus |
‘good’ accountStatus and creditStatus | |
‘poor’ or ‘fair’ accountStatus, ‘good’ creditStatus and ‘available’ productStatus. | |
‘pending’ | ‘fair’ accountStatus, ‘good’ creditStatus and ‘limited’ or ‘sold-out’ productStatus. |
‘poor’ accountStatus, ‘good’ creditStatus and ‘limited’ productStatus. | |
‘underReview’ | ‘good’ accountStatus and ‘bad’ creditStatus |
‘fair’ accountStatus, ‘bad’ creditStatus and ‘available’ productStatus | |
‘rejected’ | ‘fair’ accountStatus, ‘bad’ creditStatus and ‘limited’ or ‘sold-out’ productStatus. |
‘poor’ accountStatus, ‘good’ creditStatus and ‘sold-out’ productStatus. | |
‘poor’ accountStatus and ‘bad’ creditStatus |
Tags: assignmentexpert, assignmenthelp, assignmenthelpaustralia, assignmenthelper, assignmenthelpuk, assignmenthelpusa, assignmentwriting, bestpriceguaranteed, bestqualityguaranteed, london, myassignmenthelp, plagiarismfreework