Software Engineering II Testing

Size: px
Start display at page:

Download "Software Engineering II Testing"

Transcription

1 Object-Oriented Software Engineering! Using UML, Patterns, and Java! Software Engineering II Testing 5 May 2009 Bernd Bruegge Applied Software Engineering Technische Universität München

2 Outline of Testing Today:! Terminology! Testing Activities! Unit testing! Integration testing! Testing strategy! Design patterns & testing! System testing! Function testing! Acceptance testing. Next Lecture:! Model-based Testing! U2TP Testing Profile 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 2!

3 Famous Problems! A F-16 fighter plane crossed the equator using autopilot! Result: plane flipped over! Reason?! Reuse of autopilot software from a rocket! The Therac-25 was a machine used for radiation therapy! Result: Patients were given massive overdoses of radiation, approximately 100 times the intended dose (6 deaths)"! Reason: Failure only occurred when a particular sequence of keys was entered on the VT-100 controlling a PDP-11: X,!, E, Enter! The "X erroneously selected 25MV photon mode. The Cursor up was an attempt to correct the mistake. The "E followed by "Enter then attempted to correctly select 25 MeV Electron mode.! The machine responded with an error message MALFUNCTION 54, which was not explained in the user manual. Machine shut down briefly and then showed under dosage of radiation.! Because of this the operator hit P to continue treatment.

4 Terminology! Failure: Any deviation of the observed behavior from the specified behavior! Erroneous state (error): The system is in a state such that further processing by the system can lead to a failure! Fault: The mechanical or algorithmic cause of an error ( bug )! Validation: Activity of checking for deviations between the observed behavior of a system and its specification Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 4!

5 What is this? A failure? An error? A fault? We eed to describe specified and desired behavior first! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 5!

6 Erroneous State ( Error ) 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 6!

7 Algorithmic Fault 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 7!

8 Mechanical Fault Superuser! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 8!

9 The F-16 Problem! Where is the failure?! Where is the error?! Where is the fault?! Bad use of implementation inheritance! A Plane is not a rocket. Rocket! Plane! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 9!

10 Examples of Faults and Errors! Faults in the Interface specification! Mismatch between what the client needs and what the server offers! Mismatch between requirements and implementation! Algorithmic Faults! Missing initialization! Incorrect branching condition! Missing test for null! Mechanical Faults (very hard to find)! Operating temperature outside of equipment specification! Errors! Null reference errors! Concurrency errors! Exceptions Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 10!

11 How do we deal with Errors, Failures and Faults? 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 11!

12 Modular Redundancy 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 12!

13 Declaring the Bug as a Feature 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 13!

14 Patching 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 14!

15 Testing 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 15!

16 Another View on How to Deal with Faults! Fault avoidance! Use a good methodology to reduce complexity! Use configuration management to prevent inconsistency! Apply verification to prevent algorithmic faults! Use reviews! Fault detection! Testing: Activity to provoke failures in a planned way! Debugging: Find and remove the cause (Faults) of an observed failure! Monitoring: Deliver information about state => Used during debugging! Fault tolerance! Enable exception handling! Provide modular redundancy Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 16!

17 Taxonomy for Fault Handling Techniques Fault Handling! Fault " Avoidance! Fault " Detection! Fault " Tolerance! Methodoloy! Configuration" Management! Atomic" Transactions! Modular" Redundancy! Verification! Testing! Debugging! Unit! Testing! Integration" Testing! System " Testing! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 17!

18 Observations! It is impossible to completely test any nontrivial module or system! Practical limitations: Complete testing is prohibitive in time and cost! Theoretical limitations: e.g. Halting problem! Testing can only show the presence of bugs, not their absence (Dijkstra).! Testing is not for free => Define your goals and priorities Edsger W. Dijkstra ( )"" " " "! - First Algol 60 Compiler! "- 1968:! - T.H.E.! - Go To considered Harmful, CACM! "- Since 1970 Focus on Verification! and Foundations of Computer Science! "-"1972 A. M. Turing Award! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 18!

19 Testing takes creativity! To develop an effective test, one must have:! Detailed understanding of the system! Application and solution domain knowledge! Knowledge of the testing techniques! Skill to apply these techniques! Testing is done best by independent testers! We often develop a certain mental attitude that the program should in a certain way when in fact it does not behave!! Programmers often stick to the data set that makes the program work! A program often does not work when tried by somebody else Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 19!

20 Testing Activities Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing! Object" Design! Document! System" Design! Document! Requirements" Analysis! Document! Client! Expectation! Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing! Developer! Client! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 20!

21 Types of Testing Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Unit Testing! Individual component (class or subsystem)! Carried out by developers! Goal: Confirm that the component or subsystem is correctly coded and carries out the intended functionality! Integration Testing! Groups of subsystems (collection of subsystems) and eventually the entire system! Carried out by developers! Goal: Test the interfaces among the subsystems Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 21!

22 Types of Testing continued... Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! System Testing! The entire system! Carried out by developers! Goal: Determine if the system meets the requirements (functional and nonfunctional)! Acceptance Testing! Evaluates the system delivered by developers! Carried out by the client. May involve executing typical transactions on site on a trial basis! Goal: Demonstrate that the system meets the requirements and is ready to use Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 22!

23 When should you write a test?! Traditionally after the source code to be tested! In XP before the source code to be tested! Test-Driven Development Cycle! Add a test! Run the automated tests => see the new one fail! Write some code! Run the automated tests => see them succeed! Refactor code Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 23!

24 Unit Testing Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Static Testing (at compile time)! Static Analysis! Review! Walk-through (informal)! Code inspection (formal)! Dynamic Testing (at run time)! Black-box testing! White-box testing Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 24!

25 Static Analysis with Eclipse Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Compiler Warnings and Errors! Possibly uninitialized Variable! Undocumented empty block! Assignment has no effect! Checkstyle! Check for code guideline violations! FindBugs! Check for code anomalies! Metrics! Check for structural anomalies! Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 25!

26 Black-box testing Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Focus: I/O behavior! If for any given input, we can predict the output, then the component passes the test! Requires test oracle! Goal: Reduce number of test cases by equivalence partitioning:! Divide input conditions into equivalence classes! Choose test cases for each equivalence class Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 26!

27 Black-box testing: Test case selection a) Input is valid across range of values! Developer selects test cases from 3 equivalence classes:! Below the range! Within the range! Above the range b) Input is only valid, if it is a member of a discrete set! Developer selects test cases from 2 equivalence classes:! Valid discrete values! Invalid discrete values! No rules, only guidelines Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 27!

28 Lecture Check: Where are we? Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Terminology! Testing Activities! Unit testing! Static Testing! Dynamic Testing! Blackbox Testing!!Example 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 28!

29 Black box testing: An example public class MyCalendar { public int getnumdaysinmonth(int month, int year) throws InvalidMonthException { } } Representation for month:! 1: January, 2: February,., 12: December! Representation for year:! 1904, 1999, 2000,, 2006,! How many test cases do we need for the black box testing of getnumdaysinmonth()?! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 29!

30 White-box testing overview Unit" Testing! Integration" Testing! System" Testing! Acceptance" Testing!! Code coverage! Branch coverage! Condition coverage! Path coverage => Details in the exercise session about testing 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 30!

31 Unit Testing Heuristics 1. Create unit tests when object design is completed! Black-box test: Test the functional model! White-box test: Test the dynamic model 2. Develop the test cases! Goal: Find effective number of test cases 3. Cross-check the test cases to eliminate duplicates! Don't waste your time! 4. Desk check your source code! Sometimes reduces testing time 5. Create a test harness! Test drivers and test stubs are needed for integration testing 6. Describe the test oracle! Often the result of the first successfully executed test 7. Execute the test cases! Re-execute test whenever a change is made ( regression testing ) 8. Compare the results of the test with the test oracle! Automate this if possible Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 31!

32 Unit" Testing! Excursion J_Unit: A Java Framework for unit testing Integration" Testing! System" Testing! Acceptance" Testing!! A Java framework for writing and running unit tests! Test cases and fixtures! Test suites! Test runner! Written by Kent Beck and Erich Gamma! Written with test first and pattern-based development in mind! Tests written before code! Allows for regression testing! Facilitates refactoring! JUnit is Open Source! JUnit Version 4.6, released April Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 32!

33 JUnit Classes TestResult Test * run(testresult) Skip! J_Unit! Slides! TestCase testname:string run(testresult) setup() teardown() runtest() ConcreteTestCase setup() teardown() runtest() TestSuite run(testresult) addtest() UnitToBeTested Methods under Test! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 33!

34 An example: Testing MyList! Unit to be tested! MyList! Methods under test! add()! remove()! contains()! size()! Concrete Test case! MyListTestCase 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 34!

35 TestResult Test * run(testresult) TestCase testname:string run(testresult) setup() teardown() runtest() TestSuite run(testresult) addtest() MyListTestCase MyList setup() teardown() runtest() testadd() testremove()! add() remove() contains() size()

36 Writing TestCases in JUnit public class MyListTestCase extends TestCase { public MyListTestCase(String name) { super(name); } public void testadd() { // Set up the test List alist = new MyList(); String anelement = a string ; // Perform the test alist.add(anelement); TestResult // Check if test succeeded asserttrue(alist.size() == 1); asserttrue(alist.contains(anelement)); } protected void runtest() { testadd(); } } TestCase testname:string run(testresult) setup() teardown() runtest() MyListTestCase setup() teardown() runtest() testadd() testremove()! Test run(testresult) * TestSuite run(testresult) addtest() MyList add() remove() contains() size() 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 36!

37 Writing Fixtures and Test Cases public class MyListTestCase extends TestCase { // private MyList alist; private String anelement; public void setup() { alist = new MyList(); anelement = a string ; } public void testadd() { alist.add(anelement); asserttrue(alist.size() == 1); asserttrue(alist.contains(anelement)); } public void testremove() { alist.add(anelement); alist.remove(anelement); asserttrue(alist.size() == 0); assertfalse(alist.contains(anelement)); } Test Fixture Test Case Test Case 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 37!

38 Collecting TestCases into TestSuites public static Test suite() { TestSuite suite = new TestSuite(); suite.addtest(new MyListTest( testadd )); suite.addtest(new MyListTest( testremove )); return suite; } Test * Composite Pattern! run(testresult) TestCase TestSuite testname:string run(testresult) setup() teardown() runtest() run(testresult) addtest() 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 38!

39 Design patterns in JUnit TestResult Test * Command Pattern run(testresult) Composite Pattern Template Method Pattern TestCase testname:string run(testresult) setup() teardown() runtest() TestSuite run(testresult) addtest() Adapter Pattern ConcreteTestCase setup() teardown() runtest() TestedUnit 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 39!

40 Design patterns in JUnit TestResult Test * Command Pattern run(testresult) Composite Pattern Template Method Pattern TestCase testname:string run(testresult) setup() teardown() runtest() TestSuite run(testresult) addtest() Adapter Pattern ConcreteTestCase setup() teardown() runtest() TestedUnit 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 40!

41 Other JUnit features! Textual and GUI interface! Displays status of tests! Displays stack trace when tests fail! Integrated with Maven and Continuous Integration! Build and Release Management Tool! Continous integration server for Java programs! All tests are run before release (regression tests)! Test results are advertised as a project report! Many specialized variants! Unit testing of web applications! J2EE applications 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 41!

42 Additional Readings! [Herman Bruyninckx] Embedded Control Systems Design, WikiBook, Learning from Failure: Embedded_Control_Systems_Design/ Learning_from_failure! [Dijkstra 68]! E. W. Dijkstra, "Letters to the editor: go to statement considered harmful, Communications of the ACM 11 (3): , March 1968! [Meszaros 2007]! G. Meszaros, xunit Test Patterns, Refactoring Test Code, Addison Wesley, 2007! Resources for Test Driven Development 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 42!

43 Object-Oriented Software Engineering! Using UML, Patterns, and Java! Testing Part 2: Integration & System Testing

44 Overview! Integration testing! Big bang! Bottom up! Top down! Sandwich! Continuous! System testing! Functional! Performance! Acceptance testing! Summary 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 44!

45 Integration Testing! The entire system is viewed as a collection of subsystems (sets of classes) determined during the system and object design! Goal: Test all interfaces between subsystems and the interaction of subsystems! The Integration testing strategy determines the order in which the subsystems are selected for testing and integration Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 45!

46 Why do we do integration testing?! Unit tests only test the unit in isolation! Many failures result from faults in the interaction of subsystems! Often many Off-the-shelf components are used that cannot be unit tested! Without integration testing the system test will be very time consuming! Failures that are not discovered in integration testing will be discovered after the system is deployed and can be very expensive Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 46!

47 Stubs and drivers! Driver:! A component, that calls the TestedUnit! Controls the test cases! Stub:! A component, the TestedUnit depends on! Partial implementation! Returns fake values. Driver! Tested! Unit! Stub! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 47!

48 Example: A 3-Layer-Design A! Spread" A! SheetView! (Spreadsheet) Layer I! B! Entity! Data" B! Model! C! Calculator! C! D! Currency! D! Converter! Layer II! E! F! G! BinaryFile" XMLFile" Currency" E! F! G! Storage! Storage! DataBase! Layer III! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 48!

49 Big-Bang Approach A! Test A! B! C! D! Test B! Test C! Test D! Test E! Test F! Test G! Test! A, B, C, D,! E, F, G! E! F! G! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 49!

50 Bottom-up Testing Strategy! The subsystems in the lowest layer of the call hierarchy are tested individually! Then the next subsystems are tested that call the previously tested subsystems! This is repeated until all subsystems are included! Drivers are needed Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 50!

51 Bottom-up Integration A! B! C! D! Test E! E! F! G! Test B, E, F! Test F! Test C! Test! A, B, C, D,! E, F, G! Test G! Test D,G! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 51!

52 Pros and Cons of Bottom-Up Integration Testing! Con:! Pro! Tests the most important subsystem (user interface) last! Drivers needed! No stubs needed! Useful for integration testing of the following systems! Object-oriented systems! Real-time systems! Systems with strict performance requirements Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 52!

53 Top-down Testing Strategy! Test the top layer or the controlling subsystem first! Then combine all the subsystems that are called by the tested subsystems and test the resulting collection of subsystems! Do this until all subsystems are incorporated into the test! Stubs are needed to do the testing Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 53!

54 Top-down Integration A! B! C! D! E! F! G! Test A! Test A, B, C, D! Test! A, B, C, D,! E, F, G! Layer I! Layer I + II! All Layers! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 54!

55 Pros and Cons of Top-down Integration Testing Pro! Test cases can be defined in terms of the functionality of the system (functional requirements)! No drivers needed Cons! Writing stubs is difficult: Stubs must allow all possible conditions to be tested.! Large number of stubs may be required, especially if the lowest level of the system contains many methods.! Some interfaces are not tested separately Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 55!

56 Sandwich Testing Strategy! Combines top-down strategy with bottom-up strategy! The system is viewed as having three layers! A target layer in the middle! A layer above the target! A layer below the target! Testing converges at the target layer Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 56!

57 Sandwich Testing Strategy A! B! C! D! Test A! Test E! Test A,B,C, D! E! F! G! Test F! Test B, E, F! Test! A, B, C, D,! E, F, G! Test D,G! Test G! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 57!

58 Pros and Cons of Sandwich Testing! Top and Bottom Layer Tests can be done in parallel! Problem: Does not test the individual subsystems and their interfaces thoroughly before integration! Solution: Modified sandwich testing strategy 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 58!

59 Modified Sandwich Testing Strategy! Test in parallel:! Middle layer with drivers and stubs! Top layer with stubs! Bottom layer with drivers! Test in parallel:! Top layer accessing middle layer (top layer replaces drivers)! Bottom accessed by middle layer (bottom layer replaces stubs) Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 59!

60 Modified Sandwich Testing A! Test A! Test C! Test A,C! B! C! D! E! F! G! Test B! Test E! Test F! Test B, E, F! Test! A, B, C, D,! E, F, G! Test D! Test G! Test D,G! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 60!

61 Continuous Testing! Continuous build:! Build from day one! Test from day one! Integrate from day one!! System is always runnable! Requires integrated tool support:! Continuous build server! Automated tests with high coverage! Tool supported refactoring! Software configuration management! Issue tracking Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 61!

62 Continuous Testing Strategy A! Spread" SheetView! Layer I! B! Data" Model! C! Calculator! D! Currency! Converter! Layer II! E! F! BinaryFile" Storage! XMLFile" Storage! G! Currency" DataBase! Layer III! Sheet View! + Cells! + Addition! + File Storage! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 62!

63 Steps in Integration Testing 1. Based on the integration strategy, select a component to be tested. Unit test all the classes in.! the component. 2. Put selected component together; do any preliminary fix-up necessary to make the integration test operational (drivers, stubs) 3. Test functional requirements: Define test cases that exercise all uses cases with the selected component 4. Test subsystem decomposition: Define test cases that exercise all dependencies 5. Test non-functional requirements: Execute performance tests 6. Keep records of the test cases and testing activities. 7. Repeat steps 1 to 7 until the full system is tested. The primary goal of integration testing is to identify failures with the (current) component configuration Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 63!

64 System Testing! Functional Testing! Validates functional requirements! Performance Testing! Validates non-functional requirements! Acceptance Testing! Validates clients expectations 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 64!

65 Functional Testing Goal: Test functionality of system! Test cases are designed from the requirements analysis document (better: user manual) and centered around requirements and key functions (use cases)! The system is treated as black box! Unit test cases can be reused, but new test cases have.! to be developed as well Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 65!

66 Performance Testing Goal: Try to violate non-functional requirements! Test how the system behaves when overloaded.! Can bottlenecks be identified? (First candidates for redesign in the next iteration)! Try unusual orders of execution! Call a receive() before send()! Check the system s response to large volumes of data! If the system is supposed to handle 1000 items, try it with 1001 items.! What is the amount of time spent in different use cases?! Are typical cases executed in a timely fashion? 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 66!

67 Types of Performance Testing! Stress Testing! Stress limits of system! Volume testing! Test what happens if large amounts of data are handled! Configuration testing! Test the various software and hardware configurations! Compatibility test! Test backward compatibility with existing systems! Timing testing! Evaluate response times and time to perform a function! Security testing! Try to violate security requirements! Environmental test! Test tolerances for heat, humidity, motion! Quality testing! Test reliability, maintainability & availability! Recovery testing! Test system s response to presence of errors or loss of data! Human factors testing! Test with end users Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 67!

68 Acceptance Testing! Goal: Demonstrate system is ready for operational use! Choice of tests is made by client! Many tests can be taken from integration testing! Acceptance test is performed by the client, not by the developer.! Alpha test:! Client uses the software at the developer s environment.! Software used in a controlled setting, with the developer always ready to fix bugs.! Beta test:! Conducted at client s environment (developer is not present)! Software gets a realistic workout in target environment 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 68!

69 Testing has many activities Establish the test objectives! Design the test cases! Write the test cases! Test the test cases! Execute the tests! Evaluate the test results! Change the system! Do regression testing! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 69!

70 Test Team Analyst! Professional! Tester! Programmer! too familiar! with code! User! Test! Team! System! Designer! Configuration! Management! Specialist! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 70!

71 The 4 Testing Steps 1. Select what has to be tested! Analysis: Completeness of requirements! Design: Cohesion! Implementation: Source code 2. Decide how the testing is done! Review or code inspection! Proofs (Design by Contract)! Black-box, white box,! Select integration testing strategy (big bang, bottom up, top down, sandwich) 3. Develop test cases! A test case is a set of test data or situations that will be used to exercise the unit (class, subsystem, system) being tested or about the attribute being measured 4. Create the test oracle! An oracle contains the predicted results for a set of test cases! The test oracle has to be written down before the actual testing takes place Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 71!

72 Guidance for Test Case Selection! Use analysis knowledge about functional requirements (black-box testing):! Use cases! Expected input data! Invalid input data! Use design knowledge about system structure, algorithms, data structures (white-box testing):! Control structures! Test branches, loops,...! Data structures! Test records fields, arrays,...! Use implementation knowledge about algorithms and datastructures:! Force a division by zero! If the upper bound of an array is 10, then use 11 as index Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 72!

73 Summary! Testing is still a black art, but many rules and heuristics are available! Testing consists of! Unit testing! Integration testing! System testing! Acceptance testing! Design patterns can be used for integration testing! Testing has its own lifecycle 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 73!

74 Additional Reading! Lecture: Prozesse und Methoden beim Testen von Software, Dr. Stefan Kriebel! Andreas Spillner, Tilo Linz, Basiswissen Softwaretest, dpunkt.verlag, 2004! JUnit Website J. Thomas, M. Young, K. Brown, A. Glover, Java Testing Patterns, Wiley, 2004! D. Saff and M. D. Ernst, An experimental evaluation of continuous testing during development Int. Symposium on Software Testing and Analysis, Boston July 12-14, 2004, pp "! A controlled experiment shows that developers using continuous testing were three times more likely to complete the task before the deadline than those without Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 74!

75 Object-Oriented Software Engineering! Using UML, Patterns, and Java! Testing, Part 3 Model-based Testing

76 Outline of the Lectures on Testing "!Terminology "!Types of errors "!Approaches for dealing with errors "!Testing activities "!Unit testing "!Integration testing "!System testing! Model-based Testing 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 76!

77 Generating Tests from a System Model! There are many different ways to "derive" tests from a system model"! Manual generation"! Automatic generation"! Because testing is usually experimental and based on heuristics, there is no one best way to do this. "! It is common to consolidate all test related decisions into a package that is often known as "test requirements or "test package."! This test package can contain e.g. information about the part of the system model that should be the focus for testing, or about the conditions where it is correct to stop testing (test stopping criteria)." 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 77!

78 Model Driven Architecture (MDA)! Recall: MDA focuses on forward engineering, i.e. producing code from a system model! Note: The term architecture in MDA does not mean the architecture of the system being modeled, but refers the architecture of the various standards and models that serve as the technology basis for MDA! UML: Unified Modeling Language! MOF: Meta-Object Facility! XMI: Metadata Interchange! EDOC: Enterprise Distributed Object Computing! SPEM: Software Process Engineering Metamodel! CWM: Common Warehouse Metamodel An important objective of MDA is executable UML Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 78!

79 Executable UML! Executable UML means that given a UML system model the following steps can be performed automatically:! Code generation! Simulation Validation! Test generation ( Model based Testing ) 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 79!

80 Model Based Testing! Definition Model Based Testing: All testing is based on a system model which is used to (manually) generate test cases and oracles! Advantage:! Increased effectiveness of testing! Decreased costs! Reuse of artifacts such as analysis and design models! Requirement:! The system model is formalized (specification model) and described in UML Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 80!

81 Model Driven Testing! Model Driven Testing is a special case of model based testing:! All the test cases are automatically generated from the system model! Advantage:! Automatic generation of tests suites! Better test thoroughness! Reduces the cost of test execution Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 81!

82 Observations on Model Based Testing! A system model is an abstract representation of the system s desired behavior! The test cases derived from this model are functional tests on the same level of abstraction as the model! These test cases are known as the abstract test suite! Because test suites are derived from models - not from source code - model-based testing is a form of black-box testing"! The abstract test suite cannot be executed! An executable test suite must be derived from the abstract test suite which communicates with the system under test (SUT)! This is done by mapping the abstract test suite to concrete test cases suitable for execution.! Mapping is not part of this lecture Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 82!

83 U2TP! UML-2 Testing Profile (U2TP):! A UML extension that makes UML applicable to software testing.! U2TP allows the collection of all information required for the model-based testing process! Deriving a test model from the system model.! Test Model:! A set of test cases derived from the system model Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 83!

84 General Definitions used in U2TP! Test: An attempt to create a difference between the observed behavior and the specified behavior of a system a planned way! Test data: The structures and meaning of values to be processed in a test! System under test (SUT)! A system, subsystem or component! The SUT is treated as black-box. This means:! The SUT can be accessed only via a public interface! No information on the internal structure of the SUT is available for use in the specification of test cases.! Test case: Describes a specified behavior, that is, a behavior specified in the system model (normative behavior) of the SUT Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 84!

85 Test Objective! Test objective! Find any difference between the observed behavior and the specified behavior, that is, the behavior specified in the system model.! UML Example! The test objective in the diagram below specifies that the objective of the ValidWithdrawal test case is to validate the WithdrawMoney use case. <<testcase>>! ValidWithdrawal! <<objective>>! <<usecase>>! WithdrawMoney! 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 85!

86 Test Architecture Definitions! Test component: An object within a test system! Test architecture: The test components and their relationships in a test system! Testing configuration: The combination of a test system with a SUT! Test control: A ordering of the execution of the tests performed on the SUT! Test context: A description of! A set of test cases! A test configuration! A test control Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 86!

87 Example: Test System for a Vending Machine! Vending Machine with 2 use cases:! The user inserts money! A bottle is returned, when the inserted money equals the price of the bottle Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 87!

88 Model-based Testing of MoneyBox Test System! SUT! The test system MoneyUnitTest is developed with the purpose of unit testing the Moneybox, which is part of the system under test MoneyBox must be imported by MoneyUnitTest to be accessible Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 88!

89 UML Model of the MoneyBox Now we need to test that the machine correctly counts the money inserted by the user into the Moneybox -> MoneyUnitTest 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 89!

90 Model-based Testing of MoneyBox Test System! Test Context! SUT! Test Case! MoneyBox is the system under test MoneyUnitTest is the test system MoneyTest is the test context addmoneytest is the test case 2009 Bernd Bruegge!!!! Software Engineering II, Lecture 3: Testing!! 90!

Chapter 11, Testing, Part 2: Integration and System Testing

Chapter 11, Testing, Part 2: Integration and System Testing Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 11, Testing, Part 2: Integration and System Testing Overview Integration testing Big bang Bottom up Top down Sandwich System testing

More information

Chapter 11, Testing, Part 2: Integration and System Testing

Chapter 11, Testing, Part 2: Integration and System Testing Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 11, Testing, Part 2: Integration and System Testing Overview Integration testing Big bang Bottom up Top down Sandwich System testing

More information

Chapter 11, Testing, Part 2: Integration and System Testing

Chapter 11, Testing, Part 2: Integration and System Testing Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 11, Testing, Part 2: Integration and System Testing Overview Integration testing Big bang Bottom up Top down Sandwich System testing

More information

Terminology. There are many different types of errors and different ways how we can deal with them.

Terminology. There are many different types of errors and different ways how we can deal with them. Testing Terminology Reliability: The measure of success with which the observed behavior of a system confirms to some specification of its behavior. Failure: Any deviation of the observed behavior from

More information

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 9, Testing

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 9, Testing Object-Oriented Software Engineering Conquering Complex and Changing Systems Chapter 9, Testing Preliminaries Written exam on for Bachelors of Informatik, and for other students who are not in the Informatik

More information

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering Chapter 11, Testing Using UML, Patterns, and Java Object-Oriented Software Engineering Outline Terminology Types of errors Dealing with errors Quality assurance vs Testing Component Testing! Unit testing!

More information

Testing. Outline. What is this? Terminology. Erroneous State ( Error ) Algorithmic Fault

Testing. Outline. What is this? Terminology. Erroneous State ( Error ) Algorithmic Fault Outline 1 Terminology Types of errors Dealing with errors Quality assurance vs Component Unit testing Integration testing Strategy Design Patterns & testing unction testing Structure Performance testing

More information

Chapter 11, Testing Part 1: Unit Testing. <M. Cossentino>

Chapter 11, Testing Part 1: Unit Testing. <M. Cossentino> Chapter 11, Testing Part 1: Unit Testing Outline of the Lectures on Testing Terminology Failure, Error, Fault Test Model Model-based testing Testing activities Unit testing Integration

More information

Test Driven Development Building a fortress in a greenfield (or fortifying an existing one) Dr. Hale University of Nebraska at Omaha

Test Driven Development Building a fortress in a greenfield (or fortifying an existing one) Dr. Hale University of Nebraska at Omaha Test Driven Development Building a fortress in a greenfield (or fortifying an existing one) Dr. Hale University of Nebraska at Omaha Today s topics: Software Testing and Test driven development Unit /

More information

Modern Methods in Software Engineering. Testing.

Modern Methods in Software Engineering. Testing. Modern Methods in Software Engineering Testing www.imit.kth.se/courses/2g1522 Literature used Text book Chapter 11 Introduction Content Terminology Types of errors Dealing with errors Component Testing

More information

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing. Overview CS 619 Introduction to OO Design and Development ing! Preliminaries! All sorts of test techniques! Comparison of test techniques! Software reliability Fall 2012! Main issues: There are a great

More information

Software Engineering (CSC 4350/6350) Rao Casturi

Software Engineering (CSC 4350/6350) Rao Casturi Software Engineering (CSC 4350/6350) Rao Casturi Testing Software Engineering -CSC4350/6350 - Rao Casturi 2 Testing What is testing? Process of finding the divergence between the expected behavior of the

More information

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015 Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm Rao Casturi 11/10/2015 http://cs.gsu.edu/~ncasturi1 Class announcements Final Exam date - Dec 1 st. Final Presentations Dec 3 rd. And

More information

Software Engineering Fall 2014

Software Engineering Fall 2014 Software Engineering Fall 2014 (CSC 4350/6350) Mon.- Wed. 5:30 pm 7:15 pm ALC : 107 Rao Casturi 11/10/2014 Final Exam date - Dec 10 th? Class announcements Final Presentations Dec 3 rd. And Dec 8 th. Ability

More information

Chapter 9 Quality and Change Management

Chapter 9 Quality and Change Management MACIASZEK, L.A. (2007): Requirements Analysis and System Design, 3 rd ed. Addison Wesley, Harlow England ISBN 978-0-321-44036-5 Chapter 9 Quality and Change Management Pearson Education Limited 2007 Topics

More information

Software Engineering Theory. Lena Buffoni (slides by Kristian Sandahl/Mariam Kamkar) Department of Computer and Information Science

Software Engineering Theory. Lena Buffoni (slides by Kristian Sandahl/Mariam Kamkar) Department of Computer and Information Science Software Engineering Theory Lena Buffoni (slides by Kristian Sandahl/Mariam Kamkar) Department of Computer and Information Science 2015-09-20 Title/Lecturer SEPTEMBER 20, 2016 2 Requirement formalization

More information

Pearson Education 2007 Chapter 9 (RASD 3/e)

Pearson Education 2007 Chapter 9 (RASD 3/e) MACIASZEK, L.A. (2007): Requirements Analysis and System Design, 3 rd ed. Addison Wesley, Harlow England ISBN 978-0-321-44036-5 Chapter 9 Quality and Change Management Pearson Education Limited 2007 Topics

More information

Testing Stragegies. Black Box Testing. Test case

Testing Stragegies. Black Box Testing. Test case References: Teach Yourself Object-Oriented Programming in 21 Days by A.Sintes, 1 Testing Stragegies Test case a set of inputs and expected outputs looks at specific piece of functionality to determine

More information

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo Software Design Models, Tools & Processes Lecture 6: Transition Phase Cecilia Mascolo UML Component diagram Component documentation Your own classes should be documented the same way library classes are.

More information

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1 Verification vs validation Verification: "Are we building the product right?. The software should

More information

Lecture 15 Software Testing

Lecture 15 Software Testing Lecture 15 Software Testing Includes slides from the companion website for Sommerville, Software Engineering, 10/e. Pearson Higher Education, 2016. All rights reserved. Used with permission. Topics covered

More information

MONIKA HEINER.

MONIKA HEINER. LESSON 1 testing, intro 1 / 25 SOFTWARE TESTING - STATE OF THE ART, METHODS, AND LIMITATIONS MONIKA HEINER monika.heiner@b-tu.de http://www.informatik.tu-cottbus.de PRELIMINARIES testing, intro 2 / 25

More information

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals Software Testing in the textbook Software Testing Chapter 8 Introduction (Verification and Validation) 8.1 Development testing 8.2 Test-driven development 8.3 Release testing 8.4 User testing 1 2 Verification

More information

Integration and Testing. Uses slides from Lethbridge & Laganiere, 2001

Integration and Testing. Uses slides from Lethbridge & Laganiere, 2001 Integration and Testing Uses slides from Lethbridge & Laganiere, 2001 Testing phases: V model Requirements Acceptance Testing Specifications System Testing Design Integration Testing Detailed Design Unit

More information

Learning outcomes. Systems Engineering. Debugging Process. Debugging Process. Review

Learning outcomes. Systems Engineering. Debugging Process. Debugging Process. Review Systems Engineering Lecture 9 System Verification II Dr. Joanna Bryson Dr. Leon Watts University of Bath Department of Computer Science 1 Learning outcomes After both lectures and doing the reading, you

More information

https://www.lri.fr/ linaye/gl.html

https://www.lri.fr/ linaye/gl.html Software Engineering https://www.lri.fr/ linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/61 Software Engineering Plan 1 2 3 4 5 2/61 Software Engineering Software Testing 3/61 Software

More information

Chapter 8 Software Testing. Chapter 8 Software testing

Chapter 8 Software Testing. Chapter 8 Software testing Chapter 8 Software Testing 1 Topics covered Introduction to testing Stages for testing software system are: Development testing Release testing User testing Test-driven development as interleave approach.

More information

Software Testing Interview Question and Answer

Software Testing Interview Question and Answer Software Testing Interview Question and Answer What is Software Testing? A process of analyzing a software item to detect the differences between existing and required conditions (i.e., defects) and to

More information

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification Techniques

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification Techniques Software Testing in the textbook Software Testing Chapter 8 Introduction (Verification and Validation) 8.1 Development testing 8.2 Test-driven development 8.3 Release testing 8.4 User testing 1 2 Verification

More information

Manuel Oriol, CHCRC-C, Software Testing ABB

Manuel Oriol, CHCRC-C, Software Testing ABB Manuel Oriol, CHCRC-C, 08.11.2017 Software Testing Slide 1 About me 1998 2004 2005 2008 2011 Slide 2 Introduction Why do we test? Did you have to deal with testing in the past? Slide 3 Ariane 5 http://www.youtube.com/watch?v=kyurqduyepi

More information

Topics in Software Testing

Topics in Software Testing Dependable Software Systems Topics in Software Testing Material drawn from [Beizer, Sommerville] Software Testing Software testing is a critical element of software quality assurance and represents the

More information

Part 5. Verification and Validation

Part 5. Verification and Validation Software Engineering Part 5. Verification and Validation - Verification and Validation - Software Testing Ver. 1.7 This lecture note is based on materials from Ian Sommerville 2006. Anyone can use this

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies CODING Good software development organizations normally require their programmers to follow some welldefined and standard style of coding called coding standards. Most software development organizations

More information

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)? Testing CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Testing Feb. 15, 2007 Some slides adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Execute program on sample input

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

More information

Problem other classes messing with my stuff!

Problem other classes messing with my stuff! Cloning Problem other classes messing with my stuff! Java Message passing is pass by reference Setting a instance field equal to a constructor parameter that is a mutable object means that if that object

More information

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software Testing Basic ideas and principles Traditional testing strategies Unit, integration, regression, validation, system OO Testing techniques Application of traditional techniques to OO software Testing-11,

More information

Software Testing Lecture 1. Justin Pearson

Software Testing Lecture 1. Justin Pearson Software Testing Lecture 1 Justin Pearson 2017 1 / 50 Four Questions Does my software work? 2 / 50 Four Questions Does my software work? Does my software meet its specification? 3 / 50 Four Questions Does

More information

Chapter 9. Software Testing

Chapter 9. Software Testing Chapter 9. Software Testing Table of Contents Objectives... 1 Introduction to software testing... 1 The testers... 2 The developers... 2 An independent testing team... 2 The customer... 2 Principles of

More information

Bridge Course On Software Testing

Bridge Course On Software Testing G. PULLAIAH COLLEGE OF ENGINEERING AND TECHNOLOGY Accredited by NAAC with A Grade of UGC, Approved by AICTE, New Delhi Permanently Affiliated to JNTUA, Ananthapuramu (Recognized by UGC under 2(f) and 12(B)

More information

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams Three General Principles of QA COMP 4004 Fall 2008 Notes Adapted from Dr. A. Williams Software Quality Assurance Lec2 1 Three General Principles of QA Know what you are doing. Know what you should be doing.

More information

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process Verification and Validation Assuring that a software system meets a user s needs Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapters 19,20 Slide 1

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 15 Testing Where we are Some very basic software engineering topics in the midst of tools Today: testing (how, why, some terms) Later:

More information

Unit Testing with JUnit and CppUnit

Unit Testing with JUnit and CppUnit Unit Testing with JUnit and CppUnit Software Testing Fundamentals (1) What is software testing? The process of operating a system or component under specified conditions, observing or recording the results,

More information

Fault, Error, and Failure

Fault, Error, and Failure Fault, Error, and Failure Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel based on slides by Prof. Lin Tan and others Terminology, IEEE 610.12-1990 Fault -- often referred

More information

Chapter 14 Software Testing Techniques

Chapter 14 Software Testing Techniques Software Engineering: A Practitioner s s Approach, 6/e Chapter 14 Software Testing Techniques copyright 1996, 2001, 2005 R.S. Pressman & Associates, Inc. For University Use Only May be reproduced ONLY

More information

Verification and Validation

Verification and Validation Chapter 5 Verification and Validation Chapter Revision History Revision 0 Revision 1 Revision 2 Revision 3 Revision 4 original 94/03/23 by Fred Popowich modified 94/11/09 by Fred Popowich reorganization

More information

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties Why testing and analysis Software Testing Adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Software is never correct no matter what developing testing technique is used All software must be

More information

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015 xtreme Programming (summary of Kent Beck s XP book) 1 Contents The software development problem The XP solution The JUnit testing framework 2 The Software Development Problem 3 Risk Examples delivery schedule

More information

Agile Software Development. Lecture 7: Software Testing

Agile Software Development. Lecture 7: Software Testing Agile Software Development Lecture 7: Software Testing Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Slides are a modified version of the slides by Prof. Kenneth M. Anderson Outline Testing Terminology Types

More information

Program Correctness and Efficiency. Chapter 2

Program Correctness and Efficiency. Chapter 2 Program Correctness and Efficiency Chapter 2 Chapter Objectives To understand the differences between the three categories of program errors To understand the effect of an uncaught exception and why you

More information

TDDD04: Integration and System level testing. Lena Buffoni

TDDD04: Integration and System level testing. Lena Buffoni TDDD04: Integration and System level testing Lena Buffoni lena.buffoni@liu.se Lecture plan Integration testing System testing Test automation Model-based testing Remember? Testing in the waterfall model

More information

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Yan Shi SE 2730 Lecture Notes Verification and Validation Verification: Are

More information

Software Testing. Suppose you are asked:

Software Testing. Suppose you are asked: Software Testing Big Picture, Major Concepts and Techniques Suppose you are asked: Would you trust a completely automated nuclear power plant? Would you trust a completely automated pilot? What if the

More information

Higher-order Testing. Stuart Anderson. Stuart Anderson Higher-order Testing c 2011

Higher-order Testing. Stuart Anderson. Stuart Anderson Higher-order Testing c 2011 Higher-order Testing Stuart Anderson Defining Higher Order Tests 1 The V-Model V-Model Stages Meyers version of the V-model has a number of stages that relate to distinct testing phases all of which are

More information

Verification and Validation. Verification and validation

Verification and Validation. Verification and validation Verification and Validation Verification and validation Verification and Validation (V&V) is a whole life-cycle process. V&V has two objectives: Discovery of defects, Assessment of whether or not the system

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management

Ingegneria del Software Corso di Laurea in Informatica per il Management Ingegneria del Software Corso di Laurea in Informatica per il Management Software testing Davide Rossi Dipartimento di Informatica Università di Bologna Validation and verification Software testing is

More information

Test automation / JUnit. Building automatically repeatable test suites

Test automation / JUnit. Building automatically repeatable test suites Test automation / JUnit Building automatically repeatable test suites Test automation n Test automation is software that automates any aspect of testing n Generating test inputs and expected results n

More information

Test automation Test automation / JUnit

Test automation Test automation / JUnit Test automation Test automation / JUnit Building automatically repeatable test suites Test automation is software that automates any aspect of testing Generating test inputs and expected results Running

More information

People tell me that testing is

People tell me that testing is Software Testing Mark Micallef mark.micallef@um.edu.mt People tell me that testing is Boring Not for developers A second class activity Not necessary because they are very good coders 1 What is quality?

More information

Verification and Validation

Verification and Validation Steven Zeil February 13, 2013 Contents 1 The Process 3 1 2 Non-Testing V&V 7 2.1 Code Review....... 8 2.2 Mathematically-based verification......................... 19 2.3 Static analysis tools... 23 2.4

More information

Verification and Validation

Verification and Validation Steven Zeil February 13, 2013 Contents 1 The Process 2 2 Non-Testing V&V 3 2.1 Code Review........... 4 2.2 Mathematically-based verification.................................. 8 2.3 Static analysis tools.......

More information

Model driven Engineering & Model driven Architecture

Model driven Engineering & Model driven Architecture Model driven Engineering & Model driven Architecture Prof. Dr. Mark van den Brand Software Engineering and Technology Faculteit Wiskunde en Informatica Technische Universiteit Eindhoven Model driven software

More information

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia Topic: Software Verification, Validation and Testing Software Engineering Faculty of Computing Universiti Teknologi Malaysia 2016 Software Engineering 2 Recap on SDLC Phases & Artefacts Domain Analysis

More information

EECS 4313 Software Engineering Testing

EECS 4313 Software Engineering Testing EECS 4313 Software Engineering Testing Topic 03: Test automation / JUnit - Building automatically repeatable test suites Zhen Ming (Jack) Jiang Acknowledgement Some slides are from Prof. Alex Orso Relevant

More information

Analysis of the Test Driven Development by Example

Analysis of the Test Driven Development by Example Computer Science and Applications 1 (2013) 5-13 Aleksandar Bulajic and Radoslav Stojic The Faculty of Information Technology, Metropolitan University, Belgrade, 11000, Serbia Received: June 18, 2013 /

More information

CMSC 132: OBJECT-ORIENTED PROGRAMMING II

CMSC 132: OBJECT-ORIENTED PROGRAMMING II CMSC 132: OBJECT-ORIENTED PROGRAMMING II Program Testing Department of Computer Science University of Maryland, College Park Debugging Is Harder Than Coding! Debugging is twice as hard as writing the code

More information

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs. In this Lecture you will Learn: Testing in Software Development Process Examine the verification and validation activities in software development process stage by stage Introduce some basic concepts of

More information

Junit Overview. By Ana I. Duncan

Junit Overview. By Ana I. Duncan Junit Overview By Ana I. Duncan 1 What Is Junit Why Junit, Why test? Junit Lifecycle Junit Examples from CM Other Testing frameworks Resources Before After Agenda 2 JUnit is a member of the xunit testing

More information

Testing & Debugging TB-1

Testing & Debugging TB-1 Testing & Debugging TB-1 Need for Testing Software systems are inherently complex» Large systems 1 to 3 errors per 100 lines of code (LOC) Extensive verification and validiation is required to build quality

More information

4. A Testing Framework

4. A Testing Framework 4. A Testing Framework Oscar Nierstrasz A Testing Framework Sources > JUnit documentation (from www.junit.org) 2 Roadmap > Junit a testing framework Testing practices Frameworks vs. Libraries Junit 3.x

More information

Program Verification! Goals of this Lecture! Words from the Wise! Testing!

Program Verification! Goals of this Lecture! Words from the Wise! Testing! Words from the Wise Testing On two occasions I have been asked [by members of Parliament], Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out? I am not able rightly

More information

Testing: Test design and testing process

Testing: Test design and testing process Testing: Test design and testing process Zoltán Micskei Based on István Majzik s slides Dept. of Measurement and Information Systems Budapest University of Technology and Economics Department of Measurement

More information

Software Testing CS 408

Software Testing CS 408 Software Testing CS 408 1/09/18 Course Webpage: http://www.cs.purdue.edu/homes/suresh/408-spring2018 1 The Course Understand testing in the context of an Agile software development methodology - Detail

More information

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6! Testing The material for this lecture is drawn, in part, from The Practice of Programming (Kernighan & Pike) Chapter 6 1 Words from the Wise On two occasions I have been asked [by members of Parliament],

More information

EECS 4313 Software Engineering Testing. Topic 01: Limits and objectives of software testing Zhen Ming (Jack) Jiang

EECS 4313 Software Engineering Testing. Topic 01: Limits and objectives of software testing Zhen Ming (Jack) Jiang EECS 4313 Software Engineering Testing Topic 01: Limits and objectives of software testing Zhen Ming (Jack) Jiang Acknowledge Some of the contents are from Prof. Alex Orso, Bil Tzerpos and Gunnar Gotshalks

More information

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013! Testing Prof. Leon Osterweil CS 520/620 Spring 2013 Relations and Analysis A software product consists of A collection of (types of) artifacts Related to each other by myriad Relations The relations are

More information

The Importance of Test

The Importance of Test Software Testing Mistake in coding is called error, Error found by tester is called defect, Defect accepted by development team is called bug, Product does not meet the requirements then it Is failure.

More information

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) More Analysis for Functional Correctness Jonathan Aldrich Charlie Garrod School of Computer Science

More information

Software testing A.A. 2018/2019

Software testing A.A. 2018/2019 Software testing A.A. 2018/2019 Testing Testing is intended to show that a program does what it is intended to do and to discover program defects before it is put into use. When you test software, you

More information

Lecture 3. Black- box Tes3ng

Lecture 3. Black- box Tes3ng Lecture 3 Black- box Tes3ng Black- box Tes3ng Test cases are constructed without reference to the code structure + Can test the requirements not the code + Can overcome combinatorial explosions + Complementary

More information

Automated Acceptance Testing

Automated Acceptance Testing Automated Acceptance Testing Björn Beskow Callista Enterprise AB bjorn.beskow@callista.se http://www.callista.se/enterprise CADEC 2004-01-28, Automated Acceptance Testing, Slide 1 Target audience and Objectives

More information

Software Testing. Massimo Felici IF

Software Testing. Massimo Felici IF Software Testing Massimo Felici IF-3.46 0131 650 5899 mfelici@staffmail.ed.ac.uk What is Software Testing? Software Testing is the design and implementation of a special kind of software system: one that

More information

Test automation / JUnit. Building automatically repeatable test suites

Test automation / JUnit. Building automatically repeatable test suites Test automation / JUnit Building automatically repeatable test suites JUnit in Eclipse For this course, we will use JUnit in Eclipse It is automatically a part of Eclipse One documentation site (all one

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Overview of testing techniques Monday March 3, 2014 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/70 Lecture outline Background, testing in general Unit testing

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

Introduction to Software Engineering

Introduction to Software Engineering Introduction to Software Engineering Gérald Monard Ecole GDR CORREL - April 16, 2013 www.monard.info Bibliography Software Engineering, 9th ed. (I. Sommerville, 2010, Pearson) Conduite de projets informatiques,

More information

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake Sample ISTQB examination 1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake 2 Regression testing should

More information

Tuesday, November 15. Testing

Tuesday, November 15. Testing Tuesday, November 15 1 Testing Testing Waterfall model show testing as an activity or box In practice, testing is performed constantly There has never been a project where there was too much testing. Products

More information

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Software Engineering 2 A practical course in software engineering. Ekkart Kindler Software Engineering 2 A practical course in software engineering Quality Management Main Message Planning phase Definition phase Design phase Implem. phase Acceptance phase Mainten. phase 3 1. Overview

More information

Software Testing. Testing: Our Experiences

Software Testing. Testing: Our Experiences Software Testing Testing: Our Experiences Test Case Software to be tested Output 1 Test Case Generation When to Stop? Test Case Software to be tested Verification Output No Enough? Test Coverage Yes A

More information

Software Engineering and Scientific Computing

Software Engineering and Scientific Computing Software Engineering and Scientific Computing Barbara Paech, Hanna Remmel Institute of Computer Science Im Neuenheimer Feld 326 69120 Heidelberg, Germany http://se.ifi.uni-heidelberg.de paech@informatik.uni-heidelberg.de

More information

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan heory Lecture Plan 2 esting heory Lecture 8 Software Engineering DDC88/DDC93 autumn 28 Department of Computer and Information Science Linköping University, Sweden L - Course Introduction and Overview L2

More information

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability Main concepts to be covered Testing and Debugging Testing Debugging Test automation Writing for maintainability 4.0 Code snippet of the day public void test() { int sum = 1; for (int i = 0; i

More information

Quality Assurance in Software Development

Quality Assurance in Software Development Quality Assurance in Software Development Qualitätssicherung in der Softwareentwicklung A.o.Univ.-Prof. Dipl.-Ing. Dr. Bernhard Aichernig Graz University of Technology Austria Summer Term 2017 1 / 47 Agenda

More information

S/W Programming & Languages

S/W Programming & Languages S/W Programming & Languages Overview Programming five steps Five generations High-level programming Object-oriented programming Internet programming 2 Programming What are the five steps of the programdevelopment

More information

F. Tip and M. Weintraub FUNCTIONAL TESTING

F. Tip and M. Weintraub FUNCTIONAL TESTING F. Tip and M. Weintraub FUNCTIONAL TESTING ACKNOWLEDGEMENTS Thanks go to Andreas Zeller for allowing incorporation of his materials 2 HOW TO TELL IF A SYSTEM MEETS EXPECTATIONS? Two options: 1. testing:

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java

Object-Oriented Software Engineering Practical Software Development using UML and Java Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Lecture 3 Errors and failure Inputs Error revealing inputs

More information

Announcements. Testing. Announcements. Announcements

Announcements. Testing. Announcements. Announcements Announcements Testing HW0, HW1, and HW2 are graded Grades and feedback in Submitty Email us at csci2600@cs.lists.rpi.edu Use Submitty discussion board! HW0, HW1, and HW2, Quiz 1 and 2 Grades in Submitty

More information