Homework 7, ECE 590 & CS320 Software Reliability
Learn the usage of the recovery block for multi-version sorting – Use of Design diversity:
- Come up with a primary variant and an alternate variant using two different sorting algorithms of your choice from bubble sort, selection sort, insertion sort, quicksort, heapsort, etc., and implement them.
- Design and implement an acceptance test for the sorting algorithm.
- Treat each sorting routine variant as a block for the purpose of recovery and implement the recovery block scheme.
- Use a method of logging, such as “printf()”, to track down the calling history of different blocks.
- Check whether the second sorting routine variant block is ever called. If the second block is not called at all, you can manually insert one or two bugs in your code so as to force the execution of the second variant. A program with manually inserted bugs is known as a mutant. It is not hard to obtain a mutant. The easiest way is to perturb an arithmetic operator, such as replacing “+” by “*”, and “-” with “/”. You can try several mutants to see the differences.
- You may use C/C++, Java, or Python to finish this assignment.
Please hand in the codes you implement along with a readme to demonstrate how your codes work.
Hint: The recovery block scheme is: Ensure acceptance test By primary variant Else by first alternate variant Else by second alternate variant …… Else by last alternate variant Else fail