Execute complete and thorough unit test

Assignment Help JAVA Programming
Reference no: EM13922109

Mission:

You were hired to write and execute complete unit test (white box testing) for MyStringUtils Java class, written by a developer who suddenly left the team. You are provided the source code (MyStrings.java) and you are to write JUnit test cases for it. You are to assume that code comments are correct for what each method is supposed to do and the code is supposed to match it.

Objectives:

Define, implement, and execute complete and thorough unit test on the given Java class (MyStringUtils.java).

Outline of Steps:

1. Fill out the Unit Test approach section in the template, explaining what unit test is all about and it's most important criteria. Make sure you answer and discuss all the questions in the template.

2. Design tests for each method to meet 100% code coverage and reasonable data coverage. Describe these tests in the document using template format given. For this project you want to test methods against the code comments and the code itself.

3. Implement unit test cases in JUnit in a single Java file (e.g. testMyStringsUtils.java)

4. Run the unit test cases and document the actual results in the report for each test case

5. Identify any defects you found running the JUnit and describe them in the report (using the template format) in section 2. Note: You should find a number of defects.

6. Submit both the report file and JUnit source code.

Again, you should first identify and document in your report all the unit tests that should be created (using the example in report). That will give you partial credit - identifying the tests. Then you should implement those test cases in JUnit. Use a single Java file for all your tests! Lastly you should run the test cases and document the actual results and defects you found.

Notes on pulling source code into eclipse

1. Create a new Java project: File->New->Java Project  (ex. MyProject1)

2. Click on "src" under your new project; right click and select import

3. Click on General->File System, then next and browse for where you have the file MyStringUtils.java, select it and click Finish

4. As an alternative you could create a new class MyStringUtils and copy/paste the file content into it.

5. In your project, you will see the source file MyStringUtils.java under src directory.

To add JUnit library to your Eclipse project:

1. Right click on project and select Properties

2. Click on Java Build Path (left side list)

3. Click on "Add Library" button (right side)

4. Select JUnit and click next

5. Choose version 4 of Junit and click Finish

6. The JUnit library will now show under Libraries tab.

7. Click OK

Reference no: EM13922109

Questions Cloud

How do agents and brokers differ : How do agents and brokers differ? After hearing the advice that it is usually best to buy life insurance from a person who has been in the business at least five years, a life insurance company general agent became upset and said rather vehemently, “..
What was cost of goods sold for the year : What was Cost of Goods Sold for the year Direct materials costing $70,236 were purchased.Direct labor cost was $26,268.
Showing profit/loss on crop, livestock and total profit : Depreciation is to be provided for at the rate of 20% and 10% per annum for motor vehicles and farm implements respectively on the book values. Buildings to be depreciated at 2% per annum on cost.
Should solaces management agree to sell explain : The Solace Company has an inventory of steel that it originally purchased for $20,000. It currently has an offer to sell the steel for $30,000. Should Solace's management agree to sell? Explain.
Execute complete and thorough unit test : Define, implement, and execute complete and thorough unit test on the given Java class (MyStringUtils.java).
What is the opportunity cost of your choice explain : Suppose that you have $900 and want to invest the money for one year. Which one will you choose? What is the opportunity cost of your choice? Explain.
Investment opportunity to produce new product : The Adjusted Present Value (APV) Company has an investment opportunity to produce a new product that will require an investment in equipment of $24 million with a 4 year life and a salvage value of $5 million and will be depreciated straight-line to ..
Lease payments and utilities on the production : During its first year of operations, Connor Company paid $50,000 for direct materials and $36,000 in wages for production workers. Lease payments and utilities on the production facilities amounted to $14,000. General, selling, and administrative exp..
What can company do to induce juan to purchase more clothing : The Johnson Company is the sole producer of clothing. What can the company do to induce Juan to purchase more clothing? Show graphically. (The graph does not have to be exact.)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Use javascript to write the onmouseenter event handler

Use JavaScript to write the onmouseenter event handler for the mouse enter event of the img tags (similar to the onclick event handler of the img tags in the ImageSwap/SlideShow applications). This handler should change the src attribute of the im..

  Write an application that uses string method region

Write an application that uses String method region - Matches to compare two strings input by the user. The application should input the number of characters to be compared and the starting index of the comparison.

  Declare a string variable named empty

Declare a string variable named empty, and initialize it to the empty string.

  Write a method insert at that takes an array of integers

Write a method, insertAt, that takes four parameters: an array of integers; the length of the array; an integer, say, insertItem; and an integer, say, index

  Program that will ask the user for total debt of customer

Write a Java program that will ask the user for the (1) name, (2) gender, and (3) total debt of customers.

  Your task in this assignment is to develop a graphical user

your task in this assignment is to develop a graphical user interface based java program that can communicate with a

  Using joptionpanes to handle your input and output

Using JOptionPanes to handle your input and output, produce a Java program which, given three sides of a triangle, determines whether the triangle is.

  Write a general package for reading in arithmetic expression

Write a general package for reading in arithmetic expressions and simplifying them. Write a program for a simple calculating language with two forms of statement.

  Create a calculator function

This is the code for my trip planner,you need to figure out how to create a calculator function to enable users to calculate their own costs if they choose

  The license plate game and csv parsing

Resulting method will correctly estimate that there are two syllables in quokka and two syllables in springbok, though it does get the number of syllables

  Object oriented programming-getting started with classes

Suppose you are car shopping and want to store information about possible choices. Model, and implement an automobile class. Use a UML drawing tool such as Umbrello or Microsoft Visio to create a class diagram. Your class should have at least cons..

  Write java program using array list object

Write a java program (using eclipse) using ArrayList object to allow the professor to enter student's name, his or her's four test scores.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd