Transwiki:Common Test Cases

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The purpose of this page is to help suggest some possible test cases you should be running for different types of things one might test.

Purpose[edit source]

The purpose of this page is to get QA engineers thinking out of the box when it comes to testing different permutations of data. This site does not tell you how the system you are testing should react to this data, but is just a suggestion of the type of data you should try to use for testing. Please feel free to add your own permutations to this site.

Data Types[edit source]

String[edit source]

  • Min- (1 less character than the allowable minimum)
  • Min (minimum allowable # of characters)
  • Max (maximum allowable # of characters)
  • Max+ (1 more character than the allowable maximum)
  • Null ("null")
  • Empty ("")
  • Space (" ")
  • Leading Spaces (" abc")
  • Trailing Spaces ("abc ")
  • Spaces in the middle ("abc def")
  • Case Sensitivity ("McLane")
  • Non-alphabetical characters ("abc123")
  • Special characters ("`~!@#$%^&*()_+{}|:"<>?[]\;',./") Note: There are 32 of these
  • Special characters in the middle ("McLane-Smith" or "Smith,Anne")
  • Extended characters (èü)
  • International characters (asian, bi-directional)

Integer[edit source]

  • Min- (1 less than the allowable minimum #)
  • Min (minimum allowable #)
  • Max (maximum allowable #)
  • Max+ (1 more character than the allowable maximum --if you are allowed any size Integer, then you may want to test with a bigger data type)
  • Null ("null")
  • Empty ("")
  • Space (" ")
  • Leading Spaces (" 123")
  • Trailing Spaces ("123 ")
  • Spaces in the middle ("123 456")
  • Non-numeric characters ("abc123")
  • Special characters ("`~!@#$%^&*()_+{}|:"<>?[]\;',./") Note: There are 32 of these
  • Special characters in the middle ("123-456-7890")
  • Leading with Zeros ("000123")
  • Trailing with Zeros ("123000")

Double/Float[edit source]

  • Min- (1 less than the allowable minimum #)
  • Min (minimum allowable #)
  • Max (maximum allowable #)
  • Max+ (1 more character than the allowable maximum --if you are allowed any size double/float, then you may want to test with a bigger data type)
  • Null ("null")
  • Empty ("")
  • Space (" ")
  • Leading Spaces (" 123.84")
  • Trailing Spaces ("123.08 ")
  • Spaces in the middle ("123 456.85")
  • Non-numeric characters ("abc123.04")
  • Special characters ("`~!@#$%^&*()_+{}|:"<>?[]\;',./") Note: There are 32 of these
  • Special characters in the middle ("123.94-456")
  • Leading with Zeros ("000123.5700")
  • Trailing with Zeros
    • With #'s after decimal ("123000.3400")
    • Without #'s after decimal ("123000.0000")
  • Localization
    • Comma verses decimal (10,000 verses 10.000)
  • Characters that represent Floating or Doubles
    • Float (10.00F, 10.00f)
    • Double (10.00D, 10.00d)

Objects[edit source]

  • Null
  • Valid Object
  • Object that can be cast to the correct type of object
    • Example: API takes object Cat, I should pass in object Animal
      • Foo ([CAT]Animal)
    • Example: Api takes object Animal, I should pass in object Cat since it inherited from Animal
      • Foo2 (Cat)

Dates[edit source]

  • Test All Months
  • Test all days of the week
  • Test the first date of each month
  • Test the last day of each month
  • Test days that never exist
    • February 30
  • Leap Year
    • February 29
  • Formatting
    • YY-MM-DD
    • YYYY-MM-DD
    • DD-MM-YY
    • MM-DD-YYYY
    • MM/DD/YY
    • Many others, see your languages date formatting options
    • Note: Different Databases have different formatting for dates
  • Leading/Trailing Zeros
    • 08-01-07
    • 10-30-2010
  • Numerical representation of Months
    • Try each # (1-12)
    • Try 0
    • Try 13
  • Gotchas
    • In Java, the Month is zero-indexed. This means if you pass in 5 (May), it could be interpreted as 6 (June). This is particarly important for dates that are going to be compared.

Times[edit source]

  • AM
    • 12:00 AM
    • 1:10 AM
  • PM
    • 12:00 PM
    • 1:05 PM
  • 24 Hours
    • 00:15 (12:15 am)
    • 03:10 (3:10 am)
    • 13:00 (1:00 pm)
    • 24:00 (12:00 am)
    • 23:55 (11:55 pm)
  • 24 Hours (without colons, military time)
    • 1300 (1:00 pm)
    • 0600 (6:00 am)
  • Midnight on 24 Hour scale
    • 00:00 (12:00am)
  • Start with 0
    • 01:15 AM
    • 00:04 PM
  • End with 0
    • 10:40 AM
    • 11:00 PM
  • Time Zones
  • GMT Offset
    • 16:40 -0800 (4:40pm PST PST standard time)
    • 08:38 -0700 (8:38am PST PDT daylight savings)
  • Daylight Saving Time

Date/Time Permutations[edit source]

  • End of Month/End of Day
  • Start of Month/Start of Day
  • End of Year/End of Day
  • Start of year/Start of day
  • Also see Date & Time Sections of wiki

Arrays[edit source]

  • Min (Index starts at 0)
  • Max
  • Max+ (index out of bounds)
  • Try different types of data based on the elements allowed in that array
    • Example: Array[INT] can only contains ints
    • Example: Array[Animals] could have cat, dog, fish, etc

People Info[edit source]

Address Line[edit source]

  • Regular
  • Max Length for Address
  • Multiple Address Lines (2, 3, 4)
  • Half addresses
    • 115 1/2 Main Ave.
  • Streets with Numbers
    • 194 5th Street
    • 194 Fifth Street
  • With PO Box
  • With Rural Route
  • With Suite/Apt
  • With Mail Stop/Floor
  • Spaces
  • Special Chars
  • Abbreviations

City[edit source]

  • Valid Cities
    • San Diego
    • Dallas
    • Portland
  • Invalid Cities
    • Wahooooo
  • Cities with 2 words in the Name
    • San Jose
    • San Diego
  • Cities with spaces
    • Leading spaces
      • " San Diego"
    • Middle Spaces
      • "San Diego"
    • Trailing spaces
      • "San Diego "
  • Cities with Abbreviations
    • St. Louis
    • St. Paul & Saint Paul
  • One city from each state
    • Montgomery, AL
    • Juneau,AK
    • Phoenix,AZ
    • Little Rock, AR
    • Sacramento,CA
    • Denver,CO
    • Hartford,CT
    • Dover,DE
    • Tallahassee,FL
    • Atlanta,GA
    • Honolulu,HI
    • Boise,ID
    • Springfield,IL
    • Indianapolis,IN
    • Des Moines,IA
    • Topeka,KS
    • Frankfort,KY
    • Baton Rouge,LA
    • Augusta,ME
    • Annapolis,MD
    • Boston,MA
    • Lansing,MI
    • St. Paul,MN
    • Jackson,MS
    • Jefferson City,MO
    • Helena,MT
    • Lincoln,NE
    • Carson City,NV
    • Concord,NH
    • Trenton,NJ
    • Santa Fe,NM
    • Albany,NY
    • Raleigh,NC
    • Bismarck,ND
    • Columbus,OH
    • Oklahoma City,OK
    • Salem,OR
    • Harrisburg,PA
    • Providence,RI
    • Columbia,SC
    • Pierre,SD
    • Nashville,TN
    • Austin,TX
    • Salt Lake City,UT
    • Montpelier,VT
    • Richmond,VA
    • Olympia,WA
    • Charleston,WV
    • Madison,WI
    • Cheyenne,WY
  • City with multiple zip codes
    • Bloomington, IN (zip codes for these are: 47403, 47407)
  • Cities that exist in more than 1 state
    • Kansas City MO and Kansas City KS (more or less one big city)
    • Miami FL and Miami OK (distant, unrelated cities)
    • TODO
  • City with an apostrophe
    • Land O' Lakes, FL
  • City with hyphen
    • Lauderdale-by-the-Sea, FL
  • City with mixed casing
    • McFarland, WI
  • Reference to Some Cities

State[edit source]

  • Full name state
    • California
  • State with Spaces in Name
    • New York
    • North Carolina
  • Abbreviation
    • CA
    • NY
  • Invalid State Names
    • New Land
    • Calibornia
  • Test with all 50 states
  • Test with US Territories
    • Puerto Rico
    • Guam
    • US Virgin Islands
    • Samoa
    • Northern Marianas

Zip[edit source]

  • Valid 5 digit zips
    • 33023 (HOLLYWOOD, FL)
    • 92126 (SAN DIEGO, CA)
  • APO/FPO zip codes
    • 09003
    • 09012
  • Invalid zips
    • 99999
    • 99999-9999
    • 99999 9999
    • 999999999
  • Spacing
    • leading spaces
      • " 92126"
    • Trailing spaces
      • "92126 "
  • Placement of zeros
    • Valid Zip with leading zeros
      • 03911 (YORK HARBOR, ME)
    • Valid Zip with trailing zeros
      • 49120 (NILES, MI)
      • 92126-1010 (SAN DIEGO, CA)
  • Valid 9 digit zip
    • No space/special char
      • 921261010 (SAN DIEGO, CA)
    • spaces
      • single spaces
        • "92126 1010" (SAN DIEGO, CA)
      • multiple spaces
        • "92126 1010" (SAN DIEGO, CA)
    • special char (-, hyphen)
      • hyphen with no spaces
        • 92126-1010 (SAN DIEGO, CA)
      • Hyphen with spaces
        • 92126 -1010 (SAN DIEGO, CA)
        • 92126 - 1010 (SAN DIEGO, CA)

Location (city/state/zip combos)[edit source]

  • Valid City,State,Zip combo
    • San Diego,CA 92126
  • Mismatched City/State/Zip combos
    • Mismatch the city with the state & Zip
      • Orlando, CA 92126 (This is really San Diego)
    • Mismatch the state with the City & Zip
      • San Diego, TX 92126 (This is really CA)
    • Mismatch the Zip with the City & State
      • San Diego, CA 29822 (This is really 92126)
    • Mismatch all 3
      • Dallas, CA 29822
  • Spacing and Commas
    • Spaces
      • "San Diego CA 92126"
    • Multiple Spaces
      • "San Diego CA 92126"
    • Comma
      • "San Diego,CA,92126
    • Multiple Commas
      • "San Diego,,CA,,92126"
    • Spaces & Commas
      • "San Diego, CA 92126"
  • Special Char in between
    • "San Diego#CA#92126"
    • Test all the other keyboard special chars
  • Furthwest point N, W, S, and E for the US
    • Furtherest Northern Point
      • Stevenson St, Barrow, AK
    • Furtherest Southern Point
      • 700 Windsor Lane, Key West, FL, 33040-6415
    • Furtherest Western Point
      • 1613 Pee Rd, Koloa, HI 96756
    • Furtherest Eastern Point
      • 96 Main St,Lubec, ME 04652

Phone[edit source]

  • Area Code
    • No Area Code
      • 555-1212
    • With Valid Area Code
      • 858-555-1212
    • With Invalid Area Code
      • 999-555-1212
  • With Country Code
    • TODO
  • With Special Chars
    • 858#555#1212
  • Formatting
    • With Spaces
      • 858 555 1212
    • With Extension
      • 858-555-1212x123
    • Leading Spaces
      • " 858-555-1212"
    • Trailing Spaces
      • "858-555-1212 "
  • Alpha-Numeric
    • 5A5-1212
    1. of Digits
    • Missing Digits
      • 55-1212
      • 555-121
    • Extra Digits
      • 5555-1212
      • 555-12121
      • 858-555-12121
      • 8581-555-1212
      • 858-5555-1212
  • Starting with 0
    • 095-1112
  • Starting with 1
    • 1-858-555-1212

Email Address[edit source]

See also: email validation
  • Without @
    • Lindablah.com
  • Without com
    • Linda@blah.
  • Without period (.)
    • Linda@blahcom
  • Without Name
    • @blah.com
  • Without blah
    • Linda@.com
  • Invalid special chars
    • Linda!@#$%^&*()+~`=[]\;',/{}|:"<>?.com
  • Valid Special Chars
    • TODO: Need to verify these
    • Hyphen (-)
      • linda-smith@yahoo.com
    • plus sign (+)
      • linda+smith@yahoo.com
    • Underscore (_)
      • linda_smith@yahoo.com
  • Minimum Length
  • Maximum Length
  • Different domains
    • edu (Example: lsmith@ucsd.edu)
    • au (Example: testbunny@100acreswoods.au)
    • org (Example: testbunny@100acreswoods.org)
    • ca (Example: testbunny@100acreswoods.ca)
    • net (Example: testbunny@100acreswoods.net)
    • com (Example: testbunny@100acreswoods.com)
    • gov (Example: testbunny@100acreswoods.gov)

Web URL[edit source]

IP Address[edit source]

TODO

Credit Card Info[edit source]

Credit Card Types[edit source]

  • Valid Types
    • Visa
    • Mastercard
    • AmericanExpress
    • Discover
  • Non-Supported Types
    • Diners Club
    • JCB
  • Abbreviations
    • MC
    • AMEX
  • Case Sensitive
    • AMEX
    • VISA
    • MASTERCARD
    • DISCOVER
  • Spaces
    • Space in middle
      • American Express
    • No spaces
      • AmericanExpress
    • Leading spaces
      • " Visa"
      • " Visa"
    • Trailing spaces
      • "Visa "
      • "Visa "

Lengths[edit source]

  • Valid Lengths (in digits)
    • Visa(13 & 16)
    • Mastercard (16)
    • AmericanExpress (15)
    • Discover (16)
    • Diners Club (14)
    • JCB (16)
  • Invalid Length
    • Card that passes mod10, but is too short
    • Card that passes mod10, but is too long

Formats[edit source]

  • Valid Formats (Specified as valid prefixes for the credit card)
    • Visa - Must start with a '4' ex. (4567,...)
    • Mastercard - Must start with anything between 51-55 inclusive. ex (5100,5300 ...)
    • AmericanExpress (15) - Must start with either a 34 OR 37. ex (3400,3759,...)
    • Discover (16) - Must start with a 6011.
    • Diners Club (14) - Must start with anything between 300-305 OR either 36 and 38. ex (3021,3674,3874,...)
    • JCB (16) - Must start with anything between 352800-358999. ex (355000,357899,...)
  • Invalid Formats
    • Any combinations that do not fit the above criteria including
      • Credit card starts with 0000 and 9999
      • Credit card contains non-digit characters

Mod10[edit source]

  • All valid credit cards MUST pass the mod 10 algorithm on the credit card digits. For more info on mod 10[1]
  • Test card that does not pass mod 10

Expiration[edit source]

  • Time-line
    • Past date/expired
    • Recently expired
    • Present month/year
    • Future month/year
    • Future month/Year -- Extended (far into future)
  • 2 digit expiration for year and month
    • 10/08
  • 2 digit month, 4 digit year
    • 10/2008
  • Abbreviated Month
    • abbreviated month, 2 digit year
      • Aug 08
    • abbreviated month, 4 digit year
      • Aug 2008
  • Expiration dates with zeros
    • months with leading zeros
      • 08/2010
    • months with trailing zeros
      • 10/2009
    • years with leading zeros
      • 11/09
    • years with trailing zeros
      • 11/10
      • 11/2010

Security (3 digit code)[edit source]

  • Min (3 digits)
  • Max+ (4 digits)
  • Null
  • Empty
  • Valid
  • Invalid

Scenarios[edit source]

Login Info[edit source]

Username/Password Combinations[edit source]

  • Special Characters/Minimum/Maximum
  • Combinations
    • Valid username, valid password
    • Valid username, password belonging to another user
    • Valid username, invalid password
    • Invalid username, good password
    • Invalid username, bad password
  • Case senstivity
    • lowercase username
    • uppercase username
    • mixed case username
    • lowercase password
    • uppercase password
    • mixed case password

Web Service & XML Testing[edit source]

Different Types of Empty/Null[edit source]

  • Value = NULL
    • <Name>NULL</NAME>
  • Empty String
    • <Name>""</Name>
    • <Name></Name>
    • </Name>
  • Object = NULL (note: this means that the section of XML is missing, including the tags)
    • there would be no tags for Name

Malformed XML[edit source]

  • Element missing end tag
    • Example: <one> <two> .... </one>
  • Element missing start tag
    • Example: <one> ... </two> </one>
  • Missing right angle bracket
    • Example: <one ... </one>
  • Missing left angle bracket
    • Example: one> ... </one>
  • Multiple root tags
    • Example: <?xml version="1.0" encoding="UTF-8"?> <root1> ... </root1> <root2> ... </root2>
  • Overlapping tags
    • Example: <one> <two> ... </one> </two>
  • Attribute value without quotes
    • Example: <one myAttribute=5> ... </one>
  • Attribute value missing left quote
    • Example: <one myAttribute=5"> ... </one>
  • Attribute value missing right quote
    • Example: <one myAttribute="5> ... </one>
  • Unclosed comment tag before content
    • Example: <!-- ... <one> ... </one>
  • Unclosed comment tag after content
    • Example: <root> ... </root> <!--
  • Empty string

File & Folder[edit source]

  • Permissions
  • Existence
  • Length of Names
  • Type of File
  • TODO

Databases[edit source]

  • Validations before Starting to Test
    • Firewall Timeouts
      • Confirming that the DB Connection Pool times out before the firewall does so that you don't have dead connections to the database
    • Permissions/Access
    • Seeded Data/Confirm that starting data is in database
    • Stored Procedure & Schema Changes
      • Are the Stored Procedures installed in the environment
      • Has the Schema been updated
  • Data
    • Times/Dates
      • Is the system in the right time zone
      • Is the system on a 24 Hour or 12 Hour Clock
      • Is the system synced with the Application Server
      • Can the Millisecond become an issue?
  • Deletion of Data from a Database
    • Physical verses Logical Deletions (Should data ever really be deleted, or just archived?)
  • Commit/Rollback/Transactions
    • Confirm that transactions are properly handled
      • Are things written to the database when they returned an error
      • What status is given if the database cannot processs the request
  • How does the system deal with deadlocks and concurrency issues

Networking[edit source]

Sessions[edit source]

Cookies[edit source]

SSL[edit source]

UI Testing[edit source]

Web Pages[edit source]

Error Behavior[edit source]

  • TODO

Portal Behavior[edit source]

  • TODO

Alt-tags/Mouse-overs[edit source]

  • Confirm there is text on links when you mouse-over them
  • Confirm the use of alt-tags is consistent

Resolution[edit source]

  • 800x600 is the standard, but this will change as monitors become more capable
  • 1280 x 1024 is another typical resolution
  • try at least 1 smaller resolution just so you know how it behaves (ex: 2048x1536)

Resizing browser window[edit source]

  • content should typically remain centered, or stay to the left
  • content should not end up with additional spacing in the middle

Busy Signal[edit source]

  • Anytime the system is doing a search
  • Anytime the system has to go to a server to look up data
  • Anytime the action could take longer than 2 seconds
  • Anytime the user is going to be blocked from doing other activities

Tab Order[edit source]

  • Should be able to tab to all available links
  • Order of tabbing should make sense

Short-cut Keys (Hot Keys)[edit source]

  • not many sites have these, but if they do you'll need to test them (ex: ctlr-s for Save)

Browser Title Bar[edit source]

  • title of page shown should make sense, this will be used for a bookmark, so you might want to make sure they are distinctive

Browser Version[edit source]

  • See Project Requirements
  • TODO

Javascript[edit source]

  • Enabled
  • Disabled

Cookies[edit source]

  • Enabled
  • Disabled

Browser Security[edit source]

  • Differs per browser

Browser Cache[edit source]

  • Make sure you try tests with/without it cleared

Embedded Browsers[edit source]

  • TODO

Accessibility[edit source]

  • TODO (See IEEE)

Pop-Up Blockers[edit source]

  • TODO

Client UI[edit source]

Busy Signal[edit source]

  • Anytime the system is doing a search
  • Anytime the system has to go to a server to look up data
  • Anytime the action could take longer than 2 seconds
  • Anytime the user is going to be blocked from doing other activities

Tab Order[edit source]

Short-cuts Keys[edit source]

  • Anytime you are in a menu
  • Anytime you are doing an action that the user will be doing more than twice
  • Anytime you are doing an action that will be difficult for a QA team to automate (wintree forms)

Window Re-sizing[edit source]

  • Minimize using the minimize link on the title bar
  • Minimize using title bar of application(double click on title bar)
  • Minimize by trying to drag in the corner of the application
  • Minimize by trying to drag in the bottom of the application
  • Maximize using the minimize link on the title bar
  • Maximize using title bar of application(double click on title bar)
  • Maximize by trying to drag in the corner of the application
  • Maximize by trying to drag in the bottom of the application

Closing Window[edit source]

Sending Window to foreground/background[edit source]

Resolution[edit source]

  • Smaller Resolution
    • 800x600
    • 1024x768
  • Average Resolution
    • 1280x1024
    • 1400x1050
    • 1600x1200
  • Larger Resolution
    • 2048x1536

Multi-Monitor[edit source]

General UI Fields & Forms[edit source]

Drop-down[edit source]

  • default value (Ex: default value can be "no selection")
  • All possible values available (Ex: for a state field, is a state missing?)
  • Can I select the value I want

Checkbox[edit source]

  • TODO

Radio Buttons[edit source]

  • TODO

Installation Testing[edit source]

Install[edit source]

Successful Install[edit source]

Note: For all of the validations you need to not only validate what should exist, but to confirm that nothing is installed that should not be present. (a.k.a. Do a complete dif)

  • Validate Registry
  • Validate GAC
  • Validate File System
  • Validate Running Services (windows services)

Canceled Install[edit source]

Failed Install[edit source]

Un-install[edit source]

Successful Un-install[edit source]

Canceled Un-install[edit source]

Failed Un-install[edit source]

Repair[edit source]

Successful Repair[edit source]

Canceled Repair[edit source]

Failed Repair/Unsuccessful Repair[edit source]

Monitoring & Alerts[edit source]

  • TODO

Logging[edit source]

  • TODO

Locale Testing[edit source]

  • Blog post about how sorting strings can vary on different locales
  • Examples of Items Effected by Locale
    • Dollars Amounts/Currency
    • Phone #'s
    • Zip Codes
    • Address Standardization
    • Dates/Times
    • Time zones
    • Reading Style (Right to left?)
    • Character Sets
      • Test with entire available character set for that given locale
      • Ability to retrieve entire character set after storage in DB
    • UI aspects
      • buttons/layout sized for English words
      • Is everything really translated that should be (example: privacy, help, etc)
      • Hot keys (Short-cut keys)
  • Best Practices for Web Services
  • i18n JUnit Testcases
  • Java Tutorial on i18n

Misc[edit source]

Dollar Amounts[edit source]

  • Rounding Off verses truncating
    • 10.56 -> 11 (round up to integer)
    • 10.56 -> 10.6 (round up to nearest decimal)
    • 10.47 -> 10 (round down to integer)
    • 10.477 -> 10.47 (truncated)
  • #'s that End in 0
    • 10
    • 10.0
    • 10.00
    • 1.90
    • 1700.30
    • 10.000