chapter 1 : introduction to software testing 322235 software testing

39
Chapter 1: Introduction to Software Testing 322235 Software Testing By Dr. Wararat Songpan (Rungworawut) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand

Upload: kato-colon

Post on 02-Jan-2016

145 views

Category:

Documents


4 download

DESCRIPTION

Chapter 1 : Introduction to Software Testing 322235 Software Testing. By Dr. Wararat Songpan ( Rungworawut ) Faculty of Computer Science, Department of Science, Khon Kaen University, Thailand. Software tester job??. Software tester job??. Software tester job??. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Chapter 1: Introduction to Software Testing

322235 Software Testing

ByDr. Wararat Songpan (Rungworawut)

Faculty of Computer Science, Department of Science,

Khon Kaen University, Thailand

Page 2: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software tester job??

Page 3: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software tester job??

Page 4: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software tester job??

Page 5: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Project Manager

Tester Team

System Analyst

Programmer

Programmer

Programmer

System Analyst

Programmer

Programmer

Programmer

5

Where is software tester in software development

team?

Page 6: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Career path

6

Page 7: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Why is Software testing important to a business?

• Loss of money• Loss of time• Damage to business reputation• Injury or death

Page 8: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Why is Software Testing Important to a business?

DeveloperIndependent tester

Understands the system

but, will test "gently"

and, is driven by “delivery”

Must learn about the system,

but, will attempt to break it

and, is driven by “quality”

8

Page 9: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

“Testing”

Page 10: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Don’t care testing

Page 11: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

The cost of software development phases

Software Development Phases Cost Spent

Requirements Analysis 3%

Specification 3%

Design 5%

Coding 7%

Testing 15% (should be > 50%)

Operational and Maintenance 67%** 11

Page 12: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

7 Principles of testing1) Testing shows presence of defects/Bugs2) Exhaustive testing is impossible3) Early testing4) Defect clustering5) Pesticide paradox6) Testing is context depending7) Absence – of – errors fallacy

Source: http://istqbexamcertification.com/what-are-the-principles-of-testing/

12

Page 13: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 1:

Testing shows presence of defects/Bugs

• Testing can show the defects/Bugs are present, but cannot prove that there are no defects.

• After testing the application or product thoroughly we cannot say that the product is 100% defect free.

• Testing always reduces the number of undiscovered defects remaining in the software but even if no defects are found, it is not a proof of correctness.

Page 14: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 2:

Exhaustive testing is impossible

• Testing everything including all combinations of inputs and preconditions is not possible.

• For example: In an application in one screen there are 15 input fields, each having 5 possible values, then to test all the valid combinations you would need 30  517  578  125  (515) tests.

• This is very unlikely that the project timescales would allow for this number of tests.

Page 15: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

What is your test case?

Page 16: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 3:

Early testing

• In the software development life cycle (SDLC) testing activities should start as early as possible and should be focused on defined objectives.

Page 17: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 4:

Accumulation of errors

• There is no equal distribution of errors within one test object. The place where one error occurs, it’s likely to find some more. The testing process must be flexible and respond to this behavior.

Page 18: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 5:

Fading effectiveness

• The effectiveness of tests fades over time. If test-cases are only repeated, they do not expose new errors. Errors, remaining within untested functions may not be discovered. In order to prevent this effect, test-cases must be altered and reworked time by time.

Page 19: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 6:

Testing is context depending

• Testing is basically context dependent. Different kinds of sites are tested differently. For example, safety – critical software is tested differently from an e-commerce site.

Page 20: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Principle 7:

False conclusion: no errors equals usable system

• Error detection and error fixing does not guarantee a usable system matching the users expectations. Early integration of users and rapid prototyping prevents unhappy clients and discussions.

Page 21: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software testing concepts

• Software Testing is the process of evaluating a system or its component(s) with the intent to find that whether it satisfies the specified requirements or not. This activity results in the actual, expected and difference between their results.

• Software Testing is executing a system in order to identify any gaps, errors or missing requirements in contrary to the actual desire or requirements.

Page 22: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing

• Error is an fault in the program. There are different types of error are

• Syntax errors• Logical errors• Runtime errors• Etc.

Page 23: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing• Fault is the result of an error that is

representation of error such as narrative text, dataflow diagrams, hierarchy charts, source code.

• Failure occurs when fault executes.

• Incident – when a failure occurs, it may or may not be readily apparent to the user(cutormer/tester). An incident is the symptom associated with a failure that alerts the user to the occurrence of a failure.

Page 24: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing• Bug is found in the development environment

before the product is shipped to the respective customer.

• Defect is found in the product itself after it is shipped to the respective customer.

Bug(Programmer) = Defect(Tester)

Page 25: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing• ** Test Case - test case has an identity and is

associated with a program behavior. A test case also has a set of input and a list of expected outputs.

Input

Actual output

Expected output

System

Page 26: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing• For example: A Test Case

Withdraw 5,000 Baht

5,000

5,000

Expected output = Actual output

Page 27: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Keywords of testing• Verification: Are we building the system right?

The process of evaluating work-products (not the actual final product) of a development phase to determine whether they meet the specified requirements for that phase.

• Validation: Are we building the right system?The process of evaluating software during or at the end of the development process to determine whether it satisfies specified business requirements from users.

Page 28: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Structural and Functional View

28

S P

Specification(expected)

Program(observed)

S - Specified BehaviorsP - Programmed Behaviors

P

S

P

S

Fault of omission

Fault of commission

Page 29: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Structure and Functional View (Cont.)

• 2,5 Spec. but do not be tested

• 1,4 Spec. and Test• 3,7 Test does not

meet Spec.• 2,6 Program is not

tested• 1,3 Program is

under test• 4,7 Test case do

not have program.

29

Specification(expected)

Program(observed)

S P

T

1

2

34

5 6

78

Test cases(verified)

Page 30: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software testing methods

Black Box Testing (Functional Testing)• The technique of testing without having any

knowledge of the interior workings of the application is Black Box testing.

• The tester is oblivious to the system architecture and does not have access to the source code.

• Typically, when performing a black box test, a tester will interact with the system's user interface by providing inputs and examining outputs without knowing how and where the inputs are worked upon.

Page 31: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Comparing Functional Test Case Identification

Methods

31

S P

Test cases(Method A)

S P

Test cases(Method B)

Black box Black box

Page 32: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Software testing methods

White box testing (Structural Testing) • White box testing is the detailed investigation of

internal logic and structure of the code. White box testing is also called glass testing or open box testing. In order to perform white box testing on an application, the tester needs to possess knowledge of the internal working of the code.

• The tester needs to have a look inside the source code and find out which unit/chunk of the code is behaving inappropriately.

Page 33: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Comparing Structural Test Case Identification Methods

33

S P

Test cases(Method A)

S P

Test cases(Method B)

White box White box

Page 34: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Level of Testing(Waterfall model)

Requirements & Specification

PreliminaryDesign

DetailedCoding

Coding

Unit Testing

IntegrationTesting

SystemTesting

User Acceptance Testing

Software Development Life Cycle

Design test scripts/test cases

Design

Design

Execute test scripts/test

cases

Execute

Execute

Page 35: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Requirements Phase Testing Activities

• A preliminary analysis, propose alternative solutions, describe costs and benefits and submit a preliminary plan with recommendations.

• Defines project goals into defined functions and operation of the intended application.

• Analyzes end-user information needs. We can design overall System testing wait for actual system.

Page 36: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Design Phase Testing Activities

• Describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudo-code and other documentation.

• Plan to test in Unit testing and Integration testing

Page 37: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Coding Phase Testing Activities

• The real code is written here then checks for error or bugs for each functions which are called Unit testing.

Page 38: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

Maintenance Phase Testing

• The final stage of software development, where the software is put into production and runs actual business.

• Brings all the pieces together into a actual environment and user, verify and validation for errors, bugs and interoperability. This testing phase is called User Acceptance Testing (UAT).

Page 39: Chapter 1 :  Introduction to Software Testing 322235 Software Testing

What the customer really needed: Must be

tested

322 235 การทดสอบซอฟต์�แวร� 39