UNCC-EmbeddedSystems-Software_Testing

G everything normal do not exercise error handling

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: inding an error – Tester must have mental model of how software might fail – Should test classes of failure Is not redundant – Testing time and resources are limited – Each test should have a different purpose Should be “best of breed” – Within a set of possible tests, the test with the highest likelihood of finding a class of errors should be used Should be neither too simple nor too complex – Reduces possibility of one error masking another Should test rarely used as well as common code – Code which is not executed often is more likely to have bugs – Tests for the common cases (e.g. everything normal) do not exercise error-handling code – We want to ensure we test rare cases as well Embedded Systems 23 Equivalence Partitioning Divide input domain into data classes Derive test cases from each class Guidelines for class formation based on input condition – Range: define one valid and two invalid equivalence classes R 1N @@ *O S • Valid Equivalence Class: 7<x<30 • Invalid Equivalence Class 1: x <= 7 • Invalid Equivalence Class 2: x >= 30 – Specific value: one valid and two invalid equivalence classes R 5 S • Valid Equivalence Class: x == 20 • Invalid Equivalence Class 1: x < 20 • Invalid Equivalence Class 2: x > 20 – Member of a set: one valid and one invalid equivalence classes – Boolean: one valid and one invalid equivalence classes Embedded Systems 24 Examples of Building Input Domains Character strings representing integers – Valid: optional ‘–’ followed by one or more decimal digits • 5, 39, -13451235 – Invalid: strings not matching description above • 61-, 3-1, Five, 6 3, 65.1 Character strings representing floating point numbers – Valid: optional ‘–’ followed by one or more decimal digits, optional ‘.’ followed by one or more decimal digits • 9.9, -3.14159265, 41 – Invalid: strings not matching above description • 3.8E14, frew, 11/41 Character strings representing latitude – Valid: • Degrees: integer string >= -180 and <= 180 followed by • Minutes: floating point string >= 0.0 and < 60.0 followed by ’ • 31 15.90’, 31 15.90’ – Invalid: strings not matching description • 310 15.90’, 1 -15’, 30 65.90’ Embedded Systems 25 Regression Tests A set of tests which the program has failed in the past When we fix a bug, sometimes we’ll fix it wrong or break something else – Regression testing makes sure the rest of the program still works Test sources – – – – Preplanned (e.g. equivalence class) tests Tests which revealed bugs Customer-reported bugs Lots of randomly generated data Embedded Systems 26 Testability- How Easily Can A Program Be Tested? How we design the software affects testability • Operability –...
View Full Document

Ask a homework question - tutors are online