Sample Problems for Testing

Slides:



Advertisements
Similar presentations
Context Diagram Yong Choi BPA CSUB.
Advertisements

GCSE ICT By the end of this session, you will be able to: Explain main features of ATM machines Identify features of credit cards, debit cards, smart cards.
Chapter 4: Requirements Engineering
Overview Functional Testing Boundary Value Testing (BVT)
Decision Table Based Testing
Interaction Modeling for Testing We would generate the test cases based on our understanding of the interactions that may happen. The source is, again,
Use Case & Use Case Diagram
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
USE CASE – ATM EXAMPLE Actors: ATM Customer ATM Operator Use Cases: The customer can withdraw funds from a checking or savings account query the balance.
SWE 214 (071) Use Case Diagrams Slide 1 Use Case Diagrams Examples.
Sample Problems for Testing For “Program” Level Testing: –Triangle –Next Date –Sales Commission For “System” Level Testing: –ATM system –Currency conversion.
Functional Testing 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 01 – Functional Testing.
CPSC 333: Foundations of Software EngineeringJ. Denzinger Small Test: Bank account manager System has to run on an automated teller machine. User must.
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Lecture 8 Electronic Commerce Modelling Techniques
ATM – requirements Team B Tom Hastjarjanto Martijn Nijenhof Ales Sturala Paul van der Ende.
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
© Thomson/South-WesternSlideCHAPTER 231 BANKING AND CREDIT 23.1Financial Institutions 23.2Checking Accounts 23.3Credit and Its Use Chapter 23.
Prepare a deposit slip Record entries in a check register
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
ATM User Interface Design. Requirements A bank customer is able to access his or her account using an automatic teller machine. To be able to use an ATM.
1.7.2.G1 Electronic/Online Banking & Bill Pay Take Charge of Your Finances.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Software Testing and Quality Assurance
{ How to Use An ATM A simple tutorial to teach how to use ATM Machines.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Equivalence Class Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Dynamic Black-Box Testing Part 2
1 CSC103: Introduction to Computer and Programming Lecture No 13.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 3: Requirements Specification, C++ Basics.
By Asst.Prof.Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand 1 Chapter 3: Equivalence.
30S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Budgeting Lesson: Cheque Records & Deposit Slips Cheque Records & Deposit Slips Learning Outcome.
Chapter 14 System Testing.
Use Case Diagram: Exercise 5 and 6 Yong Choi BPA CSUB.
Faculty of Computer & Information Software Engineering Third year
ICT and Banks Banks use mainframe computers to maintain customer accounts. They store a record of each customer’s withdrawals and deposits. Each bank mainframe.
SFWR ENG 3KO4 Software Development for Computer/Electrical Engineering Fall 2009 Instructor: Dr. Kamran Sartipi Software Requirement Specification (SRS)
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
1 Equivalence Class Testing Chapter 6. 2 Introduction Boundary Value Testing derives test cases with Massive redundancy Serious gaps Equivalence Class.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Copyright ©2005  Department of Computer & Information Science JavaScript Modularity.
Chapter 10SectionMain Menu Money What is money? What are the three uses of money? What are the six characteristics of money? What are the sources of money’s.
January Ron McFadyen1 January 2004 Assignment 1 Due: Friday Jan 23, Implement the ProductSpecification and Payment classes in any OO.
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
© 2003 SOUTH-WESTERN PUBLISHINGCHAPTER 23Slide 1 CHAPTER 23 BANKING AND CREDIT 23.1Financial Institutions 23.2Checking Accounts 23.3Credit and Its Use.
1 Requirements Engineering From System Goals to UML Models to Software Specifications Axel Van Lamsweerde.
1 Software Testing. 2 Equivalence Class Testing 3 The use of equivalence class testing has two motivations: –Sense of complete testing –Avoid redundancy.
UC Diagram & Scenario RKPL C & D. Using Use Case Diagram Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
C++ Programming: CS102 LOOP. Not everything that can be counted counts, and not every thing that counts can be counted. −Albert Einstein Who can control.
Daar is geen woord Chinees bij. Follows the push model, messages are not initiated by the software 2.
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
1 Case Study and Use Cases for Case Study Lecture # 28.
Chapter 3: Equivalence Class Testing :EC Software Testing
Subject Name: Software Testing Subject Code: 10CS842 Prepared By:
Modeling for Testing Interactions
Paul Ammann & Jeff Offutt
ATM OO Design and Implementation Case Study
Electronic/Online Banking & Bill Pay
Dynamic Modeling of Banking System Case Study - I
Model-Based Testing Model the system
How An ATM Work's Prepaid by, kakani Dinesh.
Overview Functional Testing Boundary Value Testing (BVT)
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Paul Ammann & Jeff Offutt
Using Use Case Diagrams
Overview Functional Testing Boundary Value Testing (BVT)
Overview Functional Testing Boundary Value Testing (BVT)
Real-Time Structured Analysis and Design Technique (RSTAD)
Presentation transcript:

Sample Problems for Testing For “Program” Level Testing: Triangle Next Date Sales Commission For “System” Level Testing: SATM system Currency conversion Windshield Wiper Garage Door Controller These 7 problems will be used throughout the remainder of the course as examples for different testing techniques Program Level Three examples will be used throughout in Chapters 5 through 9 to illustrate the various unit testing methods The triangle problem, a venerable example in testing circles. NextDate, a logically complex function Sales Commission, an example that typifies MIS applications. Higher Level, system level, Chapters 11 through 17 uses four other examples: The SATM system, a simplified version of an automated teller machine (ATM) The currency converter, an event-driven application typical of graphical user interface (GUI) applications The windshield wiper control device from the Saturn automobile A garage door controller, illustrates some of the issues of “systems of systems.”

1. Triangle Problem Problem (Requirements) Statement: Write me a program that will accept 3 numbers which represent the 3 sides of a triangle. evaluate the inputs and determine if It is a triangle an isosceles triangle an equilateral triangle a scalene triangle Output the answer Problem: relating a) inputs to b) outputs based on input validity & input relationship Look at this requirement statement and identify areas of potential problem if you were writing the program - - - anything more if you were testing this? (would you ensure that the outputs are tested via “partitioned” set?) Your textbook has an “improved” version of the requirement.

1. Triangle Problem The triangle problem is the most widely used example in software testing literature. Simple version: The triangle program accepts three integers, a, b, and c, as input. These are taken to be sides of a triangle. The output of the program is the type of triangle determined by the three sides: Equilateral, Isosceles, Scalene, or Not A Triangle.

1. Triangle Problem Improved version: “Simple version” plus better definition of inputs: The integers a, b, and c must satisfy the following conditions: c1. 1 ≤ a ≤ 200 c4. a < b + c c2. 1 ≤ b ≤ 200 c5. b < a + c c3. 1 ≤ c ≤ 200 c6. c < a + b

1. Triangle Problem If an input value fails any of conditions c1, c2, or c3, the program notes this with an output message, for example, “Value of b is not in the range of permitted values.” If values of a, b, and c satisfy conditions c1, c2, and c3, one of four mutually exclusive outputs is given: If all three sides are equal, the program output is Equilateral. If exactly one pair of sides is equal, the program output is Isosceles. If no pair of sides is equal, the program output is Scalene. If any of conditions c4, c5, and c6 is not met, the program output is NotATriangle

1. Triangle Problem Discussion Problems persist! What output is expected for the input set (2, 2, 5)? Isosceles because a = b? NotATriangle because c > a+b? Fix it (sometimes testers must also be specifiers!) The Really Final Version: “Improved version” plus better definition of outputs.

2. Next Date Problem Problem (Requirements) Statement: Write me a program that will accept 3 numbers which represent the day, month, and year of a calendar date evaluate the inputs and determine The next day of the date represented by the input output the next day answer Problem: relating inputs to outputs based on input validity & input relationship & “complex” data relationships Look at this requirement statement and identify areas of potential problem if you were writing the program - - - anything more if you were testing this?

2. Next Date Problem NextDate is a function of three variables: month, date, and year. It returns the date of the day after the input date. The month, date, and year variables have integer values subject to these conditions: c1. 1 ≤ month ≤12 c2. 1 ≤ day ≤ 31 c3. 1812 ≤ year ≤ 2012 If any of conditions c1, c2, or c3 fails, NextDate produces an output indicating the corresponding variable has an out-of-range value — for example, “Value of month not in the range 1..12”. Because numerous invalid day–month–year combinations exist, NextDate collapses these into one message: “Invalid Input Date.”

3. Monthly Sales Commission Problem Problem (Requirements) Statement: Write me a program that will accept 3 numbers which represent the number of locks, number of stocks, and number of barrels of a riflesold at each town during the month Will accept a number, -1, for locks to represent the “end” of monthly sales so sales commission can be computed evaluate the inputs and determine the monthly sales commission as follows: each lock price is $45; each stock price is $30; and each barrel price is $25 sales person is paid 10% of total sales for the first $1000; 15% on the next $800; and 20% in excess of $1800 output the sales commission Some sales “limitations” exist Must sell one complete rifle Monthly sales (production limit) must be: # of locks <71 # of stocks < 81 # of barrels < 91 Problem: Input – store - compute -output Look at this requirement statement and identify areas of potential problem if you were writing the program - - - anything more if you were testing this?

4. SATM System Problem Problem (Requirements) Statement: Develop part (a component) of an automatic teller system that: Displays a “welcome screen” with a simple instruction to insert ATM card Validates the ATM card. If invalid keeps it (with a message); otherwise goes on Asks for and validates a personal id number ( only up to 3 times) If valid, three “activity” options are presented: Check the account balance Withdraw from the account Deposit into the account Once the option is selected, the customer is presented with and asked to choose between a checking or a savings account For each of these 3 optional activities the customer account file is also updated with Date of ATM access and Increment the number of times this account is accessed through ATM

4. SATM System Problem

4. SATM System Problem (cont.) Requirements (cont.) If account balance is requested then a new balance is printed and the customer is given a choice for more activities. For both withdrawal and deposit options, the customer is asked to key in the amount For withdrawal, the minimum increment is $10. The customer account will be updated, and the customer will be asked to take the cash from the dispenser. In the event there is insufficient funds, the customer is asked to re-key an amount For deposits, if the ATM terminal deposit is working (envelop exists and slot moves), then the customer is asked to place the deposit in an envelop and deposit through the ATM. Otherwise, the customer is told of the problem and given a choice of other options. When customer activities are complete, a new balance is printed on the receipt and a choice for more activities is given. If the customer chooses more activity, he is returned to the 3 choices of activities again. If the customer has no more activity then a message for customer to take both the receipt and the ATM card and the system ends. This testing would be closer to a component or system test, after each unit test is completed. How would divide the component into units for unit testing?

5. Currency Conversion Subsystem Problem (Requirements) Statement: Develop a GUI based sub-system that will accept US currency and convert it to: Brazilian currency Canadian currency European community currency Japanese currency use the exchange rate within the last 12 hours. Also allow the “reverse currency” computation Note: more currencies than the textbook Look at this requirement statement and identify areas of potential problem if you were writing the program - - - anything more if you were testing this?

5. Currency Conversion Subsystem

6. Saturn Windshield Wiper Controller Problem (Requirements) Statement: Write me an “embedded” program that Controls the 4 speed settings of a windshield wiper: Off Intermittent Low High For “off”, the windshield wiper does not move For Intermittent setting, there are 3 “dial” sub-settings: 1 : wiper wipes 4 times per minute 2: wiper wipes 6 times per minute 3: wiper wipes 12 times per minute For Low, the wiper wipes 30 times per minute For High, the wiper wipes 60 times per minutes OFF -> Wiper does not move As a tester what needs to be considered? - if wiper is not moving, then ? Look at this requirement statement and identify areas of potential problem if you were writing the program - - - anything more if you were testing this?

6. Saturn Windshield Wiper Controller c1. Lever OFF INT LOW HIGH c2. Dial n/a 1 2 3 a1. Wiper speed is… 4 6 12 30 60

7. The Garage Door Controller (shown here as a SysML Context Diagram)