Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A java program test Developing a Test Plan For this assignment, develop a test plan for Assignment 1 and (at least) six JUnit tests for

A java program test

Developing a Test Plan For this assignment, develop a test plan for Assignment 1 and (at least) six JUnit tests for Assignment 1s House class.

package assignment;

public class House { private String ownerName; private String phoneNumber; private String streetAddress; private String city; private String state; private String zipCode; private Room rooms[]; private int roomIndex;

public House(int numRooms){ rooms = new Room[numRooms]; this.ownerName = ""; this.phoneNumber = ""; this.streetAddress = ""; this.city = ""; this.state = ""; this.zipCode = ""; this.roomIndex = 0; } public String getOwnerName() { return ownerName; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getStreetAddress() { return streetAddress; } public void setStreetAddress(String streetAddress) { this.streetAddress = streetAddress; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getZipCode() { return zipCode; } public void setZipCode(String zipCode) { this.zipCode = zipCode; }

public void addRoom(double sqft, String fType){ rooms[roomIndex] = new Room(sqft,fType); roomIndex++; }

public double getInstallationCost(){ double totalCost=0; for(int i=0;i

totalCost = totalCost + rooms[i].getFloorType().getFlooringCost(); } return totalCost; } }

image text in transcribed

image text in transcribed

image text in transcribed

Section 1 - Introduction A brief overview of the project and the tests to be conducted. This is often referred to as an "executive summary". It briefly describes the purpose and nature of the project, the purpose and nature of the tests to be conducted, and any issues that deserve special mention. The introduction or the details of the tests should tell us if any professional standards are being used. Section II - Items To Be Tested A list of the items to be tested. In object-oriented programming this is often a list of classes and methods to be tested. For each item, there should be a description of the specific features to be tested, such as testing the functionality of certain methods. Section III Items Not Being Tested A list of the items that are not to be tested in the test plan and any reasons why each does not need to be tested. This is often a list of classes and methods being reused in this project that have previously been properly validated. Section IV-Tests To Be Conducted Your test plan must include at least three tests. You have two options for this: Option 1: Step-by-Step Tests Create at least three tests by providing step by step instructions that detail how to perform the test when the program is running. For example: Test 1 1. Start the program. 2. When prompted to enter a number, enter -1. 3. This input should be rejected and an error message displayed. 4. A prompt should appear asking to re-enter the number. When it does, enter 5. 5. This value should be accepted by the program. Section V - The Test Environment What hardware, software, third party libraries or APIs, data sets, and so on are needed for the test? Section VI - The Test Deliverables What data and documents will be available as a result of the test? Section VII - Responsibility For The Test Who designed the test? Who will conduct the test? JUnit Tests Your JUnit test plan (at a minimum) must verify: 1. One of the setters and its getter counterpart (such as setCity and getCity) are working. 2. The getFlooring Cost method returns the correct amount for a house with one room with carpet. 3. The getFlooring Cost method returns the correct amount for a house with one room with tile. 4. The getFlooring Cost method returns the correct amount for a house with one room with hardwood. 5. The getFlooring Cost method returns the correct amount for a house with three rooms, one each with carpet, tile and hardwood. 6. The getInstallation Cost method returns the correct amount for a house with four rooms

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 Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions