Skip to the content.

Lab Report 4

Testing the Implementation of Two Versions of MarkdownParse


This lab report contains the following:

Screenshots will be included in spoilers as to not take up uncessary space.

» This is a spoiler, Click Me! This is the inside of a spoiler where images will be located!


Snippet 1

Markdown Snippet

For this snippet, both MarkdownParse implementations failed their tests. Both implementations included url.com when they should not have. I feel like this code change would be pretty small, less than 10 lines. The link should not have been included because since the backtick came first, it should parse as a code block. Of course, both implementations of MarkdownParse did not know this. The fix could be to check for a pair of backticks, with the first backtick occuring before the start of the URL syntax (before the opening bracket). My group’s implementation of MarkdownParse also did not output ucsd.edu, probably because of the closing bracket in the link title portion of the URL syntax. A fix for this could include skipping over brackets in the title portion if they do not complete a valid URL.

» Expected Output [`google.com, google.com, ucsd.edu]
Snippet 1 Expected Output
» Test Code Snippet 1 Test Code
» Our Actual Output Our Actual Output from Snippet 1
» Our Failed Test Our Failed Test 1
» Their Actual Output Their Actual Output from Snippet 1
» Their Failed Test Their Failed Test 1

Snippet 2

Markdown Snippet

For this snippet, both MarkdownParse implementations failed their tests. Both implementations outputted a.com(( instead of a.com(()). I feel like this code change may be longer than 10 lines. It looks like both implementations completed the URL early, because of the extra parentheses. A potential fix for this could be to have MarkdownParse count its current position in the parentheses to ensure that it returns the link once the syntax has actually completed. My group’s implementation of MarkdownParse also did not output example.com, probably because of the extra brackets. The fix for this could be similar to that of the previous failure’s solution; having the program count its current position in the brackets to ensure that it actually returns a link when one is present.

» Expected Output [a.com, a.com(()), example.com]
Snippet 2 Expected Output
» Test Code Snippet 2 Test Code
» Our Actual Output Our Actual Output from Snippet 2
» Our Failed Test Our Failed Test 2
» Their Actual Output Their Actual Output from Snippet 2
» Their Failed Test Their Failed Test 2

Snippet 3

Markdown Snippet

For this snippet, both MarkdownParse implementations failed their tests. The second URL is the only one that should have been outputted. The first and last contain line breaks in their syntax, and the second to last’s format is clearly incorrect. Unfortunately, my group’s implementation returned no links, and the other group’s returned three, with one combining another. Again, I feel like this code change may be longer than 10 lines. Like with the previous snippet, there could be a counter for the parentheses to ensure that only URLS with complete syntaxes are being returned (my group). This may be a smaller code change, but there could also be a check for line breaks in the link syntax to ensure that links with line breaks are not returned (other group).

» Expected Output [https://sites.google.com/eng.ucsd.edu/cse-15l-spring-2022/schedule]
Snippet 3 Expected Output
» Test Code Snippet 3 Test Code
» Our Actual Output Our Actual Output from Snippet 3
» Our Failed Test Our Failed Test 3
» Their Actual Output Their Actual Output from Snippet 3
» Their Failed Test Their Failed Test 3