Squish Coco 3.3.2 - Copyright ©2015 Froglogic Gmbh CONTENTS
Total Page:16
File Type:pdf, Size:1020Kb
Squish Coco 3.3.2 - Copyright ©2015 froglogic GmbH CONTENTS Contents 1 Introduction 1 1.1 Squish Coco - Code Coverage Tool for Tcl, C# and C/C++ . .1 1.2 CoverageScanner—Instrumentation during the Generation . .2 1.3 CoverageBrowser—View, Analyse, and Manage, Code Coverage Results . .2 I Quick Start and Tutorials 4 2 Synopsis 5 3 Using Squish Coco 6 4 Creating an instrumented project 7 4.1 Installing Squish Coco ..............................................7 4.2 C++ on Microsoft Visual Studio using the Microsoft Visual Studio Add-in . .7 4.3 C# on Microsoft Visual Studio . .8 4.4 Tcl.........................................................9 4.4.1 Using more than one Tcl version on one system . 10 4.5 Command Line Tools . 10 5 Generating Instrumentations Without Modifying Projects 12 5.1 GNU Make . 12 5.2 Microsoft NMake . 12 5.3 Microsoft Visual Studio . 13 5.4 Microsoft MSBuild . 13 5.5 Mono C# XBuild . 13 6 Instrumenting a simple project 14 6.1 UNIX and Apple Mac OS X setup . 14 6.1.1 Setup . 14 6.1.2 Structure of the parser directories . 15 6.1.3 Compiling and testing . 15 6.1.4 Instrumentation . 15 - i - froglogic GmbH CONTENTS 6.1.5 How the project is instrumented . 16 6.1.6 Additional changes . 17 6.2 Microsoft Windows setup . 17 6.2.1 Setup . 17 6.2.2 Structure of the parser directories . 17 6.2.3 Compiling and testing . 18 6.2.4 Instrumentation . 18 6.2.5 How the project is instrumented . 19 6.2.6 Additional changes . 20 6.3 Beyond the minimal instrumentation . 20 6.3.1 Excluding code from instrumentation . 20 6.3.2 Making the test names visible . 21 6.3.3 Patch file analysis . 21 6.3.4 The patch analysis report . 22 7 Getting started with Qt 23 7.1 Compiling the example application . 23 7.1.1 The First Code Coverage Results . 25 7.1.2 Interactive testing . 26 7.1.3 Writing unit tests . 28 7.2 Working with code coverage data . 32 7.2.1 Post mortem analysis . 33 7.2.2 Evaluating the impact of a hot fix . 34 7.2.3 Black-box testing/distributed testing . 35 7.2.4 Verifying if a bug fix is correctly tested . 36 7.3 Conclusion . 37 II Code Coverage Overview 38 8 Code Coverage Overview 39 8.1 Code instrumentation . 39 8.1.1 Detection . 39 8.1.2 Result of coverage analysis . 42 8.2 Performance . 42 8.3 Statistics . 43 8.4 Other Metrics . 45 8.4.1 Function Coverage . 45 - ii - froglogic GmbH CONTENTS 8.4.2 Line Coverage . 45 9 Testing Methodologies 47 9.1 Hit vs Count . 47 9.2 Strategies . 47 9.2.1 Manual tests . 48 9.2.2 Black box tests . 48 9.2.3 Unit Tests . 48 9.2.4 Automatic Tests . 48 III CoverageBrowser Reference Manual 50 10 Introduction 51 10.1 Command Line Arguments . 51 11 Black box and white box testing 52 12 The windows of CoverageBrowser 53 12.1 The Executions Window . 53 12.1.1 Principles . 53 12.1.2 Loading an Execution Report . 55 12.1.3 The Execution Comparison Analysis Mode . 56 12.2 The Source Browser Window . 57 12.3 The Function Browser Window . 58 12.4 The Source Viewer Window . 58 12.4.1 Source Display . 59 12.4.2 Color Convention . 59 12.4.3 Comments . 60 12.4.3.1 Editing Comments . 60 12.4.3.2 Removing Comments . 61 12.5 The Explanation Window . 61 12.6 The Statistics Window . 62 13 Working with CoverageBrowser 63 13.1 Filtering . 63 13.1.1 Wildcard Expressions . 63 13.1.2 Regular Expression . ..