Automated test.

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Testing and Quality Assurance
1 Software Engineering Lecture 11 Software Testing.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Testing and Debugging pt.2 Intro to Complexity CS221 – 2/18/09.
1 CODE TESTING Principles and Alternatives. 2 Testing - Basics goal - find errors –focus is the source code (executable system) –test team wants to achieve.
Development of a Web Based B&B Reservation System Elizabeth Gates 22July04.
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.
Introduction to Software Testing
Adding Automated Functionality to Office Applications.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Problem Analysis and Program Design
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
CPIS 357 Software Quality & Testing
Class Specification Implementation Graph By: Njume Njinimbam Chi-Chang Sun.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Software Construction Lecture 18 Software Testing.
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
Software Engineering Saeed Akhtar The University of Lahore.
Software Construction Lecture 19 Software Testing-2.
Software Testing Mehwish Shafiq. Testing Testing is carried out to validate and verify the piece developed in order to give user a confidence to use reliable.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Dynamic Testing.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Powerpoint Templates Page 1 Powerpoint Templates Unit Testing Ari Seppi
Software Testing Kobla Setriakor Nyomi Faculty Intern (Programming II)
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
Software Testing.
Testing Verification and the Joy of Breaking Code
Testing Tutorial 7.
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
John D. McGregor Session 9 Testing Vocabulary
Software Testing.
CompSci 230 Software Construction
Chapter 8 – Software Testing
Testing UW CSE 160 Winter 2017.
Software engineering – 1
Some Simple Definitions for Testing
Structural testing, Path Testing
IS442 Information Systems Engineering
WHITEBOX TESTING APPROACH
John D. McGregor Session 9 Testing Vocabulary
Unit testing C# classes
Testing UW CSE 160 Spring 2018.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
John D. McGregor Session 9 Testing Vocabulary
Introduction to Software Testing
Lecture 09:Software Testing
Testing UW CSE 160 Winter 2016.
Verification and Validation Unit Testing
Chapter 12 Exception Handling and Text IO
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Chapter 10 – Software Testing
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
Automated test.
Chapter 3: Selection Structures: Making Decisions
Basic Concepts of Algorithm
Learning Intention I will learn about the standard algorithm for input validation.
CS410 – Software Engineering Lecture #11: Testing II
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 1: Creating a Program.
Unit Testing.
Presentation transcript:

Automated test

Car diagnose computer

Car diagnose computer Car has to be build to be tested Each test will tell of a potential error Only errors that matters will be reported If all tests succeed, it is safe to drive the car

Class diagnosis ClassCar has to be build to be tested Each test will tell of a potential error Only errors that matters will be reported If all tests succeed, commit drive the Class car Which aspects of the CarClass should we test? How to make it easy to test a CarClass How to automate the test To make it easy to test after you have made changes

Test concepts – expected behaviour To test a method, we need to specify what are the expected behaviour Behaviour: Return value Thrown exceptions Calls to other objects Changes to the object of the method Changes to external components (for example database)

Three levels of tests Unit tests Integration tests System tests At the level of individual methods and classes Tool: JUnit Integration tests Across layers Tool: Mock objects System tests The whole system Tool: Mock, Performance

Specialized tests User interface tests Acceptance tests User testing Does the user inteface work correctly? Tools: Specialized automated input control Acceptance tests A contract between the developers and the product owner on when a user story is implemented Tools: Sometimes automates, sometimes not User testing Letting future users of the system try to use a preliminary version of the system to see if they can use the program to solve their tasks.

V model

Positive- & negative testing Positive tests Confirms that (or disproves) that the system works as expected. Negative tests Confirms that (or disproves) that the system handles errors properly when the user misbehaves Junit 4

White-box & black-box testing White-box testing focuses on the text of the program. The tester constructs a test suite that demonstrates that all branches of the program can be executed. The test suite is said to cover the statements of the program. Black-box testing focuses on the problem that the program is supposed to solve More precisely, the problem statement or specification for the program.

Example 2.1

Example 2.1

Constructing test input The resulting test suite includes enough input data sets to make sure that: all methods have been called, that both the true and false branches have been executed in if statements, that every loop has been executed zero, one, and more times – why is “more times” important? that all branches of every switch statement have been executed. For every input data set, the expected output must be specified also. The “more times” is important because there is a risk that we have not established the invariant inside the loop, and therefore that the loop will not run correctly the next time around. Or, explained without invariants. If we only check zero and one time, we only check if the program can continue correctly after the loop, not if we can enter the loop correctly again.

Test coverage In practice white box testing is done on Algorithms To analyze for security holes Normally one use automated test coverage tools: Measures to which extend our code has been tested Integrated into Netbeans – colors your code red, green, yellow It is pragmatic and “good enough”.