开发者

Test cases for a Singly Linked list

开发者 https://www.devze.com 2023-02-19 15:31 出处:网络
What are some good testcases for a Linked list problem in general? for example test cases for a function which finds and eliminates duplicates and returns the pointer to the first node. Some core case

What are some good testcases for a Linked list problem in general? for example test cases for a function which finds and eliminates duplicates and returns the pointer to the first node. Some core cases could be: the function is in c# or Java and not c, c++. Assume all positive integers as nodes of the list.

  • Null
  • Empty List
  • Linked list with a loop
  • List with all dups
  • List with one node or 2 nodes (2 dups)
  • No duplicates
  • The list could encounter integer over flow, in开发者_运维百科case low memory (depending on 32 bit machine, 64 bit machine)
  • Security testing, language automation, memory issues, performance and stress

What else? expecting outrageous test cases..any experts out there?


How about these?

  • traversing the list
  • edge cases:
    • traversing an empty list
    • traversing list where 1+ stored values are NULL
  • operations (if applicable):
    • deleting from the list
    • inserting into the list
    • inserting a sub-list into the linked list
    • traversing the list backwards (if doubly-linked list)
  • concurrency tests (if applicable):
    • race condition tests


  • Security -> what level of permission is required to use the API, roles etc
  • Memory - > How much memory is consumed when this API is used; Does it affect performance?
  • Compatibility testing - > testing the suite using this API on different platforms, windows, MAC, Unix etc.
  • Stress testing -> Invoke the API by using a master slave architecture and parallel processing on different clients.
  • UI-> If the API has a UI, UI test cases come into picture like usability testing
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号