SlideShare a Scribd company logo
1 of 34
Download to read offline
ULtestingslides.fm
10 March 2003 02:00
                                       University of Limerick                          1 /34



                         Documentation Based Software Testing
                                           David Lorge Parnas, P.Eng,
                                  Ph.D, Dr.h.c., Dr.h.c., FRSC, FACM, FCAE
                                 SFI Fellow, Professor of Software Engineering
                         Director of the Software Quality Research Laboratory (SQRL)
                          Department of Computer Science and Information Systems
                                      Faculty of Informatics and Electronics
                                             University of Limerick

Testing is sometimes viewed as an “add on” step in software development - something you
do to demonstrate that the product is ready for use. Test planning is often postponed until
the development is near its end. This results in incomplete testing, ambiguous test results,
and the release of products of doubtful quality.
After reviewing fundamental software testing issues, we describe a document-driven testing
approach in which test plans and test result evaluation are done with the aid of
documentation prepared throughout the design process. The policies about testing, and
response to test results are determined in advance and high quality standards can be
enforced on a project.
These slides, and others from the SQRL lecture series, are available at:
         http://www.csis.ul.ie/Research/ParnasLectures/Default.HTM

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick             2 /34



                               Why is Software Hard to Test?
1. It has no natural internal boundaries.
2. It is sensitive to minor errors - there is no meaning to “almost right”.
   (chaotic behaviour).
3. There are too many cases to test completely.
4. There is no natural structure to the space of test cases.
5. Interpolation is not valid.
6. There are “sleeper bugs”, making the testing of real-time software much
   more difficult. How long must a single test be?

These are “inherent” properties, not signs of immaturity in the field.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                    3 /34



                               Novice Approaches To Testing
(1) Eureka! It ran.
    • one successful test or a few successful tests means its done
(2)      A number of tests where the answers are easily checked
(3)      Let it run and run and run.
(4)      If an error is noticed, fix and go to 2.
(5)      Test until the product is due.
What’s wrong with this?
    • Much of the program may never be tested.
    • We get is a bunch of anecdotes, but do we know anything beyond those cases.
The hardest question, “Have we tested enough?”.
    • How important is the product?
    • How costly would it be to release an incorrect product?


                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                     University of Limerick             4 /34



                            Some Better Approaches to Testing
1) Test every statement at least once.
2) Test every exit from a branch at least once.
3) Test all possible paths through the program at least once.
These are minimal requirements, but consider a program containing:
                                 y := sqrt(|x|)
and another program in which the above is replaced by:
                                 if x < 0 then y := sqrt(-x);
                                 if x > 0 then y := sqrt(x);
                                 if x = 0 then y := 0;
Does the first program need less testing than the second
The above rules assume that program state is more important than data state.
In fact, program state and data state are distinguished only in our
minds. We often trade program complexity for data complexity.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick       5 /34



                                      Additional Rules
(4) Consider all typical data states
(5) Consider all degenerate data states
(6) Consider extreme cases
(7) Consider erroneous cases.
(8) Try very large numbers
(9) Try very small numbers
(10)Try numbers that are close to each other.
(11)Think of the cases that nobody thinks of.


Nobody can do all of the above.
Nobody can be sure that they have done all of the above.



                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick       6 /34



                                Hierarchical Testing Policies
Testing the whole system at once is usually a mistake.
    • Finding the fault is a nightmare.
    • May be many simultaneous faults.

Test Small Units first.
Integrate after components have passed all tests.

Test lower levels of uses hierarchy before using them.

Bottom Line:
Testing before integration will save time after integration.
Component boundaries must be precisely defined or the units
cannot be tested independently.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                      7 /34



                                  Who Does the Testing?
You are a fool if you don’t test your program!
    • If you do not know some fact, no amount of inspecting your program reveals it.
Your customers/bosses are fools if they don’t test your program?
    • If you overlooked a case in programming, you are likely to overlook it when
      testing.
Many companies have testing specialists in quality assurance departments.
“Cleanroom” model says that you are not allowed to test your program.
     • Increased care yields big improvements in quality.
     • Statistical testing is done by others.
More basic issues:
• All people tend to overlook the same cases. How can we get around this?
    • Can random testing be better than planned testing?
    • Can we plan random testing?
                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                    8 /34



                                   Three Kinds of Testing
Black Box Testing
    • Testing is based on specification alone.
    • Cases are chosen without looking at code.
    • When testing an abstractly specified (information hiding) module you must not
      use information about the data structure.
Clear Box Testing
    • Test choices based on code and data structure.
    • Use code coverage criteria such as those described earlier.
Grey Box Testing
    • Take advantage of knowledge about data structure but not program structure.
    • Unavoidable for modules with memory - testing depends on number of states.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                      9 /34



                       All Three Types Of Testing Have Their Place
Black Box tests:
    • can be re-used with new design
    • can be developed independent of designer - good for acceptance testing.
    • test what you really care about.
Clear Box testing:
    • takes advantage of our knowledge about the program and basic programming
      errors.
    • provides an objective measure of coverage.
    • tests programmer’s “work product”.
Grey Box testing:
    • gives better coverage for black box with memory.
    • can avoid some duplicate tests by detecting return to same state.
    • provides a basis for a measure of testing thoroughness.
                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                      10 /34



 Even in “Black Box” Testing, What’s Inside Makes a Difference!
The number of tests needed to identify a finite state machine depends on
having an upper bound for the number of states.
    • Unless you have an upper bound, you can always invent a machine that passes
      all previous tests but will fail another one.
    • Any statements that we make about thoroughness of testing must be based on
      knowledge of this upper bound.
    • The “tighter” the upper bound, the better your testing strategy.
This is particularly vital when considering interactive systems with memory.
    • What is the length of a test sequence?
    • Why are 200 tests not considered to be a single long test?
    • A test sequence is “over” when you return to a previously tested state, but how
      do you known when that has happened.
    • A pure black box strategy cannot be sound in those situations.
The length of test-trajectories may be limited by re-initialisation.
                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                     11 /34



                          Another Testing Method Classification
Planned Testing
     •Clear Box - based on data state and code coverage criteria
     •Black Box - based on external case coverage and interface specification


“Wild” Random Testing (tests picked without use of knowledge about usage
or specification beyond syntactic interface).
     •Pick arguments using uniform random distribution.
     •Can violate assumptions yielding spurious errors.
     •Any reliability figures obtained aren’t meaningful.


Statistical Random Testing.
     •Requires knowledge of expected usage patterns (operational profile)
     •Testing is designed to approximate actual usage
     •Provides meaningful reliability estimates
     •Only as good as the operational profile.



                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick               12 /34



                         Three ways to Measure Software Quality
All measures assume there is a specification distinguish right from wrong.
Correctness:
    • Does the software always meet the specification?
    • Correct software always meets its specification.
Reliability:
    • What is the probability that the software will work as specified?
    • Can be on a per run or per time period basis.
    • Answer depends on usage.
Trustworthiness:
    • What is the probability that catastrophic flaws remain?
    • Of interest when even a single failure is unacceptable.
Each measure requires a different approach to quality
assurance.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                      13 /34



           When Should we use each of these Quality Measures?
Correctness:
    • Rarely need it!
    • Nice to reach for, hard to get.
    • To a perfectionist, all things are equally important; realists take a different
      attitude.
    • Not our real concern, we accept imperfections.
    • If you have a small finite state space, you can do an exhaustive trial.
    • Binary Decision Diagrams, (BDDs) handle slightly bigger cases.
    • In other cases, use mathematical methods and rigorous proof.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                      14 /34



           When Should we use each of these Quality Measures?
Reliability:
    •   Most relevant when we can consider all errors are equally important,
    •   Useful when there are no unacceptable failures.
    •   Meaningful when statistical characteristics of input are predictable,
    •   Meaningful when we can talk about the expected cost, (e.g. warranty).
    •   Useful when your main concern is inconvenience.
    •   Useful when we want to compare products.


To estimate reliability use statistical testing.
To measure reliability retain data from actual usage.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                        15 /34



           When Should we use Each of these Quality Measures?
Trustworthiness:
    • Use when you can identify unacceptable failures,
    • Use when trust is vital to meeting the requirements,
    • Use when there may be antagonistic “users” (statistics mean little in that case).
We often accept the systems that are unreliable.
We do not use systems that we dare not trust.
Testing alone does not work for trustworthiness unless the state space is
very small.
Testing can be combined with proof by using proof to reduce the state space.
To achieve trustworthiness use formal documentation and systematic
inspections.



                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                16 /34



                         What are the Limits of Software Testing?
“Testing can show the presence of bugs but never their absence.”
(E.W. Dijkstra)
    • False in theory, but true in practice.
In most cases it is impractical to use testing to demonstrate trustworthiness.
One can use testing to assess reliability.


Two sides of a coin:
  •I would not trust an untested program!
       •At Darlington we found serious errors in safety-critical programs that
        had been tested for years!




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                            17 /34



                           Practical Limits of Software Testing?
       (1) It is not usually practical to prove correctness by testing.
       (2) Testing cannot predict availability without data on repair time.
       (3) Reliability predictions based on old versions are not valid.
           • This is a controversial statement. Some do not want to discard the data.
           • You would have to assume that the failure rate is not affected by the repair.
       (4) Testers make the same assumptions as the programmers.
       (5) Planned testing is a source of anecdotes, not data (H.D. Mills).
       (6) Built-in self-tests test for decay, but not designed-in defects.
       (7) Generally, a lot of testing is needed.
       (8) Generating the test cases requires a lot of work.
       (9) Evaluating the results requires at least as much work.
       (10) Specifications are needed but not widely available.
           • Results are often ambiguous - lead to debates.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick             18 /34



             What Does it Mean to talk about Software Reliability?
Software is not a random process.
Software doesn’t usually fail randomly; its behaviour is predictable
It is the input data that introduce randomness.
“Software Reliability” is a measure of the input distribution through a
boolean filter.
Software + Hardware should be assessed as a single component. It is
generally difficult to filter out the hardware effects.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick             19 /34



                 Two Meaningless Measures of Software Reliability
    • The number of errors per 1000 lines.
    • Time derivatives of the number of errors per line.
We never know these numbers - we know only what we found.
They are counting the number of corrections made, not the number of errors.
    • One error may require correcting many lines.
    • Sometimes many lines are corrected when only one was wrong.
The “experts” are measuring the reliability of their programmers, not the
reliability of their programs.


For user and maintainer, it is the failure rate that matters.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                        20 /34



                 How much testing is needed to assess reliability?
(1) Assume that we have the right input distribution (difficult). We will use tests
    selected randomly from this distribution.
(2) Let 1/h be the required reliability.
(3) What is the probability of passing N properly selected tests if each test would
    fail with probability 1/h?
                                         M = (1 - 1/h)N
(4) M is the probability that a marginal product would pass a test of length N.
Some examples for h = 1000
     •N = 500, M = 0.606
     •N = 1000, M = .36700
     •N = 5000, M = .00672
Some examples for h = 1,000,000
     •N = 1,000, 000, M = .36788
     •N = 5000000, N = .00674
Systems with high reliability requirements, are much harder to test.
Some companies use customers to get more tests.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                  21 /34



                           Real-time systems are harder to test
                            than batch (memory free) systems
In real-time systems, a test is a trajectory, not an input state.
The trajectory must be long enough that sleeper bugs are revealed.
There must be an upper limit to the memory of the system.
Systems must be structured with testing in mind.
Most of the memory must be periodically reinitialised.
Testing must be repeated for each mode of the remaining memory.
Defining the probability distribution of trajectories is the hardest part.
Inspection is more important in real-time applications than batch
programs.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                       22 /34



                        How can Precise Design Documents Help?
Let’s review some of the problems about testing.
    •   Component testing requires precise definition of component boundaries.
    •   Statistical data is needed for reliability estimation of components.
    •   Some components may be ready for testing before others.
    •   Generating test cases is prone to oversight and very time consuming.
    •   Evaluating test results is very time consuming and prone to oversight.
    •   Difficult to generate test cases until program is complete.
    •   Difficult to evaluate thoroughness of test coverage.


We will discuss each of these in turn.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                  23 /34



  Component Testing Requires Defined Component Boundaries
When doing “unit testing” you will not be seeing how well two components
interact - you are testing each component separately.
It is essential that you have a specification for that component that is also
used by the programmers who are implementing it and those who are
writing programs that use it.
The module specifications described earlier are perfect as a specification.
    • They can be checked for completeness and consistency.
    • Simulation can be used to check if you have specified what you want.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                          24 /34



             Statistical Data is Needed for Reliability Estimation of
                                  Components.


Operational profiles can be expressed in terms of “traces”
    •   For each canonical trace, specify the likelihood of an extension
    •   Distributions for parameter values can also be specified.
    •   The equivalence classes used need not be the same as in the specification.
    •   Traces can be generated with this statistical data and used for testing.
    •   Denise Woit has done extensive research on this approach.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick             25 /34



     Some Components may be Ready for Testing Before Others.
Modules not yet implemented can be simulated on the basis of these
specification.
The implementors can use the same simulation to test their own work.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                   26 /34



                      Generating Test Cases is Prone to Oversights,
                                 Very Time Consuming
Test case generation can be automated on the basis of a module
specification.
    • Statistical generators can be used as discussed earlier
    • Test cases can be generated by solving equations (von Mohrenschildt)
    • Test coverage can be measured and displayed in tabular form.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                    27 /34



                     Evaluating Test Results is Very Time Consuming
                                 and Prone to Oversight.
Test oracles can be generated from the specification.
    • Program function tables can be translated into boolean expressions provided
      that all quantifiers are over finite, generatable, sets. ‘“Dennis Peters)
    • Module specifications can be translated into simulations using term rewriting
      techniques (Yabo Wang)
        • Note that simulators are more than oracles.
    • Requirements documents can be translated into run-time monitors. (Dennis
      Peters)
        • Note that these only sample - continuous monitoring is not possible.
        • Monitor can also be used as a safety system during operation.
        • Errors in requirements document may occur as well errors in code.
    • Module design documents can be used in grey box testing.
        • One can generate an oracle from the abstraction function.

                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick              28 /34



      Difficult to Generate Test Cases Until Program is Complete.
In industry, testers often do not have enough information to test until they
are given the program to test.
Specifications are open to interpretation.
Specifications are subject to change.


We can do something about the first two problems by writing a module spec.
Test cases can be generated automatically from the specification or by hand.
We cannot do any thing about the third problem except try to discourage it.
If we have automated test case generation, changes in specifications are
easier to handle.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick              29 /34



              Difficult to Evaluate Thoroughness of Test Coverage.
A table with the same structure as a program function table can be generated
from test data that is generated some other way.
This will display the coverage. (Nan Nan Wang)
Coverage of canonical trace classes can also be measured and displayed.
Coverage of abstraction function sub domains can also be measured and
displayed.
Reliability estimates and their confidence level can be computed.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick           30 /34



                                Conclusions About Testing
1) Time spent in documentation can be “paid back” in testing.

2) Testing is difficult, but good documentation will make it easier, much
   easier.

3) Engineers see testing and mathematical analysis as complementary and
   both are necessary.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                        31 /34



            Conclusions About Developing High-Quality Software
Good software can be achieved only by disciplined hard work. That work
includes careful attention to:
    •   precise specification of the requirements that the software must satisfy
    •   decomposition of the software into components
    •   design and documentation of module interfaces
    •   precise documentation of internal module design decisions
    •   writing well structured programs
followed by:
    • systematic inspection of all code and documents, and
    • disciplined testing
Precise Documentation is the key.
Support tools are essential.


                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick                        32 /34



                                The Software Quality Tripod


1) Precise, Organised, Mathematical Documentation and Extensive
   Systematic Review.
2) Extensive Testing
    • Systematic Testing-quick discovery of gross errors
    • Random Testing -discovery of shared oversights and reliability assessment
3) Qualified People and Approved Processes.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick               33 /34



                                           SQRL:
Building a team of researchers to develop, methods, tools, examples.
 • Some will develop tools
    • Some will develop methods
    • Some will work with industrial developers to train and evaluate.
If you know a person who can join the SQRL team, tell them to contact me.




                      • SOFTWARE QUALITY RESEARCH LABORATORY •
ULtestingslides.fm
10 March 2003 02:00
                                    University of Limerick       34 /34



     We are looking for a few “nuts” who want to be different and
                           make a difference




                      • SOFTWARE QUALITY RESEARCH LABORATORY •

More Related Content

What's hot

Different techniques-of-software-testing
Different techniques-of-software-testingDifferent techniques-of-software-testing
Different techniques-of-software-testingpooja deshmukh
 
Functional Safety in ML-based Cyber-Physical Systems
Functional Safety in ML-based Cyber-Physical SystemsFunctional Safety in ML-based Cyber-Physical Systems
Functional Safety in ML-based Cyber-Physical SystemsLionel Briand
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
White box black box & gray box testing
White box black box & gray box testingWhite box black box & gray box testing
White box black box & gray box testingHimanshu
 
Random testing & prototyping
Random testing & prototypingRandom testing & prototyping
Random testing & prototypingVipul Rastogi
 
Ôn tập kiến thức ISTQB
Ôn tập kiến thức ISTQBÔn tập kiến thức ISTQB
Ôn tập kiến thức ISTQBJenny Nguyen
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testingNitishMhaske1
 
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...Kevin Moran
 
Random testing
Random testingRandom testing
Random testingLocaweb
 
Software Testing
Software TestingSoftware Testing
Software TestingKiran Kumar
 
Database Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSDatabase Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSSanil Mhatre
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceLionel Briand
 
Dft (design for testability)
Dft (design for testability)Dft (design for testability)
Dft (design for testability)shaik sharief
 
Decision Support for Security-Control Identification Using Machine Learning
Decision Support for Security-Control Identification Using Machine LearningDecision Support for Security-Control Identification Using Machine Learning
Decision Support for Security-Control Identification Using Machine LearningLionel Briand
 
The Difference between Track and Testing Performance
The Difference between Track and Testing PerformanceThe Difference between Track and Testing Performance
The Difference between Track and Testing Performancefrisksoftware
 

What's hot (20)

Different techniques-of-software-testing
Different techniques-of-software-testingDifferent techniques-of-software-testing
Different techniques-of-software-testing
 
Functional Safety in ML-based Cyber-Physical Systems
Functional Safety in ML-based Cyber-Physical SystemsFunctional Safety in ML-based Cyber-Physical Systems
Functional Safety in ML-based Cyber-Physical Systems
 
Software testing
Software testingSoftware testing
Software testing
 
Vlsi testing
Vlsi testingVlsi testing
Vlsi testing
 
White box black box & gray box testing
White box black box & gray box testingWhite box black box & gray box testing
White box black box & gray box testing
 
testing
testingtesting
testing
 
Ppt19
Ppt19Ppt19
Ppt19
 
H testing and debugging
H testing and debuggingH testing and debugging
H testing and debugging
 
Random testing & prototyping
Random testing & prototypingRandom testing & prototyping
Random testing & prototyping
 
Ôn tập kiến thức ISTQB
Ôn tập kiến thức ISTQBÔn tập kiến thức ISTQB
Ôn tập kiến thức ISTQB
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testing
 
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...
A Large-Scale Empirical Comparison of Static and DynamicTest Case Prioritizat...
 
Random testing
Random testingRandom testing
Random testing
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Database Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTSDatabase Unit Testing Made Easy with VSTS
Database Unit Testing Made Easy with VSTS
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial Intelligence
 
Dft (design for testability)
Dft (design for testability)Dft (design for testability)
Dft (design for testability)
 
Decision Support for Security-Control Identification Using Machine Learning
Decision Support for Security-Control Identification Using Machine LearningDecision Support for Security-Control Identification Using Machine Learning
Decision Support for Security-Control Identification Using Machine Learning
 
The Difference between Track and Testing Performance
The Difference between Track and Testing PerformanceThe Difference between Track and Testing Performance
The Difference between Track and Testing Performance
 
Unit testing
Unit testing Unit testing
Unit testing
 

Similar to David Parnas - Documentation Based Software Testing - SoftTest Ireland

How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingTechWell
 
Software testing part
Software testing partSoftware testing part
Software testing partPreeti Mishra
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software TestingHenry Muccini
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and younelinger
 
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysis
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysisStc 2015 regional-round-ppt-exlopratory mobile testing with risk analysis
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysisArchana Krushnan
 
Testing- Fundamentals of Testing-Mazenet solution
Testing- Fundamentals of Testing-Mazenet solutionTesting- Fundamentals of Testing-Mazenet solution
Testing- Fundamentals of Testing-Mazenet solutionMazenetsolution
 
Sorfware engineering presentation (software testing)
Sorfware engineering presentation (software testing)Sorfware engineering presentation (software testing)
Sorfware engineering presentation (software testing)1Arun_Pandey
 
Lessons Learned in Test Automation From Zombieland
Lessons Learned in Test Automation From ZombielandLessons Learned in Test Automation From Zombieland
Lessons Learned in Test Automation From ZombielandMatt Barbour
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptxmianshafa
 
Black box-software-testing-douglas-hoffman2483
Black box-software-testing-douglas-hoffman2483Black box-software-testing-douglas-hoffman2483
Black box-software-testing-douglas-hoffman2483Chaitanya Kn
 
Software Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet SolutionSoftware Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet SolutionMazenetsolution
 
Testing Plug-in Architectures
Testing Plug-in ArchitecturesTesting Plug-in Architectures
Testing Plug-in ArchitecturesArie van Deursen
 
black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...KrishnaVeni451953
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designMaitree Patel
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing IntroEvozon Test Lab
 
Computer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptComputer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptTrevorChinguwo
 

Similar to David Parnas - Documentation Based Software Testing - SoftTest Ireland (20)

How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated Testing
 
Software testing part
Software testing partSoftware testing part
Software testing part
 
Introduction to Software Testing
Introduction to Software TestingIntroduction to Software Testing
Introduction to Software Testing
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and you
 
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysis
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysisStc 2015 regional-round-ppt-exlopratory mobile testing with risk analysis
Stc 2015 regional-round-ppt-exlopratory mobile testing with risk analysis
 
Testing- Fundamentals of Testing-Mazenet solution
Testing- Fundamentals of Testing-Mazenet solutionTesting- Fundamentals of Testing-Mazenet solution
Testing- Fundamentals of Testing-Mazenet solution
 
Sorfware engineering presentation (software testing)
Sorfware engineering presentation (software testing)Sorfware engineering presentation (software testing)
Sorfware engineering presentation (software testing)
 
Lessons Learned in Test Automation From Zombieland
Lessons Learned in Test Automation From ZombielandLessons Learned in Test Automation From Zombieland
Lessons Learned in Test Automation From Zombieland
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptx
 
Black box-software-testing-douglas-hoffman2483
Black box-software-testing-douglas-hoffman2483Black box-software-testing-douglas-hoffman2483
Black box-software-testing-douglas-hoffman2483
 
Software testing methods
Software testing methodsSoftware testing methods
Software testing methods
 
Software Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet SolutionSoftware Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet Solution
 
Testing Plug-in Architectures
Testing Plug-in ArchitecturesTesting Plug-in Architectures
Testing Plug-in Architectures
 
black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...black-box testing is a type of software testing in which the tester is not co...
black-box testing is a type of software testing in which the tester is not co...
 
Testing
TestingTesting
Testing
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
 
G53 qat09pdf6up
G53 qat09pdf6upG53 qat09pdf6up
G53 qat09pdf6up
 
A Software Testing Intro
A Software Testing IntroA Software Testing Intro
A Software Testing Intro
 
Computer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.pptComputer Software Testing Basics introduced.ppt
Computer Software Testing Basics introduced.ppt
 

More from David O'Dowd

Ios driver presentation copy
Ios driver presentation copyIos driver presentation copy
Ios driver presentation copyDavid O'Dowd
 
Janet Gregory presents Current Testing Challenges with SoftTest Ireland
Janet Gregory presents Current Testing Challenges with SoftTest IrelandJanet Gregory presents Current Testing Challenges with SoftTest Ireland
Janet Gregory presents Current Testing Challenges with SoftTest IrelandDavid O'Dowd
 
Current Testing Challenges Ireland
Current Testing Challenges IrelandCurrent Testing Challenges Ireland
Current Testing Challenges IrelandDavid O'Dowd
 
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ie
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ieGordon baisley - eircom - Introducing the EDM role with www.softtest.ie
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ieDavid O'Dowd
 
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...David O'Dowd
 
Intune Agile Testing Talk with www.softtest.ie
Intune Agile Testing Talk with www.softtest.ieIntune Agile Testing Talk with www.softtest.ie
Intune Agile Testing Talk with www.softtest.ieDavid O'Dowd
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieDavid O'Dowd
 
HMH Agile Testing Lightning Talk with www.softtest.ie
HMH Agile Testing Lightning Talk with www.softtest.ieHMH Agile Testing Lightning Talk with www.softtest.ie
HMH Agile Testing Lightning Talk with www.softtest.ieDavid O'Dowd
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonDavid O'Dowd
 
www.softtest.ie presents Selenium 2 With David Burn's
www.softtest.ie presents Selenium 2 With David Burn'swww.softtest.ie presents Selenium 2 With David Burn's
www.softtest.ie presents Selenium 2 With David Burn'sDavid O'Dowd
 
Agile Test Management - www.softtest.ie
Agile Test Management - www.softtest.ieAgile Test Management - www.softtest.ie
Agile Test Management - www.softtest.ieDavid O'Dowd
 
Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010David O'Dowd
 
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest IrelandMarkus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest IrelandDavid O'Dowd
 
Whittaker How To Break Software Security - SoftTest Ireland
Whittaker How To Break Software Security - SoftTest IrelandWhittaker How To Break Software Security - SoftTest Ireland
Whittaker How To Break Software Security - SoftTest IrelandDavid O'Dowd
 
James Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentJames Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentDavid O'Dowd
 
Neil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandNeil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandDavid O'Dowd
 
Neil Thompson - Thinking tools: from top motors, through software process imp...
Neil Thompson - Thinking tools: from top motors, through software process imp...Neil Thompson - Thinking tools: from top motors, through software process imp...
Neil Thompson - Thinking tools: from top motors, through software process imp...David O'Dowd
 
Tester's are doing it for themselves - Julie Gardiner - SoftTest Ireland
Tester's are doing it for themselves - Julie Gardiner - SoftTest IrelandTester's are doing it for themselves - Julie Gardiner - SoftTest Ireland
Tester's are doing it for themselves - Julie Gardiner - SoftTest IrelandDavid O'Dowd
 
Test Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For SucesssTest Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For SucesssDavid O'Dowd
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005David O'Dowd
 

More from David O'Dowd (20)

Ios driver presentation copy
Ios driver presentation copyIos driver presentation copy
Ios driver presentation copy
 
Janet Gregory presents Current Testing Challenges with SoftTest Ireland
Janet Gregory presents Current Testing Challenges with SoftTest IrelandJanet Gregory presents Current Testing Challenges with SoftTest Ireland
Janet Gregory presents Current Testing Challenges with SoftTest Ireland
 
Current Testing Challenges Ireland
Current Testing Challenges IrelandCurrent Testing Challenges Ireland
Current Testing Challenges Ireland
 
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ie
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ieGordon baisley - eircom - Introducing the EDM role with www.softtest.ie
Gordon baisley - eircom - Introducing the EDM role with www.softtest.ie
 
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...
Subhendu Mohapatra - BearingPoint - Environments Management talk with www.sof...
 
Intune Agile Testing Talk with www.softtest.ie
Intune Agile Testing Talk with www.softtest.ieIntune Agile Testing Talk with www.softtest.ie
Intune Agile Testing Talk with www.softtest.ie
 
Mobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ieMobile Testing Challenges Lighting Talk with www.softtest.ie
Mobile Testing Challenges Lighting Talk with www.softtest.ie
 
HMH Agile Testing Lightning Talk with www.softtest.ie
HMH Agile Testing Lightning Talk with www.softtest.ieHMH Agile Testing Lightning Talk with www.softtest.ie
HMH Agile Testing Lightning Talk with www.softtest.ie
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
 
www.softtest.ie presents Selenium 2 With David Burn's
www.softtest.ie presents Selenium 2 With David Burn'swww.softtest.ie presents Selenium 2 With David Burn's
www.softtest.ie presents Selenium 2 With David Burn's
 
Agile Test Management - www.softtest.ie
Agile Test Management - www.softtest.ieAgile Test Management - www.softtest.ie
Agile Test Management - www.softtest.ie
 
Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010Michael Bolton - Two futures of software testing - Sept 2010
Michael Bolton - Two futures of software testing - Sept 2010
 
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest IrelandMarkus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
 
Whittaker How To Break Software Security - SoftTest Ireland
Whittaker How To Break Software Security - SoftTest IrelandWhittaker How To Break Software Security - SoftTest Ireland
Whittaker How To Break Software Security - SoftTest Ireland
 
James Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environmentJames Lyndsay - Testing in an agile environment
James Lyndsay - Testing in an agile environment
 
Neil Tompson - SoftTest Ireland
Neil Tompson - SoftTest IrelandNeil Tompson - SoftTest Ireland
Neil Tompson - SoftTest Ireland
 
Neil Thompson - Thinking tools: from top motors, through software process imp...
Neil Thompson - Thinking tools: from top motors, through software process imp...Neil Thompson - Thinking tools: from top motors, through software process imp...
Neil Thompson - Thinking tools: from top motors, through software process imp...
 
Tester's are doing it for themselves - Julie Gardiner - SoftTest Ireland
Tester's are doing it for themselves - Julie Gardiner - SoftTest IrelandTester's are doing it for themselves - Julie Gardiner - SoftTest Ireland
Tester's are doing it for themselves - Julie Gardiner - SoftTest Ireland
 
Test Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For SucesssTest Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For Sucesss
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
 

David Parnas - Documentation Based Software Testing - SoftTest Ireland

  • 1. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 1 /34 Documentation Based Software Testing David Lorge Parnas, P.Eng, Ph.D, Dr.h.c., Dr.h.c., FRSC, FACM, FCAE SFI Fellow, Professor of Software Engineering Director of the Software Quality Research Laboratory (SQRL) Department of Computer Science and Information Systems Faculty of Informatics and Electronics University of Limerick Testing is sometimes viewed as an “add on” step in software development - something you do to demonstrate that the product is ready for use. Test planning is often postponed until the development is near its end. This results in incomplete testing, ambiguous test results, and the release of products of doubtful quality. After reviewing fundamental software testing issues, we describe a document-driven testing approach in which test plans and test result evaluation are done with the aid of documentation prepared throughout the design process. The policies about testing, and response to test results are determined in advance and high quality standards can be enforced on a project. These slides, and others from the SQRL lecture series, are available at: http://www.csis.ul.ie/Research/ParnasLectures/Default.HTM • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 2. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 2 /34 Why is Software Hard to Test? 1. It has no natural internal boundaries. 2. It is sensitive to minor errors - there is no meaning to “almost right”. (chaotic behaviour). 3. There are too many cases to test completely. 4. There is no natural structure to the space of test cases. 5. Interpolation is not valid. 6. There are “sleeper bugs”, making the testing of real-time software much more difficult. How long must a single test be? These are “inherent” properties, not signs of immaturity in the field. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 3. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 3 /34 Novice Approaches To Testing (1) Eureka! It ran. • one successful test or a few successful tests means its done (2) A number of tests where the answers are easily checked (3) Let it run and run and run. (4) If an error is noticed, fix and go to 2. (5) Test until the product is due. What’s wrong with this? • Much of the program may never be tested. • We get is a bunch of anecdotes, but do we know anything beyond those cases. The hardest question, “Have we tested enough?”. • How important is the product? • How costly would it be to release an incorrect product? • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 4. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 4 /34 Some Better Approaches to Testing 1) Test every statement at least once. 2) Test every exit from a branch at least once. 3) Test all possible paths through the program at least once. These are minimal requirements, but consider a program containing: y := sqrt(|x|) and another program in which the above is replaced by: if x < 0 then y := sqrt(-x); if x > 0 then y := sqrt(x); if x = 0 then y := 0; Does the first program need less testing than the second The above rules assume that program state is more important than data state. In fact, program state and data state are distinguished only in our minds. We often trade program complexity for data complexity. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 5. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 5 /34 Additional Rules (4) Consider all typical data states (5) Consider all degenerate data states (6) Consider extreme cases (7) Consider erroneous cases. (8) Try very large numbers (9) Try very small numbers (10)Try numbers that are close to each other. (11)Think of the cases that nobody thinks of. Nobody can do all of the above. Nobody can be sure that they have done all of the above. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 6. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 6 /34 Hierarchical Testing Policies Testing the whole system at once is usually a mistake. • Finding the fault is a nightmare. • May be many simultaneous faults. Test Small Units first. Integrate after components have passed all tests. Test lower levels of uses hierarchy before using them. Bottom Line: Testing before integration will save time after integration. Component boundaries must be precisely defined or the units cannot be tested independently. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 7. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 7 /34 Who Does the Testing? You are a fool if you don’t test your program! • If you do not know some fact, no amount of inspecting your program reveals it. Your customers/bosses are fools if they don’t test your program? • If you overlooked a case in programming, you are likely to overlook it when testing. Many companies have testing specialists in quality assurance departments. “Cleanroom” model says that you are not allowed to test your program. • Increased care yields big improvements in quality. • Statistical testing is done by others. More basic issues: • All people tend to overlook the same cases. How can we get around this? • Can random testing be better than planned testing? • Can we plan random testing? • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 8. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 8 /34 Three Kinds of Testing Black Box Testing • Testing is based on specification alone. • Cases are chosen without looking at code. • When testing an abstractly specified (information hiding) module you must not use information about the data structure. Clear Box Testing • Test choices based on code and data structure. • Use code coverage criteria such as those described earlier. Grey Box Testing • Take advantage of knowledge about data structure but not program structure. • Unavoidable for modules with memory - testing depends on number of states. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 9. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 9 /34 All Three Types Of Testing Have Their Place Black Box tests: • can be re-used with new design • can be developed independent of designer - good for acceptance testing. • test what you really care about. Clear Box testing: • takes advantage of our knowledge about the program and basic programming errors. • provides an objective measure of coverage. • tests programmer’s “work product”. Grey Box testing: • gives better coverage for black box with memory. • can avoid some duplicate tests by detecting return to same state. • provides a basis for a measure of testing thoroughness. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 10. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 10 /34 Even in “Black Box” Testing, What’s Inside Makes a Difference! The number of tests needed to identify a finite state machine depends on having an upper bound for the number of states. • Unless you have an upper bound, you can always invent a machine that passes all previous tests but will fail another one. • Any statements that we make about thoroughness of testing must be based on knowledge of this upper bound. • The “tighter” the upper bound, the better your testing strategy. This is particularly vital when considering interactive systems with memory. • What is the length of a test sequence? • Why are 200 tests not considered to be a single long test? • A test sequence is “over” when you return to a previously tested state, but how do you known when that has happened. • A pure black box strategy cannot be sound in those situations. The length of test-trajectories may be limited by re-initialisation. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 11. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 11 /34 Another Testing Method Classification Planned Testing •Clear Box - based on data state and code coverage criteria •Black Box - based on external case coverage and interface specification “Wild” Random Testing (tests picked without use of knowledge about usage or specification beyond syntactic interface). •Pick arguments using uniform random distribution. •Can violate assumptions yielding spurious errors. •Any reliability figures obtained aren’t meaningful. Statistical Random Testing. •Requires knowledge of expected usage patterns (operational profile) •Testing is designed to approximate actual usage •Provides meaningful reliability estimates •Only as good as the operational profile. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 12. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 12 /34 Three ways to Measure Software Quality All measures assume there is a specification distinguish right from wrong. Correctness: • Does the software always meet the specification? • Correct software always meets its specification. Reliability: • What is the probability that the software will work as specified? • Can be on a per run or per time period basis. • Answer depends on usage. Trustworthiness: • What is the probability that catastrophic flaws remain? • Of interest when even a single failure is unacceptable. Each measure requires a different approach to quality assurance. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 13. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 13 /34 When Should we use each of these Quality Measures? Correctness: • Rarely need it! • Nice to reach for, hard to get. • To a perfectionist, all things are equally important; realists take a different attitude. • Not our real concern, we accept imperfections. • If you have a small finite state space, you can do an exhaustive trial. • Binary Decision Diagrams, (BDDs) handle slightly bigger cases. • In other cases, use mathematical methods and rigorous proof. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 14. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 14 /34 When Should we use each of these Quality Measures? Reliability: • Most relevant when we can consider all errors are equally important, • Useful when there are no unacceptable failures. • Meaningful when statistical characteristics of input are predictable, • Meaningful when we can talk about the expected cost, (e.g. warranty). • Useful when your main concern is inconvenience. • Useful when we want to compare products. To estimate reliability use statistical testing. To measure reliability retain data from actual usage. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 15. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 15 /34 When Should we use Each of these Quality Measures? Trustworthiness: • Use when you can identify unacceptable failures, • Use when trust is vital to meeting the requirements, • Use when there may be antagonistic “users” (statistics mean little in that case). We often accept the systems that are unreliable. We do not use systems that we dare not trust. Testing alone does not work for trustworthiness unless the state space is very small. Testing can be combined with proof by using proof to reduce the state space. To achieve trustworthiness use formal documentation and systematic inspections. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 16. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 16 /34 What are the Limits of Software Testing? “Testing can show the presence of bugs but never their absence.” (E.W. Dijkstra) • False in theory, but true in practice. In most cases it is impractical to use testing to demonstrate trustworthiness. One can use testing to assess reliability. Two sides of a coin: •I would not trust an untested program! •At Darlington we found serious errors in safety-critical programs that had been tested for years! • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 17. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 17 /34 Practical Limits of Software Testing? (1) It is not usually practical to prove correctness by testing. (2) Testing cannot predict availability without data on repair time. (3) Reliability predictions based on old versions are not valid. • This is a controversial statement. Some do not want to discard the data. • You would have to assume that the failure rate is not affected by the repair. (4) Testers make the same assumptions as the programmers. (5) Planned testing is a source of anecdotes, not data (H.D. Mills). (6) Built-in self-tests test for decay, but not designed-in defects. (7) Generally, a lot of testing is needed. (8) Generating the test cases requires a lot of work. (9) Evaluating the results requires at least as much work. (10) Specifications are needed but not widely available. • Results are often ambiguous - lead to debates. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 18. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 18 /34 What Does it Mean to talk about Software Reliability? Software is not a random process. Software doesn’t usually fail randomly; its behaviour is predictable It is the input data that introduce randomness. “Software Reliability” is a measure of the input distribution through a boolean filter. Software + Hardware should be assessed as a single component. It is generally difficult to filter out the hardware effects. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 19. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 19 /34 Two Meaningless Measures of Software Reliability • The number of errors per 1000 lines. • Time derivatives of the number of errors per line. We never know these numbers - we know only what we found. They are counting the number of corrections made, not the number of errors. • One error may require correcting many lines. • Sometimes many lines are corrected when only one was wrong. The “experts” are measuring the reliability of their programmers, not the reliability of their programs. For user and maintainer, it is the failure rate that matters. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 20. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 20 /34 How much testing is needed to assess reliability? (1) Assume that we have the right input distribution (difficult). We will use tests selected randomly from this distribution. (2) Let 1/h be the required reliability. (3) What is the probability of passing N properly selected tests if each test would fail with probability 1/h? M = (1 - 1/h)N (4) M is the probability that a marginal product would pass a test of length N. Some examples for h = 1000 •N = 500, M = 0.606 •N = 1000, M = .36700 •N = 5000, M = .00672 Some examples for h = 1,000,000 •N = 1,000, 000, M = .36788 •N = 5000000, N = .00674 Systems with high reliability requirements, are much harder to test. Some companies use customers to get more tests. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 21. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 21 /34 Real-time systems are harder to test than batch (memory free) systems In real-time systems, a test is a trajectory, not an input state. The trajectory must be long enough that sleeper bugs are revealed. There must be an upper limit to the memory of the system. Systems must be structured with testing in mind. Most of the memory must be periodically reinitialised. Testing must be repeated for each mode of the remaining memory. Defining the probability distribution of trajectories is the hardest part. Inspection is more important in real-time applications than batch programs. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 22. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 22 /34 How can Precise Design Documents Help? Let’s review some of the problems about testing. • Component testing requires precise definition of component boundaries. • Statistical data is needed for reliability estimation of components. • Some components may be ready for testing before others. • Generating test cases is prone to oversight and very time consuming. • Evaluating test results is very time consuming and prone to oversight. • Difficult to generate test cases until program is complete. • Difficult to evaluate thoroughness of test coverage. We will discuss each of these in turn. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 23. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 23 /34 Component Testing Requires Defined Component Boundaries When doing “unit testing” you will not be seeing how well two components interact - you are testing each component separately. It is essential that you have a specification for that component that is also used by the programmers who are implementing it and those who are writing programs that use it. The module specifications described earlier are perfect as a specification. • They can be checked for completeness and consistency. • Simulation can be used to check if you have specified what you want. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 24. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 24 /34 Statistical Data is Needed for Reliability Estimation of Components. Operational profiles can be expressed in terms of “traces” • For each canonical trace, specify the likelihood of an extension • Distributions for parameter values can also be specified. • The equivalence classes used need not be the same as in the specification. • Traces can be generated with this statistical data and used for testing. • Denise Woit has done extensive research on this approach. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 25. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 25 /34 Some Components may be Ready for Testing Before Others. Modules not yet implemented can be simulated on the basis of these specification. The implementors can use the same simulation to test their own work. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 26. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 26 /34 Generating Test Cases is Prone to Oversights, Very Time Consuming Test case generation can be automated on the basis of a module specification. • Statistical generators can be used as discussed earlier • Test cases can be generated by solving equations (von Mohrenschildt) • Test coverage can be measured and displayed in tabular form. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 27. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 27 /34 Evaluating Test Results is Very Time Consuming and Prone to Oversight. Test oracles can be generated from the specification. • Program function tables can be translated into boolean expressions provided that all quantifiers are over finite, generatable, sets. ‘“Dennis Peters) • Module specifications can be translated into simulations using term rewriting techniques (Yabo Wang) • Note that simulators are more than oracles. • Requirements documents can be translated into run-time monitors. (Dennis Peters) • Note that these only sample - continuous monitoring is not possible. • Monitor can also be used as a safety system during operation. • Errors in requirements document may occur as well errors in code. • Module design documents can be used in grey box testing. • One can generate an oracle from the abstraction function. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 28. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 28 /34 Difficult to Generate Test Cases Until Program is Complete. In industry, testers often do not have enough information to test until they are given the program to test. Specifications are open to interpretation. Specifications are subject to change. We can do something about the first two problems by writing a module spec. Test cases can be generated automatically from the specification or by hand. We cannot do any thing about the third problem except try to discourage it. If we have automated test case generation, changes in specifications are easier to handle. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 29. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 29 /34 Difficult to Evaluate Thoroughness of Test Coverage. A table with the same structure as a program function table can be generated from test data that is generated some other way. This will display the coverage. (Nan Nan Wang) Coverage of canonical trace classes can also be measured and displayed. Coverage of abstraction function sub domains can also be measured and displayed. Reliability estimates and their confidence level can be computed. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 30. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 30 /34 Conclusions About Testing 1) Time spent in documentation can be “paid back” in testing. 2) Testing is difficult, but good documentation will make it easier, much easier. 3) Engineers see testing and mathematical analysis as complementary and both are necessary. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 31. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 31 /34 Conclusions About Developing High-Quality Software Good software can be achieved only by disciplined hard work. That work includes careful attention to: • precise specification of the requirements that the software must satisfy • decomposition of the software into components • design and documentation of module interfaces • precise documentation of internal module design decisions • writing well structured programs followed by: • systematic inspection of all code and documents, and • disciplined testing Precise Documentation is the key. Support tools are essential. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 32. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 32 /34 The Software Quality Tripod 1) Precise, Organised, Mathematical Documentation and Extensive Systematic Review. 2) Extensive Testing • Systematic Testing-quick discovery of gross errors • Random Testing -discovery of shared oversights and reliability assessment 3) Qualified People and Approved Processes. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 33. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 33 /34 SQRL: Building a team of researchers to develop, methods, tools, examples. • Some will develop tools • Some will develop methods • Some will work with industrial developers to train and evaluate. If you know a person who can join the SQRL team, tell them to contact me. • SOFTWARE QUALITY RESEARCH LABORATORY •
  • 34. ULtestingslides.fm 10 March 2003 02:00 University of Limerick 34 /34 We are looking for a few “nuts” who want to be different and make a difference • SOFTWARE QUALITY RESEARCH LABORATORY •