1 / 8

Testing PRACTICES

Testing PRACTICES. Testing Models. Whitebox testing Testing guided by the internals of the system Usually have access to the source code Black box testing No knowledge of the internals of the system

hank
Download Presentation

Testing PRACTICES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Testing PRACTICES

  2. Testing Models • Whitebox testing • Testing guided by the internals of the system • Usually have access to the source code • Black box testing • No knowledge of the internals of the system • Have to use intuition about how the system might be designed and where possible edge/corner cases are

  3. Whitebox Testing • Statement coverage • Testing such that every line of a program is executed • Branch testing • Testing every branch of a program • Path testing • Testing every possible path through a program

  4. How is Statement testing different from Branch testing? int main(intargc, char *argv[]) { inti = -1; if (argc != 15) i = 0; return i; }

  5. A case for path testing void foo(char *buf, int n, intshould_free) { if (should_free) free(buf); if (n > 10) printf(“%s\n”, buf); }

  6. What should we test? • ./readnames filename • Reads names (“FirstnameLastname”) from a file • 1 name per line

  7. Break it down • Test command line arguments • Too few arguments • Too many arguments • Wrong type of arguments • filename does not exist • filename is not a file (directory) • filename is not a readable file

  8. Testing the file • Test an empty file (0 byte file) • Test a file with only a single line • Test incomplete lines • Test lines with more than 2 terms • Lines with extra whitespace (trailing / leading/ in between) • EOF partway through the file

More Related