Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable...
Transcript of Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable...
![Page 1: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/1.jpg)
Coverage testing with CodePro Analytix
So#ware Analysis and Tes1ngCu Nguyen Duy (cunduy at :k dot eu)
Alessandro Marche?o (marche?o at :k dot eu)
Paolo Tonella (tonella at :k dot eu)
Mariano Ceccato (ceccato at :k dot eu)
Academic Year 2010-‐2011
Tuesday, November 9, 2010
![Page 2: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/2.jpg)
Introduction
Is a free, software testing tool for Eclipse Developed by Google Features:
Code analysis (audit, dependency, similarity) Junit test generation Code coverage Metrics for software quality
http://code.google.com/javadevtools/codepro
2
Tuesday, November 9, 2010
![Page 3: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/3.jpg)
Installing CodePro Analytix Use Eclipse to Install New Software
Enter a correct version of Update Site with your Eclipse
http://code.google.com/javadevtools/download-codepro.html
3
Tuesday, November 9, 2010
![Page 4: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/4.jpg)
Generate junit test classes (optional)
Select project, packages, or classes Right click > CodePro Tools > Generate Test
Classes
4
Tuesday, November 9, 2010
![Page 5: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/5.jpg)
Enable coverageRight click on a project > CodePro Tools > Instrument for Code Coverage
5
Tuesday, November 9, 2010
![Page 6: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/6.jpg)
Running for coverage
Run any kind of test cases (junit, FITTEST, etc.)
Run the application like normal use
6
Tuesday, November 9, 2010
![Page 7: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/7.jpg)
Coverage analysis - 1
7
green: covered
red: not covered
Current coverage score
improvement since last run
coverage details
Tuesday, November 9, 2010
![Page 8: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/8.jpg)
Coverage analysis - 2
8
Current coverage score
improvement since last run
History chart
Tuesday, November 9, 2010
![Page 9: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/9.jpg)
Generate coverage report
9
Click on this button
Tuesday, November 9, 2010
![Page 10: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/10.jpg)
Coverage report - 1
10
Tuesday, November 9, 2010
![Page 11: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/11.jpg)
Coverage report - 2
11
Tuesday, November 9, 2010
![Page 12: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/12.jpg)
Exercise 1
Open project: Exercise-3-MathOperators Enable Coverage on this project
Execute Unit TestGenerate coverage reportReport the test coverage of each class,
identify which lines of code have not executed
Task: improve the test cases to reach 100% coverage
12
Tuesday, November 9, 2010
![Page 13: Coverage testing with CodePro Analytix · Exercise 1 Open project: Exercise-3-MathOperators Enable Coverage on this project Execute Unit Test Generate coverage report Report the test](https://reader034.fdocuments.in/reader034/viewer/2022050114/5f4b0097306fd41a4754ed23/html5/thumbnails/13.jpg)
Exercise 2
Similar to exercise 1, with Exercise-4-CurrentAccount
13
Tuesday, November 9, 2010