0

In the sanity checks section of pset7's specifications:

  • Do your pages detect and handle invalid inputs properly?

To what extent are we supposed to validate input? I could use regular expressions where applicable, and also limit the length of the string input. In the end however, implementing these things can take more time than completing the pset's other requirements. I shouldn't have to spend more time ensuring the site is completely bug-free than actually working on the other objectives of the pset.

1 Answer 1

1

I interpreted that requirement more narrowly.

From the spec, for instance:

Of course, you’ll need to ensure that a user cannot spend more cash than he or she has on hand. And you’ll want to make sure that users can only buy whole shares of stocks, not fractions thereof. .
. and
.
Of course, if the user submits an invalid symbol (for which lookup returns false), be sure to inform the user somehow.

And FWIW, I wholeheartedly agree:

I shouldn't have to spend more time ensuring the site is completely bug-free than actually working on the other objectives of the pset.

Good grief, if all programmers had to ensure all sites were completely bug-free, there would be like 3 pages on the whole internet! :)

1
  • I have already made sure neither of those two things specified above is possible. My primary concern though, was that by submitting a string like "<>" crashes the server temporarily, but really the staff's solution is vulnerable to the same thing as well. Commented Oct 14, 2016 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .