Copyright 2015, Robert W. Hasker. Reviewing CI Setup  So what do the steps do?  Key concept: search path  Windows: for each command, run through PATH.

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,
Sufficient Mutant Operators Offutt, Rothermel, Lee, Untch, and Zapf TOSEM, April 1996 Slide text copyright Robert W. Hasker, 2006 Material (and figures)
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
CS 425/625 Software Engineering Software Testing
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Guide To UNIX Using Linux Third Edition
Introduction to Software Testing
Chapter 13 & 14 Software Testing Strategies and Techniques
CSCI 5801: Software Engineering
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
System/Software Testing
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Semester 1, 2003 Week 7 CSE9020 / 1 Software Testing and Quality Assurance With thanks to Shonali Krishnaswamy and Sylvia Tucker.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
CPIS 357 Software Quality & Testing
CMSC 345 Fall 2000 Unit Testing. The testing process.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
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.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
© 2006 Pearson Education 1 More Operators  To round out our knowledge of Java operators, let's examine a few more  In particular, we will examine the.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
CSC 480 Software Engineering Lecture 15 Oct 21, 2002.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
The Software Development Process
SE 3800 Note 5 Beyond Functional Testing
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Testing Part II March, Fault-based Testing Methodology (white-box) 2 Mutation Testing.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Mutation Testing Breaking the application to test it.
Dr. Rob Hasker. More notes on Cucumber  Can replace Given/When/Then by bullets Feature: Refund item Sales associates required by law to refund purchases.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Testing  What about “grandma testing”?. Testing  What about “grandma testing”? Sexist? Ageist? "Local grandmother finally uses printer" CES 2009: hall.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Dr. Rob Hasker Dr. Brad Dennis. Coverage  Exercise: Each participant: write down 4 instructions Input to procedure: value given by someone, which person.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Defect testing Testing programs to establish the presence of system defects.
Dr. Rob Hasker Dr. Brad Dennis SE 3800 Note 6 UI Testing.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Chapter 8 – Software Testing
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software testing strategies 2
CSE 303 Concepts and Tools for Software Development
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Chapter 3: Selection Structures: Making Decisions
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Copyright 2015, Robert W. Hasker

Reviewing CI Setup  So what do the steps do?  Key concept: search path  Windows: for each command, run through PATH to find first folder containing specified command (an executable with the same name)  Variables: strings that can be retrieved from the environment on demand  JDK_PATH, JAVA_HOME: so java computer and runtime knows where libraries are located  Values of variables retrieved from “owner process” when create new ones – variables are inherited  System variables: shared by all users, recorded by OS when it starts

More on CI Setup  DOS prompt: variables referred to by %X%  Eg: open DOS prompt and enter the command echo %JAVA_PATH%  Unix uses $JAVA_PATH, hence some of the typos  Much of the setup has to do with getting the proper tools in your path (javac, ant, junit libraries)  Windows services: background jobs

Reliability Systems Engineering: Linear System: response to complex input can be described as a sum of responses to simpler inputs Linear System Eg: Wave propagation Nonlinear examples: AC power flow, almost any complex system Reliability for linear systems: product of reliability of each component A: 90% Reliable B: 90% C: 90% Reliability:.9 3 =.73

Reliability in Software  Car that works 73% of the time: find a shop or dealer  How many components in software?  How can we achieve high reliability for SW?

Is unit testing enough?  Integration, system, acceptance  Performance testing  based on operational profile - given expected types of inputs, ensure can handle load  What can you learn from this type of testing?  What can't you learn from this type of testing?  Stress test  Answers what happens at limits/high loads  what happens if exceed limits  What do you want to happen?  Goal: graceful degredation - bend but don't break

More testing methods  Security testing  Maybe something Sony should invest in?  How would you test security?  A particular problem for websites  Database injection, cross-site scripting  Brakeman Rails security scanner Brakeman  Fuzz checkers – inserting random data  Wapiti: identifies scripts, forms in which can inject data Wapiti  Usability  Non-functional requirements in general  Must identify testable component!

Testing strategy  CI: run faster tests first  Generally, this means running unit tests first  System tests: often require setups  Likely: run unit tests always, system tests on demand  Standing issue: regression suite can easily get too large to run all  Research question: can we identify a subset to run routinely, but save full run for release testing?  But is that suggestion contrary to CI?

Qualities of good tests  Thorough – coverage  Start with statement coverage  Repeatable  Generate small data sets that have predictable outputs  Test runs should not depend on each other  Understandable  Maintainable  Easy to identify failed case

Testing  What about “grandma testing”?

Testing  What about “grandma testing”?  Sexist? Ageist? "Local grandmother finally uses printer" CES 2009: hall for products for retirees

Testing  What about “grandma testing”?  Sexist? Ageist? "Local grandmother finally uses printer" Is grandma-using-the-computer the modern equivalent of racist jokes? CES 2009: hall for products for retirees

Testing  What about “grandma testing”?  Sexist? Ageist?  Fuzz testing tools

Testing  What about “grandma testing”?  Sexist? Ageist?  Fuzz testing tools  What if need large data sets?  Test oracles  Version matching

Testing  What about “grandma testing”?  Sexist? Ageist?  Fuzz testing tools  What if need large data sets?  Test oracles  Version matching  Key: differentiate between robustness, correctness

Integration Testing  Common errors:  interface misuse: client doesn't satisfy it's obligations  eg: not calling an initialization routine before executing an operation  interface misunderstanding: incorrect assumptions made by developer of client  timing errors: data producers and consumers may operate at different speeds; if this communication is not protected then may try to consume data before it's produced or produce data when consumer not ready for new information

Integration Testing  Guidelines  test extreme ends of ranges in calls  test passing NULL pointer whenever possible  stress testing to reveal timing problems  if components use shared memory, test operations being invoked in different sequences

System Testing  Focus: functional testing  that is, are there errors in features?  In some sense, this is the only test that matters  tests all functionality seen by customer  why shouldn't we do all testing at this level?  harder to test deeply  harder to know how to fix system if test fails  Acceptance testing: system testing w/ focus on common scenarios

UI Testing in Java  Assumption: painful but readily available  Research: lots of vaporware, abandonware  Many solutions for web, but not a lot for Java  FrogLogic, RAutomation, MarathonTesting, UISpec4J, Mspec, abbot  Method that works:  JavaWorld TestUtils; see also counter.zip JavaWorld TestUtilscounter.zip

UI Testing in Java  Each component: call.setName with unique string  Test code: TestUtils.getChildNamed(frame, name-of-child)  Use.doClick,.value(), etc. to exercise code  Robust  Doesn’t depend on screen locations, specialized test frameworks  But no auto-capture/replay

Manual Test Procedure StepReqPass ConditionsPass? 1. Select the Biology program. UIR-2 System displays biology classes w/ first class BIOLOGY 1150, Section 01, Title GENERAL BIOLOGY, Instructor Block, Anna, Filled/Seats 52/53, Class# 1311, Credits 5, Meets BOE 0221 MWF 8:00-8:52 P / F 2. Double-click on Class# 1330 UIR-1System includes Class# 1330 in schedule at bottomP / F 3. Scroll down to Class# 1331 (BIOLOGY 1650, Section 01) UIR-9System displays Class# 1331 with a pink backgroundP / F 4.UIR-9 All sections listed between #1311 and #1331 have a white background P / F 5. Select the GENENG program. UIR-2System displays general engineering coursesP / F 6.UIR-9 GENENG 1030 sections have a pink background all other sections of GENGENG 1030 have a white backgroundP / F 7.UIR-9 All sections of GENGENG 1000 have a white background P / F

Coverage  Exercise:  Each participant: write down 4 instructions  Input to procedure: value given by someone, which person (1-4) gave you the value (source)  Instruction set:  Add one to value  Subtract one from value  If expression then instructions else instructions where expression is a Boolean expr over value, source  Give value to destination – each path must end this way

Coverage  See se3800/samples/triangle.htmlse3800/samples/triangle.html  Coverage from triangle  Working with partner…  Write tests which pass  Identify changes to code which pass those tests but fail to meet specification  What is statement coverage?  How does this differ from branch coverage?

Coverage  Decision: Boolean expression  Condition: (atomic) component of a Boolean expression  Decision coverage: every Boolean expression evaluates to both true and false  How different from statement coverage?  Condition coverage: every condition evaluates to both true and false  Too easy: consider cases for a && b  Multiple condition coverage: all combinations executed  How many tests needed for a && b && c ?

MCDC  Modified Condition Decision Coverage  Every statement invoked at least once  Every entry, exit point invoked at least once  Every control statement taken all possible outcomes at least once  Every (non-constant) Boolean expr evaluated to both true and false  Every (non-constant) condition evaluated to both true and false  Every non-constant condition in a Boolean expression shown to independently affect the outcome

MCDC  Modified Condition Decision Coverage:  Every entry, exit point executed at least once  Every decision has taken all possible outcomes at least once  Every condition has taken all possible outcomes at least once  Every condition (in a decision) has been shown to independently affect that decision’s outcome.  With this definition, number of tests is O(N)  See A Practical Tutorial on Modified Condition/Decision Coverage, NASA/TM for a tutorialA Practical Tutorial on Modified Condition/Decision Coverage, NASA/TM

Path Testing  Statement, decision, MCDC: all about executing logic  Ultimate goal: execute every path  Enumerate paths for GCD example:GCD example printf("The gcd of %d and %d", x, y); while ( x != y ) { if ( x > y ) x = x - y; else y = y - x; } printf( " is %d.\n", x ); printf("gcd of %d and %d", x, y); while ( x != y ) { if ( x > y ) x = x - y; else y = y - x; } printf( " is %d.\n", x );

Mutation Testing  Change code, run tests  Some test should fail  How to generate mutants?  That is: what operators?  Offutt, Rothermel, Lee, Untch, and Zapf. Sufficient Mutant Operators, TOSEM, April 1996

Too many mutants!  Number of mutants from 22 operations:  Are the most expensive mutants necessary?  Examined impact of removing each

Result: minimum operator set  ABS: insert calls to an absolute value function  AOR: replace all arithmetic ops by every syntactically legal alternatives  LCR: replaces AND, OR by all logical connectors  ROR: replace (modify) relational operators  UOI: insert unary operators

Evaluation  Five operators, responsible for ~17% of all mutants, sufficient for 10 Fortan test programs  In general: get O(Lines + References) mutants  Constant for O is large!  Above 10 programs (200 lines): 231,972 mutants  Practical for critical routines

Acceptance Tests & APIs  How to write acceptance tests for an API?  Our model: acceptance test = story/scenario  Issue: an API is not a user!  Solution: Cohn: Writing User Stories for Back- end SystemsCohn: Writing User Stories for Back- end Systems  Personify subsystems  Epic: “As a bank, I want to receive a file showing all checks to be cleared so that I can debit and credit the right accounts.”  “As a bank, I want to receive a 5300 file with correctly formatted single-line deposit entry records so that I can process them.”  Write test to the resulting story.

Testing Review  Unit, Integration, System, Acceptance  Coverage: making sure all code executed  Mutation testing: testing your tests  Acceptance testing and APIs

What next?  How to know when we’re done?  Exercise: research network  Methods & Tools: Methods & Tools  No risk, no need to test!  Done depends on identified risks: minimal criterion is that you are done testing when risks are reduced to an acceptable level  Is there an acceptable level of risk for safety- critical software?

Goal-directed design  What do you want to know about user interface design?