software testing and analysis tools for productivity and quality

58
Software Testing and Analysis Tools for Productivity and Quality

Upload: softwarecentral

Post on 19-Jun-2015

1.632 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Software Testing and Analysis Tools for Productivity and Quality

Software Testingand Analysis Tools

for Productivity and Quality

Page 2: Software Testing and Analysis Tools for Productivity and Quality

2

SummarySummary

● Verifysoft and its partners

● Cost of software errors● Testing tools in the software development process● Code complexity / Static Analysis.● Code Coverage● Functional Test

Page 3: Software Testing and Analysis Tools for Productivity and Quality

3

Verifysoft Technology GmbHVerifysoft Technology GmbH● Verifysoft Technology GmbH

● Created in June 2003 ● Offenburg (Germany)● 200+ customers in Europe (2009)

● Distributor and developper of Software testing tools● distribution, consulting and support

Page 4: Software Testing and Analysis Tools for Productivity and Quality

4

ActivitiesActivities

● Tools ● Seminars

Page 5: Software Testing and Analysis Tools for Productivity and Quality

5

our pour partnersartners

● Testwell, Tampere (Finland)

● Conformiq, Saratoga (USA)

● Coverity, San Francisco (USA)

Page 6: Software Testing and Analysis Tools for Productivity and Quality

6

our customersour customers

Main sectors of application:Development of critical software:

– Aerospace– Automotive– Medical– Nuclear

Page 7: Software Testing and Analysis Tools for Productivity and Quality

7

ReferencesReferences

and many more...

Page 8: Software Testing and Analysis Tools for Productivity and Quality

8

Cost of software errorsCost of software errors● The losses due to errors of programming

increase every year

Estimation : ???

Page 9: Software Testing and Analysis Tools for Productivity and Quality

9

Cost of software errorsCost of software errors

● Software bugs cost in Europe100-150.000.000.000 Euros/year

→ Tendancy increasing !

The complexity of Software doubles every 18 months.

To face it: the "know-how" of developers!!!

(Les Hatton, Kingston University London)

Page 10: Software Testing and Analysis Tools for Productivity and Quality

10

Cost of software errorsCost of software errors● Software bugs cost up to

14.000.000 Euros per company and per year

50% of the companies found in the first year of utilisation up to 10 critical errors.

IDC-Survey in 2008 „Improving Software Quality to Drive Business Agility“, within American companies with 250 -10.000 employees www.idc.com

Page 11: Software Testing and Analysis Tools for Productivity and Quality

11

Cost of software errorsCost of software errors

40-60% of the global budget is usually used for test and correction

The purpose of testing is to obtain a product „without errors“

Page 12: Software Testing and Analysis Tools for Productivity and Quality

12

Software testSoftware test

Testing is necessary for obtaining certifications

IEC 61508 EN 50128 (Railway) IEC 62304 (Medical) EN 62138 (Nuclear) DO-178B (Aerospace)

Page 13: Software Testing and Analysis Tools for Productivity and Quality

13

Software testSoftware test

Test: is essential But ... expensive … repetitive activity

→ Test-Automatisation → use of testing tools !

Page 14: Software Testing and Analysis Tools for Productivity and Quality

14

Software development processSoftware development processRequirements

Analysis

SystemDesign

ArchitectureDesign

Detailed Specifications

Coding

SoftwareValidation

System Testing

IntegratingTesting

Unit Testing

Black box tests

White box testsTestwell CMT++

CMTJavaComplexity

Measures

Testwell CTA++Unittest

Testwell CTC++Code Coverage

Conformiq Qtronic

Functional Test

Page 15: Software Testing and Analysis Tools for Productivity and Quality

15

Software development processSoftware development processRequirements

Analysis

SystemDesign

ArchitectureDesign

Detailed Specifications

Coding

SoftwareValidation

System Testing

IntegratingTesting

Unit Testing

Black box tests

White box testsTestwell CMT++

CMTJavaComplexity

Measures

Testwell CTA++Unittest

Testwell CTC++Code Coverage

Conformiq Qtronic

Functional Test

Page 16: Software Testing and Analysis Tools for Productivity and Quality

16

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Testwell CMT++ Testwell CMTJava

Code Complexity

Measures Tools

for C/C++ and Java

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 17: Software Testing and Analysis Tools for Productivity and Quality

17

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 18: Software Testing and Analysis Tools for Productivity and Quality

18

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava● Why analysing the code complexity?

● Code complexity correlates with the defect rate and robustness of the application

● Complex code is difficult to test → more errors in the final application

● Complex code is difficult to maintain● Unnecessary complex code is often the reason for bad

code quality and erroneous programs.

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 19: Software Testing and Analysis Tools for Productivity and Quality

19

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Testwell CMT++ and Testwell CMTJava analyses your applications for the following metrics:

● Lines-of-code (LOC) metrics● Halstead's metrics● McCabe cyclomatic number v(G) ● Maintainability Index

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 20: Software Testing and Analysis Tools for Productivity and Quality

20

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Lines-of-code (LOC) metrics:● LOCphy

number of physical lines● LOCpro

number of lines with program code● LOCbl

number of blanc lines● LOCcom

number of lines with comments

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 21: Software Testing and Analysis Tools for Productivity and Quality

21

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Lines-of-code (LOC) metrics:

● Recommanded standard for fonctions: between 4 and 40 program lines

A function definition contains at least a prototype, one line of code, and a pair of braces, which makes 4 lines. A function longer than 40 program lines probably implements many functions.

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 22: Software Testing and Analysis Tools for Productivity and Quality

22

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Lines-of-code (LOC) metrics:

● Recommanded standard for files: between 4 and 400 program lines

The smallest entity that may reasonably occupy a whole source file is a function, and the minimum length of a function is 4 lines.

Files longer than 400 program lines (10..40 functions) are usually too long to be understood as a whole.

Comments : 30 to 75%

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 23: Software Testing and Analysis Tools for Productivity and Quality

23

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

McCabe Cyclomatic Number v(G) describes the complexity of thecontrol flow of a program.

The greater the cyclomatic number is the more execution paths there are through the function, and the harder it is to understand.

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 24: Software Testing and Analysis Tools for Productivity and Quality

24

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

McCabe Cyclomatic Number v(G)

● recommanded standard for fonctions: <15If a function has a cyclomatic number of 15, there are at least 15 (but probably more) execution paths through it.More than 15 paths are hard to identify and test.

● recommanded standard for files: <100

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 25: Software Testing and Analysis Tools for Productivity and Quality

25

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJavaHalstead's metrics

● B estimated number of bugs

● D difficulty level, error proneness

● E effort to implement

● L program level (abstraction level of the program)

● N program length

● N1 number of operators

● N2 numbre of operands

● n vocabulary size (unique operators + unique operands)

● n1 number of unique operators

● n2 number of unique operands

● T implementation time / time to understand

● V volume: size of the implementation of an algorithm

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 26: Software Testing and Analysis Tools for Productivity and Quality

26

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Maintainability Index (MI)

indicates when it becomes cheaper and less risky to rewrite the code instead to change it.

● 85 and more good maintainability● 65-85 moderate maintainability● < 65 difficult to maintain

→ with really bad pieces of code (big, uncommented, unstructured) the MI value can be even negative

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 27: Software Testing and Analysis Tools for Productivity and Quality

27

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Page 28: Software Testing and Analysis Tools for Productivity and Quality

28

Testwell CMT++ / CMTJavaTestwell CMT++ / CMTJava

Development ViewManagement View

Controlling View

Pdf-reports

Page 29: Software Testing and Analysis Tools for Productivity and Quality

29

Software development processSoftware development processRequirements

Analysis

SystemDesign

ArchitectureDesign

Detailed Specifications

Coding

SoftwareValidation

System Testing

IntegratingTesting

Unit Testing

Black box tests

White box testsTestwell CMT++

CMTJavaComplexity

Measures

Testwell CTA++Unittest

Testwell CTC++Code Coverage

Conformiq Qtronic

Functional Test

Page 30: Software Testing and Analysis Tools for Productivity and Quality

30

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Testwell CTC++ Test Coverage Analyser

for C/C++

CTC add-on for Java and C#

Page 31: Software Testing and Analysis Tools for Productivity and Quality

31Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Code coverage

shows the parts of the code● executed / not executed ● tested / not tested

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 32: Software Testing and Analysis Tools for Productivity and Quality

32Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Why measuring the code coverage?● helps to write better (more adapted) tests/test cases

● helps to avoid that you spend time on writing redundant test cases

● you know when you can stop testing

● you can proof to your customers that your code is tested according to their requirements

● you can be sure that your outsourcing/development partner delivers quality according to your requirements

● ensures high quality with high code coverage

● helps to find "dead code"

● required to obtain certifications.

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 33: Software Testing and Analysis Tools for Productivity and Quality

33Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Testwell CTC++ for all coverage levels:

● Function Coverage● Decision Coverage● Condition/Branch Coverage● Modified Condition/Decision Coverage (MC/DC)● Multicondition Coverage (MCC)

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 34: Software Testing and Analysis Tools for Productivity and Quality

34Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Testwell CTC++ can be used to obtain certifications in automotive, avionics and medical industries

i.e. DO-178B - all levels: A, B, C - of the Federal Aviation Administration, FAA or for EN 61508

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 35: Software Testing and Analysis Tools for Productivity and Quality

35Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Testwell CTC++ is very easy to use● no need of code modifications● support of existing makefiles● GUI integration in several IDEs

– Microsoft Visual Studio

– WindRiver Tornado

– Borland C++ 5.02

– Metrowerks CodeWarrior

– Eclipse

– ...

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 36: Software Testing and Analysis Tools for Productivity and Quality

36Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Reports in Text, XML or HTML● shows the untested code parts ● shows how many time each

code part has been executed ● different coverage reports

– Summary-Levels– Untested Code– Execution Profile Listing

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 37: Software Testing and Analysis Tools for Productivity and Quality

37Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

Testwell CTC++ ideal for embedded targets

● very low instrumentation overhead● performs code coverage in all targets

→ “host target add-on” is provided in source code→ can be easily adapted to new targets

● works even with smallest targets and microcontrollers● works with all compilers / cross-compilers

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 38: Software Testing and Analysis Tools for Productivity and Quality

38Testwell CTC++, CMT++ and CMTJava are products of Testwell Oy, Tampere (Finland)

„CTC++ Add-on for Java and C#“

extension of Testwell CTC++ for Java and C#

→ You only need one code coverage tool for C, C++, Java, C#, ...

Testwell CTC++ Test Coverage Testwell CTC++ Test Coverage AnalyserAnalyser

Page 39: Software Testing and Analysis Tools for Productivity and Quality

39

Software development processSoftware development processRequirements

Analysis

SystemDesign

ArchitectureDesign

Detailed Specifications

Coding

SoftwareValidation

System Testing

IntegratingTesting

Unit Testing

Black box tests

White box testsTestwell CMT++

CMTJavaComplexity

Measures

Testwell CTA++Unittest

Testwell CTC++Code Coverage

Conformiq Qtronic

Functional Test

Page 40: Software Testing and Analysis Tools for Productivity and Quality

40Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Model-Based Automated Test Model-Based Automated Test DesignDesign

for functional testsfor functional tests

(black box tests)

for software and systems

Conformiq QtronicConformiq Qtronic

Page 41: Software Testing and Analysis Tools for Productivity and Quality

41Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Manual tests takes time...and leads to risks

incorrect tests

missed tests

redundant tests

maintenance of tests

Conformiq QtronicConformiq Qtronic

Page 42: Software Testing and Analysis Tools for Productivity and Quality

42Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Our solution: Automated Test Design

→ model driven testing, model based testing, specification based testing,

specification driven testing,

...

Conformiq QtronicConformiq Qtronic

Page 43: Software Testing and Analysis Tools for Productivity and Quality

43

Automatic test generation and execution based on your design models

instead of writting the tests manually

Manual vs. AutomaticManual vs. Automatic

Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

X

Page 44: Software Testing and Analysis Tools for Productivity and Quality

44Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

The tool automates the design of functional tests (black box tests) for software and systems

Model Driven TestingModel Driven Testing

Page 45: Software Testing and Analysis Tools for Productivity and Quality

45Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Manual vs. AutomaticManual vs. Automatic

11

QQQQSystem Model

Test Plan

Manual test script

Automatic test generation Script execution

Script execution

Page 46: Software Testing and Analysis Tools for Productivity and Quality

46Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Model Driven TestingModel Driven Testing

Benefits:Benefits:

● enforces the quality of requirements enforces the quality of requirements documentation documentation

● creates a common platform for designers creates a common platform for designers and testersand testers

● self documentedself documented

Page 47: Software Testing and Analysis Tools for Productivity and Quality

47Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

● Textually in Java (with elements in C#)→ „Qtronic Modelling Language“ (QML)

● Grafically in UML State Charts (optional)

● The model can be created with:– Text editor („Java“)– Qtronic Modeller (UML State Charts)– or Third Party Modeling (UML) tools

ModellingModelling

Page 48: Software Testing and Analysis Tools for Productivity and Quality

48Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Process:Creation of the model Import of the model Selection of the test coverage requirements and formats for the test scripts. Automatic test generation with Conformiq Qtronic

Test execution in your environment.

Test generationTest generation

Page 49: Software Testing and Analysis Tools for Productivity and Quality

49Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Formats for the test scripts generation:

Python TCL TTCN-3C, C++ Visual Basic JavaJunit Perl ExcelHTML Word Shell Scripts

Test generationTest generation

Page 50: Software Testing and Analysis Tools for Productivity and Quality

50Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts generationTest scripts generation

Page 51: Software Testing and Analysis Tools for Productivity and Quality

51Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts generationTest scripts generation

Test scripts Generation progress

List of test scripts

Page 52: Software Testing and Analysis Tools for Productivity and Quality

52Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts generationTest scripts generation

Test scripts Generation progress

List of test scripts

Requirement Tracebilityof the test scripts

Page 53: Software Testing and Analysis Tools for Productivity and Quality

53Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts generationTest scripts generation

Test scripts Generation progress

List of test scripts

Requirement-TracebilityOf the test scripts

Message Sequence Chartfor a test script

Test Step Viewwith detailled information

about contents

Page 54: Software Testing and Analysis Tools for Productivity and Quality

54Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts generationTest scripts generation

Test scripts Generation progress

List of test scripts

Requirement Tracebilityof the test scriptsMessage Sequence Chart

for a test script Test Step Viewwith detailled information

about contents

Execution Trace View:shows the execution's

trace in the model

Page 55: Software Testing and Analysis Tools for Productivity and Quality

55Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Conformiq QtronicConformiq Qtronic

Model

Test scripts generation

Page 56: Software Testing and Analysis Tools for Productivity and Quality

56Conformiq Qtronic is a product and a trademark of Conformiq Inc., Saratoga (USA)

Test scripts executionin your existing evironment(manually or automatically)

Test scripts executionTest scripts execution

Model

Test ScriptsTest Execution

PlatformSystem Under Test

Test Harnes s

Reports

Model

Page 57: Software Testing and Analysis Tools for Productivity and Quality

57

ReviewReview

→ Cost of software errors

→ Testing tools in the software development process

→ Code Complexity / Static Analysis

→ Code Coverage→ Automatic Test Generator

Page 58: Software Testing and Analysis Tools for Productivity and Quality

58

more Informationmore Information

Tel: +49 781 63 92 [email protected]

Thank you!Thank you!