6.8 Debugging Caesar Cipher Curriculum Page
Portfolio Reflection Questions:
- For each of the 5 bugs in the Caesar Cipher app, explain what the bug was, how to fix it, and the type of error (semantic or syntax). If you wish, you can take a picture of your corrected blocks and then annotate it to identify and describe the bugs you fixed.
- Error 1: In the CaesarEncrypt function, the error occurs when the result gets the PLAIN_ALPHABET variable. In order to change this semantic error, the CipherText should be used.
- Error 2: The Encrypt button sets the TextBoxPlain.Text, however it should be setting the TextBoxCipher.text instead. This is another semantic error.
- Error 3: In the CaesarEncrypt function, in the loop the "to" piece was set to PLAIN_ALPHABET. In order to correct this, it should be set to PlainText. This is a syntax error.
- Error 4: In the CaesarDecrypt function, in the loop the "to" piece is set to 5. However this is incorrect and it should be set to the length of the ciphertext variable. This is a semantic error.
- Error 5: In the CaesarDecrypt function, the result is set to get the ciphertext. However, it should be set to get the Plaintext. This is another example of a semantic error.