Software engineering for real-time systems

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Unit-V testing strategies and tactics.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Traditional Approach to Design
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
March 25, R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity Comment percentage Length of identifiers Depth of conditional.
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Program design concepts - slide 1 Software engineering for real-time systems Section 5.
1 “White box” or “glass box” tests “White Box” (or “Glass Box”) Tests.
SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003) Software design - core concepts - slide 1 Software engineering for real-time systems Section.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
CS 425/625 Software Engineering Software Testing
Chapter 18 Testing Conventional Applications
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
Comp 587 Parker Li Bobby Kolski. Automated testing tools assist software engineers to gauge the quality of software by automating the mechanical aspects.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Software Systems Verification and Validation Laboratory Assignment 3
Lecture 17 Software Metrics
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Paradigm Independent Software Complexity Metrics Dr. Zoltán Porkoláb Department of Programming Languages and Compilers Eötvös Loránd University, Faculty.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Software Reviews & testing Software Reviews & testing An Overview.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Product Metrics An overview. What are metrics? “ A quantitative measure of the degree to which a system, component, or process possesses a given attribute.”
Agenda Introduction Overview of White-box testing Basis path testing
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
An Automatic Software Quality Measurement System.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
Software Testing and Quality Assurance 1. What is the objectives of Software Testing?
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
White Box Testing by : Andika Bayu H.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
CHAPTER 9 - PART 2 Software Testing Strategies. Lesson Outlines ■ White box testing – Data processing and calculation correctness tests – Correctness.
Testing Integral part of the software development process.
Software Test Metrics When you can measure what you are speaking about and express it in numbers, you know something about it; but when you cannot measure,
BASIS PATH TESTING.
Cyclomatic Complexity
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
Software Engineering (CSI 321)
Object-Oriented Metrics
Data Coverage and Code Coverage
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
White Box Testing.
UNIT-IV ECS-602 Software engineering PART-I
Cyclomatic Complexity
Cyclomatic Complexity
Software Testing (Lecture 11-a)
Cyclomatic Complexity
“White box” or “glass box” tests
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
Cyclomatic Complexity
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Cyclomatic Complexity
Software Testing “If you can’t test it, you can’t design it”
Software Testing Techniques
By: Lecturer Raoof Talal
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Software engineering for real-time systems Section 11 Analysing and testing source code SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Objectives Introduction To: Explain the underlying concepts of the testing of source code. Describe the basics of static and dynamic analysis. Introduce code complexity metrics. Describe coverage analysis and its use as part of the dynamic analysis process. Illustrate test issues specifically related to object-oriented programming constructs. SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Introduction to software testing Part 1 Overview SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Why test software? SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Approaches to code testing Detecting errors Preventing errors SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Software code test techniques SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Software testing steps Integrate sub-systems then test the complete system Software system Software sub-system 1 Software sub-system 2 Major software function 1 function 2 function 3 Code unit 1 3 2 5 4 Integration of parts Integrate functions then test sub-systems Integrate units then test functions Test units SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Introduction to static analysis Part 2 Static Analysis SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Static analysis techniques SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Automated static analysis tools SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Evaluating program structure - cyclomatic complexity measures McCabe’s cyclomatic complexity metric: a measure of the amount of decision logic in a code unit Control flow graph Graph complexity measured using Cyclomatic complexity techniques Output from module Source code decision logic Input to module Structure described using a Cyclomatic complexity value: the number of independent paths through a control flow graph SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Control flow graph - simple sequence structure Corresponding flow Code of 'module' graph { Statement 1 Node 1 Accel [0] = Xnew; Edge (1-2) Accel [1] = Xold; Accel [2] = Ynew; Statement 2 Node 2 Edge } (2-3) Statement 1 Statement 2 Statement 3 Flowchart Statement 3 Node 3 Cyclomatic complexity value v(G): the number of independent paths through a control flow graph. Here v(G) = 1 SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Control flow graph - simple selection structure Statement Flowchart ? v(G) = 2 SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Control flow graph - simple iteration structure Code of 'module' Corresponding flow graph Node 1 { Edge (1-5) while (DataValue < 10) { Construct 1 Edge (1-2) cout << "\nInput data value"; cin >> DataValue' Construct 2 Node 2 Edge cout << DataValue; Edge (4-1) (2-3) } /* end while */ Construct 3 Node 3 Construct 4 cout << "\nEnd of test"; Edge (3-4) Construct 5 Node 4 } Statement Flowchart ? Node 5 v(G) = 2 SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Example control flow graphs simplest structure achievable Control flow graph - highly complex structure SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Introduction to dynamic analysis Part 3 Dynamic Analysis SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Black box and white box testing Two ways of testing code Overall function Internal workings ‘Black box’ testing Performed at the interfaces ‘White box’ testing Performed on the implementation SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Basis of dynamic testing SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

The test harness SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Features of general-purpose dynamic testing tools SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Coverage analysis and white box testing ‘A measure of the effectiveness and completeness of code testing.’ SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Basis of a practical dynamic testing tool SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Dynamic testing and coverage analysis tool SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Integration and testing Part 4 Integration and test strategies SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Combined unit and integration testing Test code for unit A Test 2 Integrate units A1 and A2 to form A A1 Test 1(a) A2 Test 1(b) Phase 1: test individual units. Phase 2: test the combined unit. This test must exercise all features of A1 and A2. SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Reduced integration testing v Call node (a) Reducedl graph - v(G) = 2 v Reduction steps: 1. Identify ALL control structures of units A1 and A2 not concerned with external units (A). 2. Remove these from the flow graph. Call node (a) Original graph - v(G) = 6 Full flow graph of the integrated unit A. Reduced flow graph of the integrated unit SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Class and object testing Part 5 OO systems - Class and object testing SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Class and object testing SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

OO metrics in general use SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Use of OO metrics Use of OO metrics (class and object) Evaluation of Estimation of Assessment of Prediction of required completeness and coding errors design complexity test effort self-containment Ÿ LOC Ÿ MHF Ÿ DIT Ÿ WMC Ÿ AD Ÿ AHF Ÿ NOC Ÿ RFC Ÿ MD Ÿ LCOM Ÿ LCOM Ÿ MHF Ÿ WMC Ÿ CBO SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Inheritance, polymorphism and testing issues SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Multiple clients using multiple servers having polymorphic methods THE question: How much testing is needed? SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Alternative test strategies with multiple clients/servers SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)

Review of ‘Analysing and testing source code’ SOFTWARE ENGINEERING for REAL-TIME SYSTEMS (© J.E.Cooling 2003)