java-algorithms-implementation icon indicating copy to clipboard operation
java-algorithms-implementation copied to clipboard

Add tests for GreatestCommonDivisor Algorithms, Modular Algorithms

Open doanthihoaithu opened this issue 5 years ago • 0 comments

By submitting this pull request I confirm I've read and complied with the below requirements.

  • [x] I have read the Contribution guidelines and I am confident that my PR reflects them.
  • [x] I have followed the coding guidelines for this project.
  • [x] My code follows the skeleton code structure.
  • [x] This pull request has a descriptive title. For example, Added {Algorithm/DS name} [{Language}], not Update README.md or Added new code.

I am learning about black box testing and I would love to contribute some tests to GCD algorithm applying boundary value testing techniques. This is the first time I made a pull request, I hope my contribution will be accepted. If I did it incorrectly, please give me comments so that I can fix it.

In this algorithm, I am very concerned about the case that input parameter pair is (0, Long.MIN_VALUE). I expect the result should be Long.MAX_VALUE + 1 but the function returned a negative value, it is -9223372036854775808. The reason is that Math.abs(long) function cannot return positive values for the input as Long.MIN_VALUE=-9223372036854775808 because 9223372036854775808 is considered out of range. So what is the end result in this case?

New Update I continued to write some more tests for the pow function in Modular.java file using control follow testing technical according to MC/DC standard. These test cases make sure to cover all the paths of the control flow graph corresponding to the program source code

Third Update I continued to write some more tests for the pow function in Modular.java file using data follow testing technical according to All-DU-Paths standard.

My English is not very good, sorry for the inconvenience.

doanthihoaithu avatar Sep 18 '19 15:09 doanthihoaithu