nus-cs2113-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Corrupted data on testArticleScraper.txt will result in program crash #6

Open nus-se-script opened 2 months ago

nus-se-script commented 2 months ago

Description:

When I modified testArticleScraper.txt and deleted some of the text. There is no validation to check for corrupted data. When I launched the program, it crashed after I entered my name presumptuously because the program cannot load the articles properly due to corrupted files

Steps to Reproduce:

Edit the text file "testArticleScraper.txt" as shown

"Kristen Wiig initiated into SNL fivetimers club by Ryan Gosling Matt Damon and Lorne Michaels CNN;Alli Rosenbloom;April 07, 2024;CNN;https://edition.cnn.com/2024/04/07/entertainment/kristen-wiig-ryan-gosling-matt-damon-snl/index.html;Kristen Wiig got inducted into the coveted Saturday Night Live fivetimers club in style this weekend when she hosted the longrunning NBC sketch show for the fifth time and she had a little bit of help from some huge stars;Entertainment The Matrix has a fifth film in the works and no this is not a simulation CNN;Alli Rosenbloom;April 03, 2024;CNN;https://edition.cnn.com/2024/04/03/entertainment/matrix-fifth-movie/index.html;Red pill or blue pill anyone A fifth installment of the beloved scifi film franchise The Matrix is in the works;Entertainment Dune Part Two may be followed by a third film but Timothe Chalamet and Zendaya dont know how it all ends CNN;Unknown;March 04, 2024;CNN;https://edition.cnn.com/2024/03/04/entertainment/dune-part-two-sequel/index.html;Dune Part Two spiced up the box office with a 815 million opening weekend becoming the biggest film so far of 2024;Entertainment Angelina Jolie alleges history of Brad Pitts physical abuse prior to 2016 plane ride in new Miraval filing CNN;Alli Rosenbloom;April 05, 2024;CNN;https://edition.cnn.com/2024/04/04/entertainment/angelina-jolie-brad-pitt-abuse-history/index"

Relaunch the program and enter a random name. The program will crash

Actual Result: The program should check for corrupted data and generate new data if it detects any corrupted data.

image.png


[original: nus-cs2113-AY2324S2/pe-interim#6] [original labels: type.FeatureFlaw severity.Medium]

HiteshriAcharya commented 2 months ago

Team's Response

Ah, I see what's happened here. You edited the scraper file, which isn't quite what we had in mind. Just a gentle reminder: the file's already set up correctly for our database, so manual adjustments aren't necessary. Running the scraper each time might slow things down a tad. Thanks for bringing it to our attention, though. Perhaps clearer documentation about not tinkering with the file would help prevent this.

Duplicate status (if any):

Duplicate of #1988