Skip to content

Java practice for Software testing HW1 — implementing unit tests with more than 95% code coverage using JUnit and Maven.

Notifications You must be signed in to change notification settings

freakpari/code-coverage-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Testing Practice: Order Price Calculator

This repository contains a set of unit tests for a Java Order Price Calculator implemented as part of a Software Testing course. The tests cover various scenarios including valid orders, discounts, coupons, and invalid input handling.


Features

  • 100% Test Coverage: All possible branches,instructions, and exception scenarios are covered.
  • Parameterized Tests: Tests are optimized using JUnit 5 @ParameterizedTest and @MethodSource for concise and maintainable code.
  • Coupon & Discount Handling: Tests include scenarios for multiple coupon codes (SAVE20, ELITE, FREESHIP) and item-based discounts.

Test Coverage Screenshot

Running the Tests

To run the tests and generate a coverage report, run this command and see the result in index.html:

mvn clean verify

About

Java practice for Software testing HW1 — implementing unit tests with more than 95% code coverage using JUnit and Maven.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published