Testing.

Slides:



Advertisements
Similar presentations
Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Advertisements

Test process essentials Riitta Viitamäki,
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
Components of representation Control dependencies: sequencing of operations –evaluation of if & then –side-effects of statements occur in right order Data.
Testing slides compiled from Alex Aiken’s, Neelam Gupta’s, Tao Xie’s.
COMP8130 and 4130Adrian Marshall 8130 and 4130 Test Execution and Reporting Adrian Marshall.
Adapted from Prof. Necula, CS 169, Berkeley1 Testing V Software Engineering Lecture 7, Spring 2008 Clark Barrett, New York University (with.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Machine-Independent Optimizations Ⅰ CS308 Compiler Theory1.
Introduction to Software Testing
Terms: Test (Case) vs. Test Suite
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Sri Lanka Institute of Information Technology Software Engineering Project – I Clone of Rally GROUP NO : WD-SEP-002 | PROJECT NO :25 PROJECT : CLONE OF.
Coverage Literature of software testing is primarily concerned with various notions of coverage Four basic kinds of coverage: Graph coverage Logic coverage.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Regression Testing. 2  So far  Unit testing  System testing  Test coverage  All of these are about the first round of testing  Testing is performed.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Testing Workflow In the Unified Process and Agile/Scrum processes.
FPGA-Based System Design: Chapter 6 Copyright  2004 Prentice Hall PTR Topics n Design methodologies.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Automatically Repairing Broken Workflows for Evolving GUI Applications Sai Zhang University of Washington Joint work with: Hao Lü, Michael D. Ernst.
Testing and Debugging. Testing Fundamentals  Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Software Testing and Quality Assurance Practical Considerations (1) 1.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Testability.
A Review of Software Testing - P. David Coward
Introduction to Software Testing Part1 Summary & Terms
Paul Ammann & Jeff Offutt
Regression Testing with its types
Form Development (Chapter 6)
Software Testing.
Learning to Program D is for Digital.
CompSci 230 Software Construction
Automated Pattern Based Mobile Testing
Some Simple Definitions for Testing
Aditya P. Mathur Purdue University
Structural testing, Path Testing
BASICS OF SOFTWARE TESTING Chapter 1. Topics to be covered 1. Humans and errors, 2. Testing and Debugging, 3. Software Quality- Correctness Reliability.
Taking an Iteration Down to Code
White-Box Testing.
CSCI1600: Embedded and Real Time Software
Testing, conclusion Based on material by Michael Ernst, University of Washington.
A simple example of program design
Introduction to Software Testing
Objective of This Course
White-Box Testing.
COMP 208/214/215/216 Lecture 3 Planning.
A Few Review Questions.
CS240: Advanced Programming Concepts
Baisc Of Software Testing
Welcome to Corporate Training -1
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Data Flow Analysis Compiler Design
In the Senior Design Center
CSE403 Software Engineering Autumn 2000 More Testing
Bringing more value out of automation testing
Tonga Institute of Higher Education IT 141: Information Systems
Impossible problems.
Tonga Institute of Higher Education IT 141: Information Systems
OPERATING SYSTEMS DEADLOCKS.
Test Cases, Test Suites and Test Case management systems
CSE P 501 – Compilers SSA Hal Perkins Autumn /31/2019
CSCI1600: Embedded and Real Time Software
Software Development Techniques
Introduction Software maintenance:
Software Re-engineering and Reverse Engineering
Presentation transcript:

Testing

Why Testing Researchers investigate many approaches to improving software quality But the world tests > 50% of the cost of software development is testing Testing is consistently a hot research topic

Testing Practice

Outline Manual testing Automated testing Regression testing Code coverage Bug trends

Manual Testing Test cases are lists of instructions “test scripts” Someone manually executes the script Do each action, step-by-step Click on “login” Enter username and password Click “OK” … And manually records results Low-tech, simple to implement

Manual Testing Manual testing is very widespread Why? Because Probably not dominant, but very, very common Why? Because Some tests can’t be automated Usability testing Some tests shouldn’t be automated Not worth the cost

Manual Testing Those are the best reasons There are also not-so-good reasons Not-so-good because innovation could remove them Testers aren’t skilled enough to handle automation Automation tools are too hard to use The cost of automating a test is 10X doing a manual test

Topics Manual testing Automated testing Regression testing Code coverage Bug trends

Automated Testing Idea: This doesn’t work as well as expected Record manual test Play back on demand This doesn’t work as well as expected E.g., Some tests can’t/shouldn’t be automated

Fragility Test recording is usually very fragile Breaks if environment changes anything E.g., location, background color of textbox More generally, automation tools cannot generalize a test They literally record exactly what happened If anything changes, the test breaks A hidden strength of manual testing Because people are doing the tests, ability to adapt tests to slightly modified situations is built-in

Breaking Tests When code evolves, tests break E.g., change the name of a dialog box Any test that depends on the name of that box breaks Maintaining tests is a lot of work Broken tests must be fixed; this is expensive Cost is proportional to the number of tests Implies that more tests is not necessarily better

Improved Automated Testing Recorded tests are too low level E.g., every test contains the name of the dialog box Need to abstract tests Replace dialog box string by variable name X Variable name X is maintained in one place So that when the dialog box name changes, only X needs to be updated and all the tests work again

Data Driven Testing (for Web Applications) Build a database of event tuples < Document, Component, Action, Input, Result > E.g., < LoginPage, Password, InputText, $password, “OK”> A test is a series of such events chained together Complete system will have many relations As complicated as any large database

Discussion Testers have two jobs Clarify the specification Find (important) bugs Only the latter is subject to automation Helps explain why there is so much manual testing

Topics Manual testing Automated testing Regression testing Code coverage Bug trends

Regression Testing Idea When you find a bug, Write a test that exhibits the bug, And always run that test when the code changes, So that the bug doesn’t reappear Without regression testing, it is surprising how often old bugs reoccur

Regression Testing (Cont.) Regression testing ensures forward progress We never go back to old bugs Regression testing can be manual or automatic Ideally, run regressions after every change To detect problems as quickly as possible But, regression testing is expensive Limits how often it can be run in practice Reducing cost is a long-standing research problem

Research in Regression Testing Test selection A change is made at line x, should I rerun the whole regression set?

Efficient Regression Testing Problem: Regression testing is expensive Observation: Changes don’t affect every test And tests that couldn’t change need not be run Idea: Use a conservative static analysis to prune test suite

The Algorithm Two pieces: Run the tests and record for each basic block which tests reach that block After modifications, do a DFS of the new control flow graph. Wherever it differs from the original control flow graph, run all tests that reach that point

Example t1 t2 t3 t1 t3 t2 t1 Label each node of the control flow graph with the set of tests that reach it. t3 t1 t2 t3

More Test minimization Test prioritization A test suite is often redundant, select a minimal set that satisfies a certain criteria Test prioritization Assign test cases different priorities given certain constraints. Greedy algorithms

A Problem How do we know when we are done? Could keep going forever But, testing can only find bugs, not prove their absence We need a proxy for the absence of bugs

Topics Manual testing Automated testing Regression testing Code coverage Bug trends

# of statements executed by suite Code Coverage Idea Code that has never been executed likely has bugs This leads to the notion of code coverage Divide a program into units (e.g., statements) Define the coverage of a test suite to be # of statements executed by suite # of statements

Code Coverage (Cont.) Code coverage has proven value It’s a real metric, though far from perfect But 100% coverage does not mean no bugs E.g., a bug visible after loop executes 1,025 times And 100% coverage is almost never achieved Infeasible paths Ships happen with < 60% coverage High coverage may not even be desirable May be better to devote more time to tricky parts with good coverage

Using Code Coverage Code coverage helps identify weak test suites Code coverage can’t complain about missing code But coverage can hint at missing cases Areas of poor coverage ) areas where not enough thought has been given to specification

More on Coverage Statement coverage Edge coverage Path coverage Def-use coverage

Mutation Coverage Create mutations of the subject program by performing simple transformations x<y transforms to x<=y, x<y+c, … Kill set= all mutations P’ s.t. there exists a test case t P(t)!=P’(t) Adequacy= |kill set| / # of mutations

Topics Manual testing Automated testing Regression testing Code coverage Bug trends

Bug Trends Idea: Measure rate at which new bugs are found Rational: When this flattens out it means The cost/bug found is increasing dramatically There aren’t many bugs left to find

The Big Picture Standard practice Measure progress often Make forward progress (regression testing) Stopping condition (coverage, bug trends)

Test Generation Combinatorial testing Concolic testing.