Software Testing CS 121 “Ordering Chaos” “Mike” Michael A. Erlinger

Slides:



Advertisements
Similar presentations
Software Testing mae. Admin Need schedule of meeting with graders for user test Rubrics for Arch Eval posted Scheduled for next Tuesday will be posted.
Advertisements

Test Yaodong Bi.
Test process essentials Riitta Viitamäki,
Testing and Quality Assurance
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
1 CODE TESTING Principles and Alternatives. 2 Testing - Basics goal - find errors –focus is the source code (executable system) –test team wants to achieve.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Testing Name: Madam Currie Course: Swen5431 Semester: Summer 2K.
High Level: Generic Test Process (from chapter 6 of your text and earlier lesson) Test Planning & Preparation Test Execution Goals met? Analysis & Follow-up.
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
Chapter 13 & 14 Software Testing Strategies and Techniques
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Terms: Test (Case) vs. Test Suite
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Software Testing. Definition To test a program is to try to make it fail.
TESTING.
CompSci 230 Software Design and Construction
Test plans CSCI102 - Systems ITCS905 - Systems MCS Systems.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Testing.
Understand Application Lifecycle Management
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
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.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
16 October Reminder Types of Testing: Purpose  Functional testing  Usability testing  Conformance testing  Performance testing  Acceptance.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Approaches to ---Testing Software Some of us “hope” that our software works as opposed to “ensuring” that our software works? Why? Just foolish Lazy Believe.
Integration testing Integrate two or more module.i.e. communicate between the modules. Follow a white box testing (Testing the code)
Software Testing Mehwish Shafiq. Testing Testing is carried out to validate and verify the piece developed in order to give user a confidence to use reliable.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Dynamic Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Software Test Plan Why do you need a test plan? –Provides a road map –Provides a feasibility check of: Resources/Cost Schedule Goal What is a test plan?
SOFTWARE TESTING. SOFTWARE Software is not the collection of programs but also all associated documentation and configuration data which is need to make.
Introduction to Software Testing Maili Markvardt.
Mutation Testing Laraib Zahid & Mariam Arshad. What is Mutation Testing?  Fault-based Testing: directed towards “typical” faults that could occur in.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
Software Testing. Software Quality Assurance Overarching term Time consuming (40% to 90% of dev effort) Includes –Verification: Building the product right,
Software Testing.
Testing Verification and the Joy of Breaking Code
Software Testing.
Approaches to ---Testing Software
Chapter 8 – Software Testing
Chapter 13 & 14 Software Testing Strategies and Techniques
Software Quality Engineering
Software Testing (Lecture 11-a)
Lecture 09:Software Testing
Testing and Test-Driven Development CSC 4700 Software Engineering
CS240: Advanced Programming Concepts
CSE 303 Concepts and Tools for Software Development
Chapter 10 – Software Testing
CSE403 Software Engineering Autumn 2000 More Testing
Applying Use Cases (Chapters 25,26)
CSE 1020:Software Development
Testing Slides adopted from John Jannotti, Brown University
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Software Testing CS 121 “Ordering Chaos” “Mike” Michael A. Erlinger testing.f12.ppt

Administrivia Prepare for Sycamore on the 30th…. Need schedule of meeting with graders for User Test

Software Testing: Convention Wisdom 95% of errors are in 5% of the code …or maybe 80% of the errors are in 20% of the code… Testing: Can I find that 5% or 20% via a test suite

Software Testing Goals Types of tests Levels of tests Test measures Test plan

Meets customers’ needs Goals Verification: Have we built the software right? Validation: Have we built the right software? Bug-free, meets specs Meets customers’ needs Are Verification and Validation different or variation of the same idea? My argument: “meeting specs” should equal “meeting customer needs”... not generally true (my kitchen, satellite systems)

Software Testing Goals Types of tests Levels of tests Test measures Test plan most of our discussion focuses on verification (more specifically bug testing)

Types of tests Black box White box Gray box

Black Box Tests input output interface 1. Does it perform the specified functions? Does it handle obvious errors in input? Ariane5 – lousy error handling Classic ints vs floats, yards vs meters Black box should catch these if there is adequate “test coverage”

Example: Ordered List of ints L=create() L.insert(5) L.insert(-1) p=L.getFirst() print (p) L.delete(p) print(p) p=L.getNext(p) -1 5 error class OrdInts create getFirst getNext insert delete print

Black box tests Advantage: black box tester≠developer is unbiased by implementation details. e.g., Use Case testing, just work through all the Use Cases, building tests for each Disadvantage: black box tester is uninformed about implementation details unnecessary tests – test same thing in different way insufficient tests – can miss the extremes, especially if actual use follows a different pattern – generally impossible to check all inputs

Black Box Tests Code Input x x x x choose good distribution of input – hope good distribution of code tested

Unnecessary Tests Code Input large range of input may exercise a small part of code e.g., operator test of satellite control stations, run through each input and output light/key option. Testing same functions, whereas no one had a test for my map function.

Insufficient Tests Code Input a small range of input may exercise a large range of code but can you ‘know’ this without knowing the code? Did we miss the 20%

Sufficient Tests Code Input complex code a small range of input may exercise a small but important/error-prone region of code

White Box Tests Based on code test 1 test 2

Example: ordered list of ints class ordInts { public: … private: int vals[1000]; int maxElements=1000; … }

White Box TestExample: ordered list of ints bool testMax() { L=create(); num=maxElements; for (int i=0; i<=num; i++) print i L.insert(i) print maxElements; }

White Box Tests Advantage: Disadvantage: design tests to achieve good code coverage and avoid duplication can stress complicated, error-prone code Can be driven from Design, e.g., Use Cases or other Models can stress boundary values (fault injection) Disadvantage: tester=developer may have bias (team alternatives to test developer) if code changes, tests may have to be redesigned (is this bad?)

Gray Box Tests Look at code to design tests But test through interface Best of both worlds - maybe

Example: ordered list of ints L=create() L.insert(1) L.insert(2) L.insert(3) L.insert(1001) p=L.getFirst() print(p) p=L.getNext(p) print p 1 2 3 class OrdInts create getFirst getNext insert delete print … … …

Types of Tests Testing strategy can/should include all approaches! Black box: test based on interface, through interface Gray box: test based on code, through interface White box: test based on code, through code Testing strategy can/should include all approaches! My experience: Black Box = non developer, outside testing “idiots” who follow specfications/requirements. in your case who? White Box = developer, part of development process Gray Box = hated, non developer within developer organization

Levels of Tests Unit Integration System System Integration white black

Testing measures (white box) Code coverage – individual modules Path coverage – sequence diagrams Code coverage based on complexity – test of the risks, tricky part of code (e.g., Unix “you are not expected to understand this” code)

Code Coverage How much of code is “tested” by tests? manually profiling tools Design new tests to extend coverage Is 100% good? Is it possible to achieve?

Path Coverage How many execution paths have been exercised by tests? 100% path coverage is usually impossible Aim to cover common paths and error prone (complex) paths Aim to break code with tests – good testers are not liked by developers....

…or maybe 80% of the errors are in 20% of the code… Convention Wisdom 95% of errors are in 5% of the code …or maybe 80% of the errors are in 20% of the code…

Code Complexity Measures cyclomatic complexity measure (McCabe) measures number of linearly independent paths through program ignores asynchronous interaction, fallibility of services etc. developer’s best guess – what problems are likely and which will be hardest to diagnose started with Knuth and others who gathered stats on programs.

Test plan Collection of tests: unit, integration, system Rationale for test: why these tests? Strategy for developing/performing tests e.g., test units as developed, test integration at each build, run the same tests over each build, etc. Final test plan for Version 1 should do all the unit tests, integration tests, etc.

Write test BEFORE your write the code! Testing Strategy TDD – test driven development Regression Test harness Bug tracking User tests Write test BEFORE your write the code!

TDD – test Driven Unit tests are written first by the SEs. Then as code is written it passes incrementally larger portions of the test suites. The test suites are continuously updated as new failure conditions and corner cases are discovered, and integrated with regression tests. Unit tests are maintained like software and integrated into the build process. The goal is to achieve continuous deployment with frequent updates.

Testing Strategy TDD – test driven development Regression Test harness Bug tracking User tests Automate Build up number of depth of tests Run tests before you check in code My mess up historically

Testing Strategy TDD – test driven development Regression Test harness Bug tracking User tests Useful for interactive graphics applications automated test framework, built one for satellite console to run through all console interactions

Test Harness output input inject test input query state everything else Test harnesses allow for the automation of tests. They can call functions with supplied parameters and print out and compare the results to the desired value. The test harness is a hook to the developed code, which can be tested using an automation framework.

Strategy TDD – test driven development Regression Test harness Bug tracking User test Design system for tracking Scrupulously record problems, their context, the effect, ideas on the cause, attempts to fix, create new tests as bugs uncovered

Strategy TDD – test driven development Regression Test harness User test Validation Nonfunctional requirements Not best for discovering bugs Need to know how they generated bug Historically, I have seen these used to Validate the final deliverable….too late….

Test Plan Collection of tests: unit, integration, system Rationale for test: why these tests? Strategy for developing/performing tests Be thoughtful in designing Be diligent in executing

Python & PyGame What tools are provided to do tests? What kind of tests are the tools suited to?

The End