nus-cs2103-AY2223S1 / forum

14 stars 1 forks source link

Choosing testcases for regression testing #32

Open clarence-chew opened 2 years ago

clarence-chew commented 2 years ago

Which testcases are best chosen for regression testing? Share tips on being comprehensive!

  1. Always test empty string
  2. Familiar with another language? Test input with that language
  3. Test input with a lot more spaces than normal
  4. Try to test every code path you have
  5. Do you assume something is a number (or some other format)? Try out a very big number, negative number, decimal, or even text.
RussellDash332 commented 2 years ago

To some extent, it depends on your code. While the five things you mentioned above are definitely applicable to almost all of us, we can definitely add more depending on the code and how are you planning to exploit it.

For example, using Integer.parseInt? We can exploit with supplying a with non-integers of different types just like what you said on point 5.

Another example, my command handlers executes the input like it's a Java code (let's say) so I can add a test whether injecting a malicious Java code will work or not, who knows I can input a Java code that runs a shell script to remove files from your end :)