CS 160 and CMPE/SE 131 Software Engineering April 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.

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 Yaodong Bi.
Test process essentials Riitta Viitamäki,
Lecture 8: Testing, Verification and Validation
Chapter 4 Quality Assurance in Context
Software Architecture Prof.Dr.ir. F. Gielen
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
Alternate Software Development Methodologies
Illinois Institute of Technology
1 Testing. 2 About Testing  The reason the program is in testing is that it probably doesn’t work!  We test to find bugs before our users and hope that.
SE 555 Software Requirements & Specification Requirements Validation.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
Introduction to Software Testing
Software Testing & Strategies
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
Functional Testing Test cases derived from requirements specification document – Black box testing – Independent testers – Test both valid and invalid.
ECE 355: Software Engineering
CS 160: Software Engineering November 10 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
March 13, 2001CSci Clark University1 CSci 250 Software Design & Development Lecture #15 Tuesday, March 13, 2001.
CompSci 230 Software Design and Construction
Applied Software Project Management Andrew Stellman & Jennifer Greenehttp:// Applied Software Project Management Chapter 1: Introduction.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Software testing basic. Main contents  Why is testing necessary?  What is testing?  Test Design techniques  Test level  Test type  How to write.
Understand Application Lifecycle Management
CS 360 Lecture 3.  The software process is a structured set of activities required to develop a software system.  Fundamental Assumption:  Good software.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
Software Testing Testing principles. Testing Testing involves operation of a system or application under controlled conditions & evaluating the results.
 CS 5380 Software Engineering Chapter 8 Testing.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Testing Workflow In the Unified Process and Agile/Scrum processes.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 23 Reliability III.
CS 160: Software Engineering November 12 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Rapid software development 1. Topics covered Agile methods Extreme programming Rapid application development Software prototyping 2.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
University of Palestine software engineering department Testing of Software Systems Testing throughout the software life cycle instructor: Tasneem.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
Software Construction Lecture 18 Software Testing.
TESTING LEVELS Unit Testing Integration Testing System Testing Acceptance Testing.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
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.
MANUAL TESTING KS SESSION PRESENTED BY 26/11/015 VISHAL KUMAR.
Chapter 2: Testing in Software Life Cycle MNN1063 System Testing and Evaluation.
CSC 480 Software Engineering Test Planning. Test Cases and Test Plans A test case is an explicit set of instructions designed to detect a particular class.
What is a level of test?  Defined by a given Environment  Environment is a collection of people, hard ware, software, interfaces, data etc.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 Object-Oriented Analysis and Design with the Unified Process Figure 13-1 Implementation discipline activities.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Testing and Evolution CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CS 160 and CMPE/SE 131 Software Engineering May 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Software Testing Strategies for building test group
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Software Engineering (CSI 321)
Testing More In CS430.
Chapter 9, Testing.
SEVERITY & PRIORITY RELATIONSHIP
Applied Software Implementation & Testing
Introduction to Software Testing
Lecture 09:Software Testing
Testing and Test-Driven Development CSC 4700 Software Engineering
Baisc Of Software Testing
CMPE/SE 131 Software Engineering April 11 Class Meeting
Chapter 11: Integration- and System Testing
Presentation transcript:

CS 160 and CMPE/SE 131 Software Engineering April 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University Spring 2016 Instructor: Ron Mak

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak “Swing Project” Cartoon 2

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak “Swing Project” Cartoon, cont’d 3

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak “Swing Project” Cartoon, cont’d 4

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak “Swing Project” Cartoon, cont’d 5

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Millions of Lines of Code  See content/uploads/2014/01/million-lines-of-code- large.jpg?f7c509http://cdn.makeuseof.com/wp- content/uploads/2014/01/million-lines-of-code- large.jpg?f7c509 6

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 7 One Month to Go!  Review your project schedule.  Prioritize tasks and put off lower priority ones.  Agree upon a release candidate (RC) and make that your primary goal. Define the next RC when you’ve achieved the current one.  Each RC should be something you can turn in. It’s better to turn in a working application, even if it doesn’t have all the features, than one that doesn’t work at all.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 8 One Month to Go! cont’d  Stability is critical.  Do frequent builds.  Be wary of major last-minute changes.  Your final project documentation can include release notes that describe any missing features.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 9 The Cost of Correcting Defects  The cost to correct a defect increases the later it is corrected. 50 to 200 times more expensive to correct later than sooner An iterative (agile) process catches defects soon after they’re made.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 10 Make Small Mistakes Early  Make a carefully planned series of small mistakes early to avoid making unplanned large mistakes later. Example: Create four conceptual design alternatives in the beginning and throw three of them away = 3 small early mistakes. Example: Fail to do adequate design in the beginning and later rewrite the code three times = 3 large expensive mistakes.  Make and correct early mistakes because they cost much less than late mistakes.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 11 Software Validation and Verification (V&V)  Validation Work with the client to make sure that the product requirements are complete and correct. Make sure that the proposed product meets all the requirements. “Are we building the right product?”  Verification Work with the developers to make sure that the product is being developed with high quality standards. “Are we building the product right?”

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 12 Software Reliability  Reliable software has a low probability of failure while operating for a specified period of time under specified operating conditions.  The specified time period and the specified operating conditions are part of the nonfunctional requirements.  For some applications, reliability may be more important than the other requirements. mission-critical applications medical applications

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 13 Software Reliability, cont’d  Reliable software is the result of good software quality assurance (SQA) throughout an application’s life cycle.  Design Good requirements elicitation Good object-oriented design and analysis Good architecture

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 14 Software Reliability, cont’d  Development Good management (e.g., source control, reasonable schedules) Good coding practices (e.g., design patterns) Good testing practices  Deployment Preventive maintenance (e.g., training) Performance monitoring Failure analysis (when failures do occur)

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 15 Software Testing  What is testing?  What is a successful test?  Who does testing?  When does testing occur?  What are the different types of testing?  What testing tools are available?  How do you know your tests covered everything?  When can you stop testing?

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 16 What is testing?  Testing is a systematic procedure to discover faults in software in order to prevent failure.  Failure: A deviation of the software’s behavior from its specified behavior, according to its requirements. Can be minor to major (such as a crash).

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 17 What is testing?  Erroneous state: A state that the operating software is in that will lead to a failure. Example: low on memory  Fault: What caused the software to enter an erroneous state. AKA: defect, bug Example: a memory leak fault  erroneous state  failure

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 18 What is a successful test?  A successful test is one that finds faults (bugs).  Testing is the opposite of coding. Coding: Create software and try to get it to work. Testing: Break the software and demonstrate that it doesn’t work.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 19 Testing Mindset  Testing and coding require different mindsets.  It can be very difficult for developers to test their own code.  If you wrote the code, you psychologically want it to work and not see it break.  Since you know how the code should be used, you may not think to try using it in ways other than as you intended.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 20 Who does testing?  Developers As difficult as it may be, you must test your own code.  unit testing Test each other’s code  peer testing  Testers Members of the quality assurance (QA) department. Software engineers who did not write the code. Manual writers and trainers who create examples and demos.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 21 Who does testing? cont’d  Users As beta testers As customers

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 22 When does testing occur?  Recall the Old Waterfall Model: Requirements Design Implementation Testing  In the new Agile Methodology, testing is part of each and every iteration. Testing occurs throughout development, not just at the end. XXX

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak When does testing occur? cont’d 23

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 24 What are the different types of testing?  Functional testing Does the code do what it’s supposed to do? Tests derived from use cases.  Unit testing Developers test an individual “unit”. Unit: A small set of related components.  Regression testing Rerun previous tests to ensure that the latest code changes didn’t break something. Often run automatically from scripts.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 25 Different types of testing, cont’d  Integration testing Developers test how well their units work together with other units.  Usability testing Is the user interface easy to use?

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 26 Different types of testing, cont’d  System testing Test how an entire system works.  Performance testing How quickly does the system respond?  Stress testing How much can the system tolerate before breaking?

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 27 Alpha Testing vs. Beta Testing  Alpha testing Usability and system testing of a nearly complete application in the development environment.  Beta testing Usability and system testing of a complete or nearly complete application in the user’s environment. It is not uncommon for software companies to release an application to the public for beta testing. New releases of web-based applications are put “into beta” by software companies.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 28 Black Box Testing vs. White Box Testing  Black box testing Deals only with the input/output behavior of the unit.  Calling parameters  Return values The internals of the unit are not considered. Commonly known as functional testing.  White box testing Tests the internal behavior of the unit.  execution paths  state transitions Part of each developer’s unit testing.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 29 Unit Testing  Each unit test focuses on components created by a developer. Done by the developer before committing the code to the source repository. Easier to find and fix bugs when there are fewer components. Bottom-up testing.  Developers create test cases to do unit tests.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 30 Unit Testing: Test Cases  Test case: A set of input values for the unit and a corresponding set of expected results.  A test case can be run within a testing framework (AKA test bed, test harness) consisting of a test driver and one or more test stubs.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 31 Unit Testing: Test Cases, cont’d  Test driver Simulates the part of the system that calls the unit. Calls the unit and passes in the input values.  Test stub Simulates the components that the unit depends on. When called by the unit, a test stub responds in a correct or “reasonable” manner in order to allow the unit to continue operating.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 32 Unit Testing: Testing Framework UNIT (What’s being tested) TEST DRIVER calls TEST STUB calls TEST STUB calls TEST STUB calls

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 33 Writing and Running Unit Tests  Developers are responsible for writing unit tests during each iteration. Whenever you design and write a new class, write a unit test that tests that class.  Developers are responsible for running the unit tests.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak Rails Support for Testing  Chapter 10 of Rails Crash Course  Switch from the Rails development environment to the Rails test environment. Preconfigured for testing  Uses a separate database for running tests. Automatically recreated before each test run. Ensures that tests don’t depend on data already in the database.  Run all the tests in file test/models/user_test.rb: 34 bin/rake test test/models/user_test.rb

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 35 Integration Testing  After your code has passed all the unit tests, you must do integration testing to see how your unit works with other units. Other units written either by you or by other developers.  Not too hard to do if you’ve been doing continuous integration all along.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 36 Stress Testing  AKA load testing  How well does the application behave under stress?  Will its performance be acceptable?

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 37 Stress Testing, cont’d  Add a test driver that pushes your application beyond what is possible with manual testing. Input values at or just beyond their limits Large number of input values or large database tables Number of clients. Number of requests. Number of concurrent requests. Frequency of requests. Types of requests.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 38 Stress Testing, cont’d  Push your application until it breaks.  Know what the breaking point is. If you don’t find out before deployment, the users will!  Understand the behavior of your application under stress. Recognize when it’s about to break so you have time to mitigate.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 39 Stress Testing, cont’d  Use a multi-threaded test program to simulate a large number of simultaneous users of a web application.  Measure the response time of each simulated user as the number of users increases.

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 40 Stress Testing Example: Mars Rover Mission  Simulate multiple users performing client operations simultaneously.  Can the server handle a heavy load?

Computer Science Dept. Spring 2016: April 12 CS 160 and CMPE/SE 131: Software Engineering © R. Mak 41 Regression Testing  Make a collection of unit tests.  Run all the tests whenever you make a code change. Make sure your application did not lose functionality or “regress”. Make sure a bug fix did not introduce new bugs.  Programmers are much less reluctant to improve their code if they can run regression tests to verify their changes.