[ Meta This example was constructed to illustrate Algorithm Testing only. The program being tested is simpler than a typical assignment question, and so, this document presents less testing than you typically will. Recap of output format: For each phase of the game, lists the status of each player as either active or blocked (e.g. [A, B, B, B, B] would mean that player 0 is active but all others are blocked). The message that follows is the message that the player receives to pass on after modifying. For an assignment, the output format is explained in the assignment description, and you can assume the TA knows how to read it. Ony discuss any deviations or interpretations ] Approach: - The program is run twice to demonstrate the true randomness of the modifications. - A single console trace, showing the two program runs, is analyzed for the five qualities following. [Note, no one size fits all here. You have to design your run(s), and document traceability, according to the specific assignment. Just explain your test-doc design, briefly, upfront.] Quality 1: Only one user is active at a time - See lines 1-11 - Out of the 5 players, every line has 4 marked as 'B'locked, and only one is marked as 'A'ctive. Note that the correct number of players is created. Quality 2: Control cycles through the users - See lines 1-11 - The succession of activity rows shows that control passes from player i to player i+1. Upon reaching NUMPLAYER-1, control passes back to player 0 ( 0 <= i <= NUMPLAYER-1). Quality 3: Play stops upon reaching the second cycle - See lines 1, 8, 13, 14-20 - Upon having the message traverse the ring twice, the game is halted. This is confirmed by the number of passes (11, terminates on the 12th). Quality 4: All players terminate - See lines 14-20 - All players print a termination message in their destructor, and the message appears once for each. Each termination message confirms that the players were initialized with the correct ids. Quality 5: Each pass changes the message in one random position - See lines 22-32, 38 - Comparing each message to its subsequent message shows only one character's value is changed each time. It is changed randomly, varying from index 0 to 14 (last position) and the value to which the character is changed is also random. The final messages are different between each game. Output of actual program runs: 1 Script started on Thu May 14 22:11:49 1998 2 [31]% ./telephone 3 1 [A, B, B, B, B] 'abcdefghijkl' 4 2 [B, A, B, B, B] 'abcdeighijkl' 5 3 [B, B, A, B, B] 'abcdeighijkO' 6 4 [B, B, B, A, B] 'abcdeighijk\' 7 5 [B, B, B, B, A] 'abcdeighij^\' 8 6 [A, B, B, B, B] 'abcdeigyij^\' 9 7 [B, A, B, B, B] 'abcdeigyij^f' 10 8 [B, B, A, B, B] 'abcdeigyi3^f' 11 9 [B, B, B, A, B] 'abcdeigyi3^J' 12 10 [B, B, B, B, A] 'abcgeigyi3^J' 13 11 [A, B, B, B, B] 'abcgeigyu3^J' 14 Player 0 terminating 15 Player 1 terminating 16 Player 2 terminating 17 Player 3 terminating 18 Player 4 terminating 19 Final message was: 'abcgeigyj3^J' 20 (UNIX pid:15444) (uHeap *)0xb8420.uDoFree(): program terminating with 288(0x120) bytes of storage allocated but not freed. 21 [32]% ./telephone 22 1 [A, B, B, B, B] 'abcdefghijkl' 23 2 [B, A, B, B, B] 'abcdefghijal' 24 3 [B, B, A, B, B] 'abUdefghijal' 25 4 [B, B, B, A, B] 'abUde]ghijal' 26 5 [B, B, B, B, A] '.bUde]ghijal' 27 6 [A, B, B, B, B] '.b6de]ghijal' 28 7 [B, A, B, B, B] '.b6de]ghijal' 29 8 [B, B, A, B, B] '.b6dw]ghijal' 30 9 [B, B, B, A, B] '.b6dw]ghijnl' 31 10 [B, B, B, B, A] '.b6dw]ghZjnl' 32 11 [A, B, B, B, B] '.b6dw]ghZjn`' 33 Player 0 terminating 34 Player 1 terminating 35 Player 2 terminating 36 Player 3 terminating 37 Player 4 terminating 38 Final message was: '.b6dw