A7-BlackBoxTests_PartI

pdf

School

Centennial College *

*We aren’t endorsed by this school

Course

397

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

8

Uploaded by ChefPorcupineMaster87

Report
Software Testing and Quality Assurance COMP-311 Page 1 of 8 Black Box Tests Part I Designing test cases using equivalence partitions, boundary value analysis and decision tables Instructions Work in pairs groups of two and discuss with each other as you complete the exercise. Each team should have two copies of these sheets (one for each person) so you can use one copy for rough work. Alternatively use scratch paper or an area on the white board for rough work. Marking This assignment is marked out of 10. Due Hand in or submit to eCentennial your joint solution before you leave class. This assignment has two goals : 1. To practice techniques for designing black box tests that help ensure good code coverage. The theory is that testing all possible scenarios maximizes chances of following all possible paths through the code. Do not fall into the trap of making assumptions about how the application might be coded. 2. To practice specifying test cases. Clear documentation is important because test implementation and execution might be outsourced to people who have no experience with the business domain or knowledge of the application requirements. Do not overlook or hesitate to state the obvious and pay attention to detail. Question 1 A program converts student marks that are input as marks out of 100 to letter grades following the rules below. A mark of at least 90 earns A+ A mark of at least 80 earns A A mark of at least 70 earns B A mark of at least 60 earns C A mark of at least 50 earns D A mark below 50 means F (Failure) If a student is excused from submitting 40% or more of the gradable work for acceptable reasons such as protracted illness, a mark of I (Incomplete) is given. Then the student can make arrangements to submit missing work to complete the course after the end of term.
Software Testing and Quality Assurance COMP-311 Page 2 of 8 Note: Numeric marks are recorded accurate to one decimal point (0.1) and should be rounded up to the nearest whole number (0.5+ 1) by the grading program. The objective of testing is to ensure that students are assigned the correct letter grade, given their numeric mark. a. Draw the diagram to show equivalence partitions and boundary values that ensure all input values are tested (0.5 pts) Hint: ignore the incomplete situation Marks Grades >100 Invalid:Error 100-90 A+ 89.5-80 A 79.5-70 B 69.5-60 C 59.5-50 D 49.5-40 F <0 Invalid:Error b. (0.5 pts) How many test cases do you think are required for complete coverage? ______8_____ And why? (How many tests do you think are needed for each partition) c. (0.5 pts) Describe a test case where the expected result is a pass.
Software Testing and Quality Assurance COMP-311 Page 3 of 8 Title: Student gets an A Setup: (preconditions) Percentage to pass in this course is anything above 50% Action or input: Student receives mark of 87.5% Expected result: Student receives grade of A d. (0.5 pts) Describe a test case where the expected result not a pass Hint : there are two possible non-pass situations. List them here to help form your title. 1: Student has not completed the course. 2: Student receives mark under 40% Title: Setup: Student becomes absent without college acknowledgement and doesn’t do half of the course curriculum. Action or input: Marks from uncompleted assignments build up and deduct 100% of missing marks. The attendance marks also don’t apply to this student since they were absent and didn’t attend class. Expected result: Student receives grade of F, student has failed the course. Question 2 When asked for an insurance quotation, an auto insurance company looks up the base rate of insuring a specific make, model and year of car. It then multiplies the base rate by percentages according to the business rules below to calculate the quote for a customer: Drivers over 55 years of age with good driving records pay the 90% of the base rate.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Software Testing and Quality Assurance COMP-311 Page 4 of 8 Drivers who are male and under 25 years of age pay 150% of the base rate. Anyone who uses the car for business pays a premium of 120% of what they would pay for personal use only. Example: the base rate for a 2005 Honda Civic might be $500.00. A retired senior with a good driving record would pay $450.00 for coverage for insurance to drive 2005 Honda Civic. However, if that senior has a business as a messenger for which he uses the car, his rate becomes $540.00. a. (1 pts) Draw a decision table to calculate the quotation for a client Hint: start by deciding: What are the conditions that determine outcomes? What are the possible outcomes? Draw your table here: Conditions R1 R2 R3 R4 R5 R6 R7 R8 Good Driver age 55+ Y Y Y Y N N N N Male and age <=25 Y Y N N Y Y N N Business drivers Y N Y N Y N Y N Base rate %age N/A N/A 90% 90% 0% 150% 120% 0 b. Use the decision table above to help design test cases for the test objective: Every driver who requests a quotation is told the correct rate. Notes: Criteria for success” refers to deciding whether application passes the test, not whether the driver gets insurance. Test Case 1 (1 pts) Test Case 2 (1 pts)
Software Testing and Quality Assurance COMP-311 Page 5 of 8 Identifier/title Male driver, age 22 Identifier/title Business driver aged 30 Criteria for success: Must be male. Age of driver must be less than 25, and car shouldn’t be used for business purposes. Criteria for success: Age does not have a category it falls in Car used for business only Details: Preconditions Age is less than 25 Car not used for business purpose strictly Male Operation/Action performed Age verified Purpose verified Gender verified Postconditions Pays 150% premium on base rate Details: Preconditions Age doesn’t have a category it falls in Car used for business strictly Operation/Action performed Age verified Purpose Verified Postconditions Pays 120% premium on base rate Question 3 (2 pts) You are designing tests for an online banking application. A use case allows bank account owners to pay bills from their bank accounts. Before paying bills, an account owner with on-line access, must register payees (typically credit card and utilities providers) so that the bank knows who and how to pay. Then, the account owner can transfer funds from their bank accounts to pay bills on-line. Scenarios: The application should complete the bill payment if the bank account has enough funds or cancel otherwise. There is no service charge for online bill payment when the bank account has sufficient funds.
Software Testing and Quality Assurance COMP-311 Page 6 of 8 If the bill amount is greater than the account balance, the application should send a notification to the client and charge a service fee of $5.00. If the bank account is less than $5.00, it will be left with a small negative balance. Complete the table to define two test cases for each scenario in this use case. Test case 1 (1 pts) Use Case scenario: successful bill payment Test Case 2 (1 pts) Use case scenario: bill payment unsuccessful Identifier/title Successful Bill Payment Identifier/title Unsuccessful Bill Payment Criteria for success: Payee must be registered with bank Payee must have sufficient funds to pay bill Criteria for success: Payee must be registered with bank Payee doesn’t have enough funds to pay bill Notification send to payee for extra 5 dollar service fees If payee’s account is less than 5 dollars, account will be left with a negative balance. Details: Preconditions Payee registered with bank Has sufficient funds Operation/Action performed Payee verified Payment paid Postconditions Payee has no remaining bills left to pay Details: Preconditions Payee registered with bank Doesn’t have sufficient funds Operation/Action performed Payee verified Payment initialized Postconditions Payee cannot pay bills and is now left with a negative balance due to the 5 dollar charge Question 4 (1 pts)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Software Testing and Quality Assurance COMP-311 Page 7 of 8 The next phase of the online banking application described in the previous question handles checking accounts and savings accounts instead of generic bank accounts. Bill payment is allowed only on checking accounts under the following business rules (in order of priority): a) If the checking account balance is equal or greater to the bill amount, pay the bill. b) If the checking account balance is less than the bill amount and the user has prearranged overdraft protection that covers the amount, withdraw a service charge of $5.00 from the account and pay the bill, letting the account balance go below zero. c) If the checking account balance is less than the bill amount and the account owner has a savings account that has enough funds, transfer enough money from the savings account to the checking account to pay the bill, complete payment and leave the checking account with a balance of zero. d) If the checking account balance is less than the bill amount and the account owner does not have either overdraft protection or a savings account, do not make payment. Instead, send a notification to the client and charge a service fee of $5.00, possibly leaving a small negative balance in the checking account. Decide what black box technique applies and then draw the diagram to represent the conditions and expected results in this phase application development. No test cases are required. Answer: State transition testing is used. Diagram and the explanation is below. S1 No sufficient Balance S2 sufficient Balance S1 No sufficient Balance S3 Perform Transaction S4 Balance
Software Testing and Quality Assurance COMP-311 Page 8 of 8 State Event S1 Transfer funds from saving account S3 Perform Transaction S4 Shows account balance zero S1 Add the overdraft protection to the chequing account S3 Perform Transaction with $5 service charge S4 Shows account balance zero S2 Sufficient balance the transaction S3 Perform Transaction S4 Shows the remaining balance in account S1 If no saving/overdraft S3 Perform Transaction with $5 service charge S4 Shows the negative balance in account