coder coder - 10 months ago 51
Java Question

How many tests should I apply to test doubly Linked-list?

I have a doubly linked list

. I want to test

public E get (int index)

how many testes should I implement in JUnit to Cover fully cases ?

Thank you and hope to have answer soon.

Answer Source

I think you can follow all tests below:

  1. Test Get(0)from an empty list.
  2. Test Get(-1) from a list with 01 element
  3. Test Get(0) from a list with 1 element
  4. Test Get(1) from a list with 2 element.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download