1 / 25

Black box testing

Black box testing. Black box tests focus on the input/output behavior of the component Black-box tests do not deal with the internal aspects of the component nor with the behavior or the structure of the components. Equivalence testing.

enye
Download Presentation

Black box testing

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. Black box testing • Black box tests focus on the input/output behavior of the component • Black-box tests do not deal with the internal aspects of the component nor with the behavior or the structure of the components

  2. Equivalence testing • Equivalence testing is a black box testing technique that minimizes the number of test cases

  3. Equivalence testing • The possible inputs are partitioned into equivalence classes, a test case is selected for each class • The assumption of equivalence testing is that systems usually behave in similar ways for all members of a class

  4. Equivalence testing • Equivalence testing consists of two steps: • identification of the equivalence classes • selection of the test inputs

  5. Equivalence classes • Coverage: every possible input belongs to one of the equivalence classes • Disjointedness: no input belongs to more than one equivalence class • I.e., partition

  6. Equivalence classes • Representation: if the execution demonstrates an error when a particular member of a equivalence class is used as input, then the same error can be detected by using any other member of the class as input.

  7. Test cases • For each equivalence class, at least two pieces of data are selected • a typical input, which exercises the common case • an invalid input, which exercises the exception handling capabilities of the component

  8. Boundary testing • Boundary testing is a special case of equivalence testing and focuses on the conditions at the boundary of the equivalence classes

  9. Boundary testing • The assumption behind boundary testing is that developers often overlook special cases at the boundary of the equivalence classes • E.g., • Empty strings • Year 2000 (millennium bug) • …

  10. Int converter (again) • A function converts a sequence of chars in an integer number. • The sequence can start with a ‘-‘ (negative number). • The integer number must be in the range minint = -32768 to maxint = 32767. • The function signals an error if the sequence of chars is not allowed • The sequence must be <= 6 chars

  11. Int converter (again) • Define equivalence classes, and related boundary condition • For each class, define at least one test case

  12. Criterion • Input is a decimal number (well formed integer) • Valid: may start with –, no characters that are not digits • Invalid: … • Boundary: Starting “+”? Blanks?

  13. Criterion • Length of string, number of characters • Valid: <= 6 • Invalid: > 6 • Boundary: 6, 0

  14. Criterion • Range of number in output • Valid: <= maxint, >= minint • Invalid: > maxint, < minint • Boundary: maxint, minint

  15. Calendar BB Consider a method that returns the number of days in a month, given the month and year. publicclassMyGregorianCalendar { publicstaticintgetNumDaysInMonth(int x, int y){ ... } The month and the year are specified as integers. By convention, 1 represents the month of January, 2 the month of February, and so on. The range of valid inputs for the year is 0 to maxInt. • define equivalence classes, and related boundary condition • for each class, define at least one test case

  16. Classes for month parameter • Three equivalence classes: • months with 31 days (i.e., 1, 3, 5, 7, 8, 10, 12) • months with 30 days (i.e., 4, 6, 9, 11) • February, which can have 28 or 29 days • Nonpositive integers and integers larger than 12 are invalid values

  17. Classes for year parameter • Two equivalence classes: • leap years • non–leap years • Negative integers are invalid values

  18. Selected valid inputs

  19. Additional boundary cases

  20. Equivalence classes definition • An interval condition will have classes for • Valid input within the interval • Invalid input less than the minimum • Invalid input greater than the maximum • Valid input close the boundaries • A single value condition will have classes for: • The valid value • Invalid values less than the value • Invalid values greater than the value

  21. Equivalence classes definition • A discrete set condition will have classes for: • Each value in the set • A value not belonging to the set • A boolean value condition will have classes for: • TRUE value • FALSE value

  22. Parallelogram • The function parallelogram(int x1, int x2, int x3, int x4, int y1, int y2, int y3, int y4) calculate the area of a parallelogram.

  23. Parallelogram • Requirements • area is always strictly > 0 • The parallelogram should stay in the first quadrant of the Cartesian plan • Define equivalence classes and tests

  24. Criteria • Pair sides parallelism • Pair same sides length • Position (1st quadrant) • Area > 0

More Related