Docsity

Bug Taxonomy and Impact: Requirements Bugs vs Design and Code Bugs - Prof. Wei-Tek Tsai, Study notes of Computer Science

Toggle sidebar
bg1
September 29, 2003
CSE565
Announcements:
Midterms will be on 10/8 and 11/5 – Closed book
Covered last class:
- Bug Taxonomy
- Life cycle of bugs (requirements bugs, design bugs, coding bugs)
BUGS Requirements Design Code
Requirements Doc X
Design Doc X X
Code X X X
X = The document is affected by a bug that is introduced in that phase. This
demonstrates that a bug introduced in the requirements phase has a greater impact than
one introduced in design or coding.
In general, the degree of impact is different for each type of bug:
Impact(Requirements Bug) > Impact(Design Bug) > Impact(Code Bug)
Can we assign a numerical value to these bugs?
Only arbitrary values can be assigned:
Requirements Bugs: 2-100
Design Bugs: 2-10
Coding: The least impact
Requirements Bugs
Non-functional issues (such as reliability, safety, maintainability, security) are
sometimes more important than functional issues, which are usually related to
behavior.
MUTATION TESTING
Q: How do we apply mutation testing?
A: We can examine the bug taxonomy, distribution of bugs among categories, to
determine tests. (see B. Beija’s Software Testing, 2nd edition circa 1990)
For example, we may have a set of testing techniques that make up our test set,
“T”. Additionally, we have a bug taxonomy. To apply mutation testing, we make
a change (“delta”) for each type of bug from the bug taxonomy to see if the tests
work.
pf3
pf4

Partial preview of the text

Download Bug Taxonomy and Impact: Requirements Bugs vs Design and Code Bugs - Prof. Wei-Tek Tsai and more Study notes Computer Science in PDF only on Docsity!

September 29, 2003 CSE Announcements: Midterms will be on 10/8 and 11/5 – Closed book Covered last class:

  • Bug Taxonomy
  • Life cycle of bugs (requirements bugs, design bugs, coding bugs) BUGS Requirements Design Code Requirements Doc X Design Doc X X Code X X X X = The document is affected by a bug that is introduced in that phase. This demonstrates that a bug introduced in the requirements phase has a greater impact than one introduced in design or coding. In general, the degree of impact is different for each type of bug: Impact(Requirements Bug) > Impact(Design Bug) > Impact(Code Bug) Can we assign a numerical value to these bugs? Only arbitrary values can be assigned: Requirements Bugs: 2- Design Bugs: 2- Coding: The least impact Requirements Bugs Non-functional issues (such as reliability, safety, maintainability, security) are sometimes more important than functional issues, which are usually related to behavior. MUTATION TESTING Q: How do we apply mutation testing? A: We can examine the bug taxonomy, distribution of bugs among categories, to determine tests. (see B. Beija’s Software Testing, 2nd^ edition circa 1990) For example, we may have a set of testing techniques that make up our test set, “T”. Additionally, we have a bug taxonomy. To apply mutation testing, we make a change (“delta”) for each type of bug from the bug taxonomy to see if the tests work.

Path P0  P0’ Data P1  P1’ Computation P2  P3’ Interface P3  P3’ Use T to test P0’….P3’, to see if the bugs are detected. To examine our effectiveness, we can make a table of the types of bugs and see if we have enough tests to cover all cases: Bug Taxonomy T(XYZ) Path 20 10 50% Random 5 5 100% Data Flow 5 5 100% In the example above, we can conclude the following about XYZ Testing technique based on the samples given: our coverage of path bugs are not as good as our coverage of random and data flow bugs. Life-Cycle Mutation Testing What is the most costly bug to introduce? How do you introduce them?

  • Requirements Bugs: Most costly (To introduce a requirement bug, you need to make a change in the requirements document, and faithfully design the system to meet the “wrong” requirements, then implement the system according to the “wrong” design.)
  • Design Bugs: Costly – bugs carry down to code (To introduce a design bug, do the same as for requirement bug, except, use the correct requirements document. Introduce a bug in the design document and faithfully implement the system based on the “wrong” design)
  • Coding Bugs: Can happen any time a change to the code is made (To introduce a coding bug, simply make a change to the code). The data collected by Dr. Tsai’s research group shows the premise mentioned above is true: Impact(Requirements Bug) >> Impact(Design Bug) >> Impact(Code Bug) Also: Impact(Path Testing) >> Impact(other testing techniques) The least important testing technique: Data Flow testing. This is because the testing is not needed if you simply initialize all of your variables. More information can be found in the attached article mentioned in class, Evaluation of Expert System Testing Methods by Shekhar Kirani, … Wei-Tek Tsai.

It is sufficient to run T’ on P’ and still consider it “safe”. But how do we know what T’ is, and what parts of T can be thrown out? Usually we don’t. Instead of trying to construct T’, we usually run all of T instead. In this case, when the parts of T that don’t apply to P’ (T’’) are run, we will get a wrong answer. By getting these wrong answers we actually are revalidating the test results! Regression Testing Process Stated Process:

  • Select test cases (the hard work)
  • Run test cases
  • Examine results Actual process usually followed:
  • Run everything
  • Look at the results (the hard work) In the actual process, the test cases don’t have to be selected, so a lot of the hard work is removed. Now the hardest part is just to examine the results. Most regression testing literature deals with test case reduction. By reducing the test cases, the testing may not be “safe”. The reduction process itself may also be costly. In addition, many of the test case reduction algorithms are wrong or useless! Dr. Tsai’s group found that none of the known algorithm reduced the test sets at all. The principle of test case reduction is to identify T’’ (the unnecessary tests) from T’ when a part of program P is changed or deleted. Binder’s book, The Testing of Object- Oriented Programs discusses this concept in detail. Question for next class: How do you identify T’’?