Testing, The Ugly Stepchild of Software Development Better Living through Software Testing Chris Berry – Feb 21, 2000 Chris Berry

Slides:



Advertisements
Similar presentations
Unified process(UP) UP is an OO system development methodology offered by Rational(Rational Rose) s/w, now a part of IBM Developed by Booach,Rambaugh,Jacobson--
Advertisements

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.
Chapter 2 Modeling the Process and Life Cycle Shari L. Pfleeger
Alternate Software Development Methodologies
Informatics 43 – April 30, What is a test case? An input to a system, and the correct output. An “input” may be complex. Example: – What is an input.
XP – eXtreme Programming A gentle introduction. Cleviton Vinícius Jobson Ronan Thiago Rodrigues.
Extreme Programming: Practices and Strategies Extreme Programming Practices and Strategies Mohammad Alshayeb Information and Computer.
Introduction to XP “When the tests all run, you’re done”
EXtreme Programming Quick Introduction Daniel Arraes Pereira Eduardo Lourenço Apolinário Ricardo de Oliveira Cavalcanti.
Extreme Programming Theory & XPeriences
Extreme Programming Mark Steverson. What Is Extreme Programming? ● Extreme Programming (XP) is a lightweight, agile methodology developed by Kent Beck.
Program Testing Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
1 Joe Meehean. 2 Testing is the process of executing a program with the intent of finding errors. -Glenford Myers.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
Introduction to Unit Testing Jun-Ru Chang 2012/05/03.
Chapter 12: Exception Handling
Chapter 5 Software Process Models. Problems with “Traditional” Processes 1.Focused on and oriented towards “large projects” and lengthy development time.
Sofia Bulgaria Summer School IST eXPERT: Best Practice on e-Project Development 30 June - 2 July 2003 eXtreme programming.
Extreme programming overview Agenda  Extreme programming goals  Extreme programming values  Extreme programming practices  The Extreme programming.
Agile Modeling Theory. 2 Agile Modeling (AM) AM is a chaordic, practices-based process for modeling and documentation AM is a collection of practices.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Testing in Extreme Programming
1 e X treme P rogramming D. Dranidis September 2000 CITY College.
T-unit: Tcl Unit Test Package Automated Unit Test Package For Tcl Procedures Final Presentation Joseph Boyle Loyola Marymount University.
CSE 219 Computer Science III Testing. Testing vs. Debugging Testing: Create and use scenarios which reveal incorrect behaviors –Design of test cases:
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
EXtreme Programming Development Adrian Williamson People, Technology and People and Technology Consultant.
Introduction to Exception Handling and Defensive Programming.
COMP 121 Week 1: Testing and Debugging. Testing Program testing can be used to show the presence of bugs, but never to show their absence! ~ Edsger Dijkstra.
Extreme Programming David Li CTO, DigitalSesame. Problem in Developing Software The Basic Problem - Risk –Schedule slips –Project canceled –System goes.
Making Good Code AKA: So, You Wrote Some Code. Now What? Ray Haggerty July 23, 2015.
1/7/2004CSG - Project Delivery at UT Austin1 Making a Model Perform Adopting a methodology to your environment.
(1) Unit Testing and Test Planning CS2110: SW Development Methods These slides design for use in lab. They supplement more complete slides used in lecture.
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
DAVID STOTTS DEPT. OF COMPUTER SCIENCE UNIV. OF NORTH CAROLINA AT CHAPEL HILL Extreme Programming.
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.
EMBEDDED REAL-TIME, INC. December 8, 2015 Java Unit Mark Mosher Rochester Java Users Group.
JUnit Don Braffitt Updated: 10-Jun-2011.
Requirements Engineering Requirements Engineering in Agile Methods Lecture-28.
Extreme programming (XP) Variant of agile Takes commonsense practices to extreme levels © 2012 by Václav Rajlich1.
Agile Methods Presentation By: Jason Abbett. Definition A process to rapidly develop software Many kinds of agile methods but few are practiced.
Testing Data Structures Tao Xie Visiting Professor, Peking University Associate Professor, North Carolina State University
SoberIT Software Business and Engineering Institute HELSINKI UNIVERSITY OF TECHNOLOGY 1 eXtreme Programming – one of the Agile Software Development Methodologies.
Dynamic Testing.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
Chapter 3 Agile software development 1 Chapter 3 – Agile Software Development.
Software Testing.
Don Braffitt Updated: 26-Mar-2013
Software Testing.
Extreme Programming.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
What do you need to know about XP?
Chapter 2 Modeling the Process and Life Cycle Shari L. Pfleeger Joanne M. Atlee 4th Edition.
Design and Programming
Introduction to Testing, SUnit and Error Handling
CS 1111 Introduction to Programming Fall 2018
Informatics 43 – April 28, 2016.
Refactoring.
Extreme Programming.
Java & Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 5: New and Emerging Process Methodologies
Presentation transcript:

Testing, The Ugly Stepchild of Software Development Better Living through Software Testing Chris Berry – Feb 21, 2000 Chris Berry

Why Test? It’s easy to fool yourself. Increase confidence. Increase productivity. Increase courage. It simply makes programming more fun!

Test Early, Test Often Defects are order of magnitude cheaper to fix when programmers find their own errors. No communication cost. The bug tracking system does not become involved. The error does not block or corrupt the work of other developers.

Preemptive Testing The Art of catching bugs before they happen. Defensive Programming. Programming by Contract.

The Assertion The hallmark of Defensive Programming. Allows you to assert that a particular condition is met, and commonly, if it is not, terminate execution. Pre and post conditions. Not to be confused with Exceptions.

Sanity Checking A simple coding convention which requires all Classes to provide a boolean isSane method. Used to determine whether a particular Instance is in a sane state.

Logging/Debug Prints Low tech debugging technique. Often the only way to debug threaded code. Can speed development. Permanent artifact. Can result in “Scroll-blindness”. Best to divert logging to a file rather than standard out. The log4j package for Java.

Unit Testing Test each unit of code independently. In OO, this equates to testing a Class and its public interface. Involves debugging, simultaneously, the code, the test, and the Spec.

Unit Testing is Glass Box Testing You Must be aware of All branches of the method under test. What inputs should produce what results or Exceptions. The interplay of affected member variables and arguments.

Building a Good Unit Test Test for Data integrity: Valid input: Insure that correct outputs are generated for correct input conditions. Invalid input: Insures proper error handling.

Deciding on Unit Test Input Equivalence Partitioning. Good partitioning gives rigor without redundancy. Boundary Analysis Things go wrong at the edges. Expected and unexpected Exceptions.

Equivalence Partitioning An equivalence class is a definition of a group of inputs, any one of which should be treated exactly the same by the method under test. Eliminates redundant tests. The behavior of the method should be “equivalent” so only one test need be run for any equivalence class.

Boundary Analysis The term for choosing the appropriate values to test a particular equivalence subset. Choose values at the edge of the set. Also a good idea to include the transition values.

Dealing with Exceptions Catch all unplanned Exceptions. Match all thrown Exceptions with the conditions expected to produce them.

Classic Unit Test construct Generate argument providers Loops over all argument providers Construct the Object under test (OUT) Optionally save the state of the OUT Call the method under test (MUT) If an exception was generated Test for unhandled exceptions Else Assertions on the resultant, OUT, and arguments End loops

Integration Testing Tests which prove that the program properly executes some required functionality. Typically involves the integration of many Classes. Often a test from the perspective of the customer.

eXtreme Programming “A lightweight, low-risk, flexible, predictable, and fun way to develop software”. Takes commonsense best practices and applies them to an extreme degree.

XP in a Nutshell Code is king. Embrace change. Constant design. Emphasis on refactoring.

The Four Variables Cost Time Quality Scope.

The Four Values of XP Communication Simplicity Feedback Courage.

Central Principles of XP Rapid Feedback. Assume Simplicity. Incremental change. Embrace change. Quality work.

Secondary Principles of XP Teach Learning. Small Initial Investment. Play to Win. Concrete Experiments. Honest communication.

Secondary Principles of XP, continued Work with instincts. Accepted responsibility. Local adaptation. Travel Light. Honest measurement.

Four Basic Activities of XP Coding. Testing. Listening. Designing.

XP Development Practices On-site Customer System Metaphor Pair Programming Tests Before Code Simple Design

XP Development Practices, continued Merciless Refactoring Continuous Integration Collective Ownership Coding Standards

Testing the XP way A simplified, pragmatic, and less rigorous approach to testing. Tests things that might break. Testing simple methods, like accessors, is valueless. Write the tests first. Keep the tests running. Tests are automatic. Run the full suite several times a day. JUnit, a Java testing framework. A C++ version (CPPUnit) is now available.

Summary The earlier you catch a bug the less it is going to cost you. Testing can actually speed up your development time, and improve your quality of life. XP is a pragmatic approach to writing better software. XP embraces change.

Acknowledgements Some of the Slide Notes for this presentation were lifted verbatim from several sources; “Test Infected. Programmers Love Writing Tests” by Eric Gamma and Kent Beck. “eXtreme Summary - An Overview of eXtreme Programming eXplained: Embrace Change” by Brad Appleton. “Divide and Conquer - Preemptive and Unit Testing” by Chris Berry “The Pragmatic Programmer” by Andrew Hunt and David Thomas.

Resources