Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

INDIVIDUAL ASSIGNMENT Deadlines: 28 December 2021 Reminder: This is an individual assignment and please do it yourself. Please do not copy your friend's report. If

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

INDIVIDUAL ASSIGNMENT Deadlines: 28 December 2021 Reminder: This is an individual assignment and please do it yourself. Please do not copy your friend's report. If caught both parties will be given O mark. Use all the knowledge that you have learned (not only restricted to Black-box and White-box chapters) in order to complete the assignment. Introduction The aim of the assignment is to assess your understanding on the basic concepts and techniques of software testing. You are going to test a simple system based on both black- box and white-box testing techniques. You are given a Java code (i.e. ElectricityDiscountCalc.java), the requirements and the design as the test basis. The function of the Java code is to calculate normal and discounted electricity bill based on the electricity consumption, type of user and type of sector. The code is developed in order to help TNB customers to calculate their discounted electricity bills during lockdown where it is expected that the electricity usage might increase due to movement control order (MCO) and people have to stay at home most of the time. Thus, TNB is supporting the government to keep the economy going and allay the economic pressure on the industrial sectors most impacted in particular and all customers in general providing 6-month discount on the monthly bills. What you have to do: 1. Analyze the given test basis. 2. Design test cases based on the techniques that you have learned. 3. Prepare a test script. 4. Execute the tests using a tool. 5. Assess the quality of the test cases that you have design. 6. Prepare a report that consists of: a. Test strategy (i.e. based on your analysis, how are you going to conduct the test) b. Test design c. Test Script (i.e. a list of test cases that you have identified from test design) d. Test class that consists of test methods (i.e. in the format of JUnit test class) e. Coverage information (i.e. print screen code under test and the percentage coverage. This can be obtained after you execute you JUnit coverage) f. Concluding remarks, i. Justify why your solution (i.e. in terms of strategy and techniques) is the most effective in testing the given system. ii. Justify the readiness of the system for deployment? Test Basis: 1. System's requirements 2. System's design 3. Source code, Electricity DiscountCalc.java (see Appendix A) System Requirements: The Normal Tariff The system displays the normal tariff based on the following information: UNIT CURRENT RATE 11 JAN 2018) 21.00 33.40 TARIFF CATEGORY Tarift A-Domestic Tariff For the first 200 kWh 81 - 200 kWh per month For the next 100 kWh (201-300 kWh per month For the next 300 kWh (301 - 600 kWh per month For the next 300 kW (601 - 900 kWh per month For the nex! kWh 1901 kWh onwards per month The minimum monthly charge is RM3.00 1. sen/kWh sen/kWh sen/kWh sen/kWh sen/kWh 51.60 54.60 57.10 Figure 1 CURRENT RATES1 JAN 2014 TARIFF CATEGORY TARIFF B-LOW VOLTAGE COMMERCIAL TARIFF For the first 200 kWh 11-200 kWh per month For the next kWh 1201 kWh onwards) per month 43,5 sen/Wh 50.9 sen/kWh Figure 2 The Discount The system displays the discounted electricity bill based on the following discount information: ELECTRICITY BILL DISCOUNTS AUTNB Wers are entitled automatically , no need to apply Discount rates from 2%-50% Residential Electricity consumption Electricity bill Discount O KWh - 200 kWh RM43.60 and below 50% 201 KWh - 300 kWh RM43.70 - RM77.00 25% 301 kWh - 600 kWh RM77.10 - RM231.00 15% 601 KWh and above RM231.90 and above 2% Non-residential DISCOUNT 15% DISCOUNT 2% 6 most affected sectors Other sectors Hotel operators Commercial Travel agencies Industrial Local airlines offices Specific agricultural Shopping malls Convention centres Theme parks TheStar graphics Figure 3 The system's interface are as follows: 1. User type consists of Residential or Non-Residential. If the user enters Residential as user type, the system shall calculate the amount of normal and discounted bills based on Tariff A (see Figure 1 and Figure 3). Enter to stop; 1 to continue Enter Type of Customer (Residential/Non-Residential): Residential Enter electricity consumption (kWh): 1706 UNDERSTAND YOUR ELECTRICTIY BIL Tariff: Residential Total Electricity Bil without Tax: 855.83 Total Electricity Tax: 37.44 Total Electricity Bil with Tax: 893.27 ***** Total Discounted Electricity Bil without Tax: 789.98 Total Discounted Electricity Tax: 36.69 Total Discounted Electricity with Tax: 826.67 ***** Total Saving during COVID-19: 66.60 Enter to stop; 1 to continue Figure 4 2. if the user input Non-Residential for the user type, the system will ask for sector type value. The value of sector type can be either Hotel, Travel, Commercial or Industrial. If the user enters either Hotel or Travel, the system shall calculate the amount of normal and discounted electricity bills based on Tariff B (see Figure 2 and Figure 3). Enter to stop; 1 to continue 1 Enter Type of Customer (Residential/Non-Residential): Non-Residential Enter electricity consumption (kWh): 1706 Enter Type of Sector(Hotel/Travel/Commercial/Industrial): Hotel UNDERSTAND YOUR ELECTRICTIY BIL Tariff: Non-Residential Hotel Total Electricity Bil without Tax: 853.55 Total Electricity Tax: 37.31 Total Electricity Bil with Tax: 890.86 Total Discounted Electricity Bil without Tax: 725.52 Total Discounted Electricity Tax: 32.83 Total Discounted Electricity with Tax: 758.35 Total Saving during COVID-19: 132.51 Enter to stop; 1 to continue Figure 5 3. On the other hand, if the user enters Non-Residential for user type and Commercial or Industrial for the sector type value, the system shall calculate the amount of normal and discounted bills based on Tariff B (see Figure 2 and Figure 3). Enter to stop; 1 to continue Enter Type of Customer (Residential/Non-Residential): Non-Residential Enter electricity consumption (kWh): 1706 Enter Type of Sector(Hotel/Travel/Commercial/Industrial): Commercial UNDERSTAND YOUR ELECTRICTIY BIL Tariff: Non-Residential Commercial Total Electricity Bil without Tax: 853.55 Total Electricity Tax: 37.31 Total Electricity Bil with Tax: 890.86 Total Discounted Electricity Bit without Tax: 836.48 Total Discounted Electricity Tax: 39.48 Total Discounted Electricity with Tax: 875.97 Total Saving during COVID-19: 14.89 Enter to stop; 1 to continue Figure 6 1 R 10 NR + 12 NR System Design: Decision Table CONDITIONS User type Sector Type consumption > 600KWH ACTIONS DISCOUNT TARIFFA- 50%, 25%, 15%, 2% DICOUNT TARIFF B-15% DISCOUNT TARIFF B-2% 6% tax will be charged 2 3 4 5 6 7 8 R RR RR RR NR H H TTC CITH Y N YN YN YN ZI56 11 NR T Y 13 14 15 16 NR NR NR NR 1 ! Y N Y N N Y 2 N X X X X X X X X X X X * X XIX x X Legend: 1 R NE 2 R 12 NR NR Z Z 10 NR N 9 IZ 11 NR T Y 13 NR Y 2-3 14 NR N 15 NR 1 Y 16 NR 1 N 600kWH ACTIONS DISCOUNT TARIFFA- 50%, 25%, 15%, 2% DICOUNT TARIFF B-15% DISCOUNT TARIFF B-2% 6% tax will be charged R- Residence NR - Non-Residence H- Hotel T-Travel C-Commercial 1 - Industrial Y-Yes N- No X X XX XX x 4 System Flowchart Start B 0 1 Continue ? End Enter user-type, consumption Non-Residential Residential user-type? Hotel | Travel Commercial ||Industrial sector_type? calcNoDiscBilR calcNoDiscBilNR calcNoDiscBiINR calcTax calcTax calcTax calcDiscBiR --- calcDiscBilNR1 calcDiscBilNR2 calcTax calcTax calcTax A 1. Display the normal electricity bill without tax 2. Display tax of normal electricity bill 3. Display the discounted electricity bill without tax 4. Display tax of discounted electricity bill 5. Display the saving amount B calcNoDiscBilR Initialize variables: bil_amount, first200kwh, next100kwh, next300kwh_1, next300kwh_2, nextbalancekwh N Y Consumption > 2012 N Y bil_amount (consumption 21.80)/100 Consumption 301? N Y bil_amount = first200kwh + next200kwh Consumption >601? bil_amount = first200kwh + next200kwh + next300kwh_1 D C N Y Consumption >901? bil_amount = first200kwh + next200kwh + next300kwh_1+ next300kwh_2 bil_amount = first200kwh + next200kwh + next300kwh_1+ next300kwh_2 + nextbalancekwh return bil_amount End Note: 1. first100kwh = (consumption * 21.80)/100 2. next200kwh = (@consumption * 33.40) / 100 3. next300kwh_1 = (@consumption * 51.60) / 100 4. next 300kwh_1 = (@consumption * 54.60)/100 5. nextbalancekwh = (@consumption * 57.60) / 100 @consumption-electricity consumption after deduction previous consumption calcDisc BIR Initialize variables: bil_amount, first200kwh, next100kwh, next300kwh_1, next300kwh_2, nextbalancekwh N Y Consumption > 2012 N Y bil_amount 0.5 (consumption * 21.80)/100) Consumption >301? N bil_amount = (0.5* first200kwh) + (0.85 next200kwh) Consumption 2601? E bil_amount = (0.5 *first200kwh) +(0.75* next200kwh) + (0.85* next300kwh_1) F E N Y Consumption 29012 bil_amount = first200kwh + next200kwh + next300kwh_1 + next300kwh_2 bil_amount = first200kwh + next200kwh + next300kwh_1 + next300kwh_2+ nextbalancekwh F return bil_amount End Note: 1. first100kwh = (consumption * 21.80)/100 2. next200kwh = (@consumption * 33.40) / 100 3. next300kwh_1 = (@consumption * 51.60) / 100 4. next300kwh_1 = (@consumption * 54.60)/100 5. nextbalancekwh = (@consumption *57.60) / 100 @consumption-electricity consumption after deduction previous consumptio calcNoDiscBiINR Initialize variables: bil_amount, first200kwh, nextbalancekwh Y Consumption > 2012 bil_amount = consumption *0.435 bil_amount = first200kwh (i.e. consumtion 0.435) + next200kwh (i.e. balance consumption * 0.509) + return bil_amount End calcDiscBilNR1 Initialize variables: bil_amount, first 200kwh, nextbalancekwh N Y Consumption >2012 = bil_amount = 0.85 (consumption * 0.435) bil_amount = 0.85 (first200kwh (i.e. consumtion* 0.435) + next200kwh (i.e. balance consumption * 0.509)) return bil_amount End calcDiscBilNR2 Initialize variables: bil_amount, first200kwh, nextbalancekwh N Y Consumption > 2017 bil_amount = 0.98" (consumption *0.435) bil_amount = 0.98 * (first200kwh (ie. consumtion* 0.435) + next200kwh (i.e. balance consumption * 0.509)) return bil_amount End calcTax N Y Consumption 2601? N Y return 0 Discount? return ((bil_amount - 231.80) * 0.06); return ((bil_amount - 178.43) * 0.06); End

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions