1
answer
0
watching
107
views
24 Sep 2020
Have a look at the Java 14 ArrayList documentation:
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/ArrayList.html
Imagine you developed this data structure and wanted to test it with the following standards:
- every method that returns a boolean should have at least 3 unit tests, one for a 'true' case, one for a 'false' case and one trivial 'corner case'
- every constructor should have at least 2 unit tests
- every other method (whether they return void or an Object or anything else) should have at least 4 unit tests
Then (at least) how many unit tests should you use to sufficiently test Java's ArrayList? Ensure that "All Methods" is selected when you are looking at the list of ArrayList methods.
Have a look at the Java 14 ArrayList documentation:
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/ArrayList.html
Imagine you developed this data structure and wanted to test it with the following standards:
- every method that returns a boolean should have at least 3 unit tests, one for a 'true' case, one for a 'false' case and one trivial 'corner case'
- every constructor should have at least 2 unit tests
- every other method (whether they return void or an Object or anything else) should have at least 4 unit tests
Then (at least) how many unit tests should you use to sufficiently test Java's ArrayList? Ensure that "All Methods" is selected when you are looking at the list of ArrayList methods.