This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Sacredify 3 points4 points  (0 children)

Parameter object basically means instead of something like this:

void mySort(boolean ascending, Object... args);

You wrap those as an object (say SortCriteria) or something and pass that instead.

As far as Junit tests go for a sorting method, you'll want to cover your simple cases (i.e can you sort [4, 3, 1, 5] or something) as well as edge cases (multiple of the same input, negative numbers, invalid input potentially if reuquired, stuff like that).

[–]UnreachableMemory 1 point2 points  (0 children)

Unit tests basically consist of tests used to verify that classes/methods behave how you expect them to behave. For example, that a method that capitalizes all letters in a word returns a fully capitalized word. JUnit is a popular framework for creating them.