ProAlgos-Cpp icon indicating copy to clipboard operation
ProAlgos-Cpp copied to clipboard

Unit tests

Open faheel opened this issue 7 years ago • 15 comments

Add unit tests for the following programs:

  • [x] N-Queens
  • [x] Kadane
  • [x] LCS
  • [x] KMP
  • Searching
    • [x] Common test for linear search and binary search
    • [ ] Ternary search*
  • Sorting
    • [x] Common test
    • [ ] Radix sort

* Ternary search currently has a unit test but it needs to be refactored.

faheel avatar Apr 04 '17 08:04 faheel

Read about Adding unit tests for C++ code for step-wise directions.

faheel avatar Jul 06 '17 22:07 faheel

Issue #74 is now closed

faheel avatar Jul 21 '17 00:07 faheel

All of the searching algorithms currently have unit tests, but they don't have a common unit test. However, there is a common test for sorting, which may be useful for implementing a common searching unit test.

alxmjo avatar Jun 25 '19 19:06 alxmjo

@faheel Regarding a common test for searching algorithms, is it your belief that this should include ternary search? The interface and use of ternary search differs from the other two existing search algorithms (linear and binary), which makes me wonder if it would be more straightforward to have a common test for binary and linear (and similar algorithms which may be added later) and then a separate test for ternary search. Not as clean as the sorting implementation I added earlier, but maybe a better fit for the objective at hand.

alxmjo avatar Jul 30 '19 00:07 alxmjo

@alxmjo Having a common unit test for linear and binary search and a separate one for ternary search would be best.

faheel avatar Jul 30 '19 06:07 faheel

Hey, I'd love to give this a crack. Let me know if the issue is still open for any left over algorithms.

ghost avatar Jan 05 '20 17:01 ghost

@safderareepattamannil If you're still interested, we're still missing a common test for searching algorithms. Have a look at the common test for sorting algorithms for an idea of how you might implement it.

alxmjo avatar May 07 '20 21:05 alxmjo

@alxmjo Hey, I am interested to give it a try !

beardbytes avatar May 28 '20 19:05 beardbytes

Hello, Is still any unit tests that needs to be done

amrii1 avatar Aug 05 '20 16:08 amrii1

@amrii1 Yes! See the post at the top of the thread. Currently still need a common test for linear and binary search, and then standalone test files for ternary search and radix sort. Please create a new issue if you have questions or would like to discuss implementation. 🙂

alxmjo avatar Aug 05 '20 16:08 alxmjo

hello the unit testing for the searching algorithms is checked in the readme.md , so is it still open or not ? i am planning to work on that

@abdulwahab-alobaid-2191115290 The unit tests for searching algorithms have already been added. You can pick up something else if you like.

faheel avatar Jul 26 '21 18:07 faheel

I'm planning to submit testing for the radix search within a week or two.

lydiathiel avatar May 27 '22 19:05 lydiathiel

What I have to do?? Do i have to write code???

Ashu-1309 avatar Oct 04 '22 21:10 Ashu-1309

@faheel @alxmjo Would love to do unit test for Radix Sort

srsonia2506 avatar Apr 09 '24 20:04 srsonia2506

A fix for radix sort has been added in #420. Feel free to review the code and run the tests (and suggest new edge cases if any).

faheel avatar Apr 10 '24 08:04 faheel