Writing Test Cases Using JUnit Description: Learning objectives: Create unit tests and fix defects. Use JUnit for
Question:
Writing Test Cases Using JUnit Description: Learning objectives: Create unit tests and fix defects. Use JUnit for unit-level testing to confirm defects are fixed. Use EclEmma to measure the coverage of Unit Testing. Tasks: Eclipse requires Java to be installed on your machine. o Recommended Java Version 8 (1.7.0 and above required). o Software installed on local computer: Import the CoffeeMaker Junit project in Eclipse. Write test cases for the classes Inventory, Recipe, RecipeBook. Make sure to achieve 100% coverage. There are 5 defects in the project source files, you're required to find, fix and submit any five (5) defects in project CoffeeMaker: o For each defect: explain in 1-2 sentences of why it was a defect and what you did to fix it. Format: Screenshot of failed unit test (caused by defect) Screenshot of code which caused the defect (with defect shown) Screenshot of code after being fixed Screenshot of same unit test passing o Hint: code coverage does not mean that you tested all of the possible cases, it just means that you tested at least one case per method Example of what is considered a defect: o Unreachable code o Wrong/unexpected outputs or results that do not match the comments of the method o Code that does not handle edge cases (such as index out of bounds) o Anything else that you think is a defect (along with a valid argument is provided explaining why it is a defect)
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr